public void PlayVideo() { if (_multipleMedia != null) { _multipleMedia.Play(); } else { Debug.Log("Player not initialized."); } }
public override bool checkSalient(float currentTime, MultiplePlayerControl multiMedia, HeadTrack _headtrack) { float relativeTime = currentTime - this.startTime; int currentFrame = (int)(relativeTime * multiMedia.Player.Info.GetVideoFrameRate()); int gateFrame = (int)(this.gateTime * multiMedia.Player.Info.GetVideoFrameRate()); int curView = _headTrack.GetVisibleView(); if (_currentView != curView) { if (multiMedia.isTransitioning && multiMedia.currentLoopArc.toTime > multiMedia.currentLoopArc.fromTime) { Debug.Log("VIEW CHANGED IN MIDDLE OF TRANSITION. Was " + _currentView + ". Now: " + curView + ". Calling FinishTransition."); multiMedia.FinishTransition(); } if (multiMedia.IsPaused()) { if (GetComponent <PreviewMode>().requestedPlayMode) { Debug.Log("CURVIEW WAS IN PAUSED STATE. Now: " + curView + ". Playing again."); _headtrack.playMode = true; } } _currentView = curView; } if (!_ROIWithinView) { if (isTargetView(curView)) { _ROIWithinView = true; if (multiMedia.isTransitioning) { Debug.Log("TARGET CAME INTO VIEW AGAIN. Calling FinishTransition"); multiMedia.FinishTransition(); } if (multiMedia.IsPaused()) { _headtrack.playMode = true; multiMedia.Play(); } } } if (multiMedia.isTransitioning && (!isTargetView(curView) && sp.IsCutFrame(curView, currentFrame))) { Debug.Log("Current frame: " + currentFrame + ". Entered another valid frame when transitioning.... Exiting transition"); multiMedia.FinishTransition(); Debug.Log("Exited? " + !multiMedia.isTransitioning); } if (multiMedia.isTransitioning) { Debug.Log("Current loop is " + multiMedia.currentLoopArc); multiMedia.UnidirectionalTransition(); multiMedia.expectedCurrentFrame = currentFrame; multiMedia.expectedNextFrame = currentFrame + 1; } else { Transition(currentFrame, _currentView, multiMedia, _headtrack); } return(currentTime > this.endTime); // Return true if Headtrack can move onto the next clip. Else false. }