public void SendGetPlayStateCommand(VideoInfo viewModelVideoInfo) { var getPlayingStateCommand = new Command(); getPlayingStateCommand.Name = "GetPlayingState"; getPlayingStateCommand.Params = new List<Param>(); getPlayingStateCommand.Params.Add(new Param() { Name="NodeId", Value=viewModelVideoInfo.Id.ToString()}); Utilities.SendMessage(MessageSender, getPlayingStateCommand); }
public void SendSetSourceCommand(INode node) { VideoSizeHelper sizeHelper = new VideoSizeHelper(node); RelatedContentPanelUtil.Instance.LoadRelatedVideoContent(VideoSource, sizeHelper.Size); var setSourceCommand = new Command(); setSourceCommand.Name = "Play"; setSourceCommand.Params = new List<Param>(); setSourceCommand.Params.Add(new Param() { Name="Source", Value=VideoSource}); setSourceCommand.Params.Add(new Param() { Name="StartTimeCode", Value="00:00:00"}); setSourceCommand.Params.Add(new Param() { Name="AutoPlay", Value="false"}); setSourceCommand.Params.Add(new Param() { Name="NodeId", Value=node.Id.ToString()}); if (_playerInitialised) { Utilities.SendMessage(MessageSender, setSourceCommand); } else { _cachedCommand = setSourceCommand; } }
public void SendPlayCommand(VideoInfo viewModelVideoInfo, bool isAutoPlay = true) { RelatedContentPanelUtil.Instance.LoadRelatedVideoContent(viewModelVideoInfo.VideoSource, viewModelVideoInfo.Size); var playCommand = new Command(); playCommand.Name = "Play"; playCommand.Params = new List<Param>(); playCommand.Params.Add(new Param() { Name = "Source", Value = viewModelVideoInfo.VideoSource }); playCommand.Params.Add(new Param() { Name="StartTimeCode", Value=viewModelVideoInfo.StartPosition.ToString()}); if (viewModelVideoInfo.StopPosition != null) { playCommand.Params.Add(new Param() { Name="EndTimeCode", Value=viewModelVideoInfo.StopPosition.ToString()}); } playCommand.Params.Add(new Param() { Name="NodeId", Value=viewModelVideoInfo.Id.ToString()}); playCommand.Params.Add(new Param() { Name = "AutoPlay", Value = isAutoPlay.ToString()}); if (_playerInitialised) { Utilities.SendMessage(MessageSender, playCommand); } else { _cachedCommand = playCommand; } }
public void SendPauseCommand(VideoInfo viewModelVideoInfo) { var pauseCommand = new Command(); pauseCommand.Name = "Pause"; Utilities.SendMessage<Command>(MessageSender, pauseCommand); }
public void SendGetStopPositionCommand(VideoInfo viewModelVideoInfo) { var getEndPositionCommand = new Command(); getEndPositionCommand.Name = "GetSourceAndPosition"; getEndPositionCommand.Params = new List<Param>(); getEndPositionCommand.Params.Add(new Param() { Name = "CallbackId", Value = "EndPosition" }); getEndPositionCommand.Params.Add(new Param() { Name = "NodeId", Value = viewModelVideoInfo.Id.ToString() }); Utilities.SendMessage(MessageSender, getEndPositionCommand); }
private void HandlePlayerDisposedEvent(Event disposedEvent) { _cachedCommand = null; _playerInitialised = false; if (disposedEvent.EventArgs != null && disposedEvent.ContainsEventArg("NodeId")) { string viewModelIdAsString = disposedEvent.GetEventArgValue("NodeId"); var viewModelId = new Guid(viewModelIdAsString); if (ViewModels.ContainsKey(viewModelId)) { VideoInfo viewModelVideoInfo = ViewModels[viewModelId]; _isChangedByController = true; viewModelVideoInfo.Status = VideoState.Pause; } } }
//Sent to the Video Player so that if Gylma starts after the Video Player the Video Player will ping back that it's initialised public void Initialised() { var initialisedEvent = new Command() { Name = "Initialised" }; Utilities.SendMessage(MessageSender, initialisedEvent); }
private void HandleInitialisedEvent() { if (!_playerInitialised) { _playerInitialised = true; if (_cachedCommand != null) { Utilities.SendMessage(MessageSender, _cachedCommand); _cachedCommand = null; } } }