Created
October 27, 2021 19:07
-
-
Save rdelrosario/be4304c251a23f1461d12656bdfb21e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainViewModel : INotifyPropertyChanged | |
{ | |
public MainViewModel() | |
{ | |
_videoPlayerStateMachine.Configure(VideoState.Playing) | |
.OnActivate(OnStateEntry) | |
.OnEntry(OnStateEntry) | |
.PermitReentryIf(VideoTrigger.Forward) | |
.PermitReentryIf(VideoTrigger.Rewind) | |
.Permit(VideoTrigger.Pause, VideoState.Paused) | |
.Permit(VideoTrigger.Stop, VideoState.Stopped) | |
.OnEntryFrom(rewindParamTrigger, (seconds) => { | |
MainThread.BeginInvokeOnMainThread(() => | |
{ | |
Position = Position.Subtract(TimeSpan.FromSeconds(seconds)); | |
}); | |
}) | |
.OnEntryFrom(forwardParamTrigger, (seconds) => { | |
MainThread.BeginInvokeOnMainThread(() => | |
{ | |
Position = Position.Add(TimeSpan.FromSeconds(seconds)); | |
}); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment