Play video in a loop

I’m trying to play video in a loop. Start at a specific time, play 20 seconds, pause for 5 seconds(not necessary now) and play the same part of the video again.

For tests, I’m using SCIndependentPlayback plugin (with WPF controls).

I’ve tried:

PlaybackController pc = ClientControl.Instance.GetPlaybackController(_playbackFQID);
pc.PlaybackTime = start;
pc.PlaybackMode = PlaybackController.PlaybackModeType.Forward;
pc.SequenceProgressChanged += new EventHandler<PlaybackController.ProgressChangedEventArgs>(_playbackController_SequenceProgressChanged);
pc.SkipGaps = false;
pc.SetSequence(start, end);

or

_playbackWpfUserControl = new PlaybackWpfUserControl();
_playbackWpfUserControl.ShowTimeSpanControl = true;
_playbackWpfUserControl.Init(_playbackFQID);
//_playbackWpfUserControl.SetSequence(start, end);
_playbackWpfUserControl.SelectionFromTime = start; _playbackWpfUserControl.SelectionToTime = end;

but video is not looping. Also SequenceProgressChanged event is not triggered,

I’ve checked MediaPlaybackViewer2015 sample

DateTime start = _playbackController.PlaybackTime;
DateTime end = _playbackController.PlaybackTime + TimeSpan.FromSeconds(20);
 
_playbackController.SequenceProgressChanged += new EventHandler<PlaybackController.ProgressChangedEventArgs>(_playbackController_SequenceProgressChanged);
_playbackController.SetSequence(start, end);
_playbackController.PlaybackMode = PlaybackController.PlaybackModeType.Forward;
_playbackController.PlaybackSpeed = 5.0F;

and it works fine.

Any tips how to play video in a loop?

As far as I can tell SetSequence is only implemented recently in standalone but not in Smart Client.

You can do it by doing a stop, a goto time and a start when you reach the time you want to be the end of your sequence period.

The documentation does not say this. I will work with Milestone Development that either SetSequence get supported in Smart Client or the documentation get corrected.

This will be fixed so that SetSequence will work in Smart Client 2018R2.

In 2018R3 it seems SetSequence still does not work in WPFPlayBackControl .

I worked around the issue using GoToCommand

            var offset = TimeSpan.FromMinutes((endTime-startTime).TotalMinutes / 2);
            var playBackTimeSpan = TimeSpan.FromMinutes(endTime-startTime);
            
            var controller = ClientControl.Instance.GeneratePlaybackController();
            PlaybackControl = new PlaybackWpfUserControl();
 
            PlaybackControl.Init(controller);
            PlaybackControl.TimeSpan = playBackTimeSpan;
 
            var gotoCommand = new PlaybackCommandData();
            gotoCommand.Command = PlaybackData.Goto;
            gotoCommand.DateTime = startTime + offset;
            EnvironmentManager.Instance.SendMessage(new Message(MessageId.SmartClient.PlaybackCommand, gotoCommand), controller);
 
            var startCommand = new PlaybackCommandData();
            startCommand.Command = PlaybackData.Next;
            EnvironmentManager.Instance.SendMessage(new Message(MessageId.SmartClient.PlaybackCommand, startCommand), controller);