private void HandlePlayRequest(TracklistEntry entry, float timeSkip) { float fadeTime = entry.GetEntranceFadeTime(); ITrack nextTrack = entry.GetTrack(); currentOutput.FadeOut(fadeTime); // This even fires as the track is fading out, not strictly as it ends. Good enough for our purposes. // if (TrackEndsEvent != null) { // TrackEndsEvent (currentOutput.GetTrack ()); // } currentOutput = GetOutputForNewEntry(entry); currentOutput.SetTrack(nextTrack); // safety LoadTrackIfNeeded(nextTrack); currentOutput.FadeIn(fadeTime); if (NewTrackBeginsEvent != null) { NewTrackBeginsEvent(nextTrack); } if (timeSkip != 0) { Diglbug.Log("TracklistPlayer Skipping to catch up with signal delay: " + timeSkip, PrintStream.AUDIO_PLAYBACK); currentOutput.SetTrackTime(timeSkip); } else { Diglbug.Log("TracklistPlayer timeSkip neglibile", PrintStream.AUDIO_PLAYBACK); } }
private void Awake() { GameObject playerObject; #if UNITY_EDITOR playerObject = GameObject.Instantiate(Resources.Load("Desktop_Video_Player")) as GameObject; #else playerObject = GameObject.Instantiate(Resources.Load("Mobile_Video_Player")) as GameObject; #endif playerObject.transform.SetParent(transform, false); player = playerObject.GetComponent <VideoPlayer>(); }
public void SwitchTracks() { currentOutput = GetNextOutput(); }
// private delegate void TrackEndsDelegate (ITrack track); // private event TrackEndsDelegate TrackEndsEvent; private void Awake() { currentOutput = multiPlayer; }