Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
Disabled seeking / syncing for live sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
robvdpol committed Nov 6, 2021
1 parent 37ce7a2 commit 1d09cfc
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions RaceControl/RaceControl/ViewModels/VideoDialogViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ public VideoDialogViewModel(
public ICommand TogglePauseCommand => _togglePauseCommand ??= new DelegateCommand(TogglePauseExecute).ObservesCanExecute(() => MediaPlayer.IsStarted);
public ICommand TogglePauseAllCommand => _togglePauseAllCommand ??= new DelegateCommand(TogglePauseAllExecute);
public ICommand ToggleMuteCommand => _toggleMuteCommand ??= new DelegateCommand<bool?>(ToggleMuteExecute).ObservesCanExecute(() => MediaPlayer.IsStarted);
public ICommand FastForwardCommand => _fastForwardCommand ??= new DelegateCommand<int?>(FastForwardExecute).ObservesCanExecute(() => MediaPlayer.IsStarted);
public ICommand SyncSessionCommand => _syncSessionCommand ??= new DelegateCommand(SyncSessionExecute).ObservesCanExecute(() => MediaPlayer.IsStarted);
public ICommand FastForwardCommand => _fastForwardCommand ??= new DelegateCommand<int?>(FastForwardExecute, CanFastForwardExecute).ObservesProperty(() => MediaPlayer.IsStarted).ObservesProperty(() => PlayableContent);
public ICommand SyncSessionCommand => _syncSessionCommand ??= new DelegateCommand(SyncSessionExecute, CanSyncSessionExecute).ObservesProperty(() => MediaPlayer.IsStarted).ObservesProperty(() => PlayableContent);
public ICommand ShowMainWindowCommand => _showMainWindowCommand ??= new DelegateCommand(ShowMainWindowExecute);
public ICommand ToggleRecordingCommand => _toggleRecordingCommand ??= new DelegateCommand(ToggleRecordingExecute).ObservesCanExecute(() => MediaPlayer.IsStarted);
public ICommand ToggleFullScreenCommand => _toggleFullScreenCommand ??= new DelegateCommand<long?>(ToggleFullScreenExecute);
Expand Down Expand Up @@ -293,6 +293,11 @@ private void ToggleMuteExecute(bool? mute)
MediaPlayer.ToggleMute(mute);
}

private bool CanFastForwardExecute(int? seconds)
{
return MediaPlayer.IsStarted && !PlayableContent.IsLive;
}

private void FastForwardExecute(int? seconds)
{
if (seconds.HasValue)
Expand All @@ -301,6 +306,11 @@ private void FastForwardExecute(int? seconds)
}
}

private bool CanSyncSessionExecute()
{
return MediaPlayer.IsStarted && !PlayableContent.IsLive;
}

private void SyncSessionExecute()
{
var payload = new SyncStreamsEventPayload(PlayableContent.SyncUID, MediaPlayer.GetCurrentTime());
Expand Down

0 comments on commit 1d09cfc

Please sign in to comment.