public void LoadVideo(VideoDisplay videoDisplay) { currentVideo = videoDisplay; if (GuideAdapter.Instance) { Haze.Logger.Log("Loading video: " + videoDisplay.VideoName); GuideAdapter.Instance.SendLoadVideo(videoDisplay.VideoName, videoDisplay.Settings.is360 ? "360" : "235"); displaying = true; allDevicesReady = false; startedPlayback = false; lastTimeShown = 0; videoPlayer.OpenMedia(new MediaPath(videoDisplay.FullPath, MediaPathType.RelativeToPersistentDataFolder), autoPlay: false); timeSlider.SetValueWithoutNotify(0); Haze.Logger.Log("Loading..."); onLoad.Invoke(); onPause.Invoke(); HasVideoLoaded = true; ConnectionsDisplayer.UpdateAllDisplays(); } else { Haze.Logger.LogError("Error: No GuideAdapter instance!"); } }
private void Update() { //check whether we have all the videos on each device connected to us foreach (VideoDisplay videoDisplay in displayedVideos) { string videoName = videoDisplay.VideoName; ConnectionsDisplayer cd = ConnectionsDisplayer.Instance; bool allConnectedDevicesHaveIt = true; int numberOfConnectedDevices = 0; if (cd != null) { foreach (ConnectionsDisplayer.DisplayedConnectionHandle handle in cd.Handles) { if (handle.connection.paired) { ++numberOfConnectedDevices; if (!handle.display.VideosAvailable.Contains(videoName)) { allConnectedDevicesHaveIt = false; //if(videoDisplay == VideoDisplay.expandedDisplay) // videoDisplay.contract();//no longer available. //<- we do not need to do this anymore. Simply greying out the "Choose" button is enough. break; } } } } bool previouslyAvailable = videoDisplay.Available; videoDisplay.Available = allConnectedDevicesHaveIt; if (videoDisplay.Available && numberOfConnectedDevices > 1 && videoDisplay.Settings.choices.Length > 0) { videoDisplay.Available = false; //Cannot display a video with choices if there's more than one device connected yet! } //Close the expanded display if its no longer available... /*if(VideoDisplay.expandedDisplay == videoDisplay && !videoDisplay.Available) { * videoDisplay.contract(); * }*/ //Nope - instead simply update it if (VideoDisplay.expandedDisplay == videoDisplay && previouslyAvailable != videoDisplay.Available) //only update if its availability changed this frame { videoDisplay.expand(); } } }
public void Auth() { if(CurrentPIN == pinInput.text) { IsAppUnlocked = true; TemporalUnlock = true; //Update all device displays foreach(ConnectionsDisplayer.DisplayedConnectionHandle h in ConnectionsDisplayer.Instance.Handles) { h.display.UpdateDisplay(); } //Ok! if(shouldOpenSettings) { openSettingsPanel.Invoke(); } CloseAuthPanel(); ConnectionsDisplayer.UpdateAllDisplays(); if(VideoDisplay.expandedDisplay != null) { VideoDisplay.expandedDisplay.expand();//update that display. } } }
private void OnDestroy() { Instance = null; }
private void Start() { Instance = this; }