public void StartPauseVideo(VideoStartPauseAsset videoStartPauseAsset) { switch (videoStartPauseAsset.VideoAction) { case VideoStartPauseAsset.VideoActionEnum.START: _videoPlugin.Resume(); break; case VideoStartPauseAsset.VideoActionEnum.PAUSE: _videoPlugin.Pause(); break; case VideoStartPauseAsset.VideoActionEnum.START_OVER_TIME: _videoPlugin.ToggleFadedPlayPause(true); break; case VideoStartPauseAsset.VideoActionEnum.PAUSE_OVER_TIME: _videoPlugin.ToggleFadedPlayPause(false); break; case VideoStartPauseAsset.VideoActionEnum.STOP: Debug.LogError("STOP is not implemented!"); break; default: Debug.LogWarning("StartPauseVideo: Video Action \"" + videoStartPauseAsset.ToString() + "\" is not implemented."); break; } }
private IEnumerator DoVideoActionAfter(int frameAmount, VideoStartPauseAsset videoStartPauseAsset) { for (int ii = 0; ii < frameAmount; ++ii) { yield return(null); // Wait for one frame. } StartPauseVideo(videoStartPauseAsset); }
public void HandleVideoStartPauseAsset(VideoStartPauseAsset videoStartPauseAsset, Sender sender) { UdpVideoSync udpVideoSync; if (_udpVideoSyncDict.TryGetValue(videoStartPauseAsset.Asset_Id, out udpVideoSync)) { udpVideoSync.StartPauseVideo(videoStartPauseAsset); } }
private void CallReceivedVideoStartPauseMessage(VideoStartPauseAsset videoStartPauseAsset, UdpReceiver.ReceivedMessage.Sender sender) { if (ReceivedVideoStartPauseMessage != null) { foreach (ReceivedVideoStartPauseMessageDelegated Callack in ReceivedVideoStartPauseMessage.GetInvocationList()) { try { Callack(videoStartPauseAsset, sender); } catch (System.Exception ex) { Debug.LogException(ex); } } } }
public void DoStartPauseSynced(VideoStartPauseAsset.VideoActionEnum videoAction) { if (_configMgr.applicationType == CmdConfigManager.AppType.WALL) { // Send command to floor: VideoStartPauseAsset videoStartPauseAsset = new VideoStartPauseAsset(); videoStartPauseAsset.Asset_Id = networkId; videoStartPauseAsset.VideoAction = videoAction; udpManager.SenderToFloor.AddMessage(JsonUtility.ToJson(videoStartPauseAsset)); if (_configMgr.networkFrameDelay > 0) { StartCoroutine(DoVideoActionAfter(_configMgr.networkFrameDelay, videoStartPauseAsset)); } else { StartPauseVideo(videoStartPauseAsset); } } }
protected override void ReceivedEventMessage(string jsonString, uint eventIdentifier, UdpReceiver.ReceivedMessage.Sender sender) { switch (eventIdentifier) { case EventIdentifierVideo.VIDEO_SYNC: VideoSyncAsset videoSyncAsset = JsonUtility.FromJson <VideoSyncAsset>(jsonString); CallReceivedVideoSyncMessage(videoSyncAsset, sender); break; case EventIdentifierVideo.VIDEO_START_PAUSE: VideoStartPauseAsset videoStartPauseAsset = JsonUtility.FromJson <VideoStartPauseAsset>(jsonString); CallReceivedVideoStartPauseMessage(videoStartPauseAsset, sender); break; case EventIdentifierVideo.VIDEO_LOAD: VideoLoadAsset videoLoadAsset = JsonUtility.FromJson <VideoLoadAsset>(jsonString); CallReceivedVideoLoadMessage(videoLoadAsset, sender); break; default: base.ReceivedEventMessage(jsonString, eventIdentifier, sender); break; } }