IEnumerator CheckInputVideo() { if (chapterVideo.m_strFileName == "putitback.mp4") { chapterVideo.Stop(); chapterVideo.UnLoad(); chapterVideo.Load("Chapter04b-HD.mp4"); pauseUI.SetActive(false); yield return(new WaitForSeconds(1f)); mainUI.SetActive(true); enableNextBtn(); //chapterVideo.Play(); } else { chapterVideo.OnEnd -= onChapterVideoEnded; chapterVideo.Stop(); chapterVideo.UnLoad(); Resources.UnloadUnusedAssets(); System.GC.Collect(); SceneManager.LoadScene("Adventure1_6"); } }
IEnumerator CheckInputVideo() { if (adminVideo2.m_strFileName == "putitback.mp4") { adminVideo2.Stop(); adminVideo2.UnLoad(); adminVideo2.Load("admin/opening.mp4"); yield return(new WaitForSeconds(1f)); adminVideo2.Play(); } else { adminVideo2.OnEnd -= onAdminVideoEnded2; adminVideo2.Stop(); adminVideo2.UnLoad(); adminVideo2.gameObject.SetActive(false); chapterVideo.gameObject.SetActive(true); pauseUI.SetActive(false); playChapterVideo(); } }
void OnDisable() { if (Main.Main3DCamera != null) { Main.Main3DCamera.enabled = true; } if (_DefaluImgVideoRoot != null && _DefaluImgVideoRoot.activeSelf) { _DefaluImgVideoRoot.SetActive(false); } PreprareRawImage(_DefaluImgVideo); if (_MediaCtrl != null) { _MediaCtrl.Stop(); _MediaCtrl.DeleteVideoTexture(); _MediaCtrl.UnLoad(); } if (_VideoManagerObj != null) { _VideoManagerObj.SetActive(false); } _VideoName = ""; _OnEndCallback = null; _StopOnClick = false; }
public void ChangeMovie(string movieName, bool autoplay = true) { mediaPlayerCtrl.Stop(); mediaPlayerCtrl.Load(movieName); if (autoplay) { mediaPlayerCtrl.Play(); } else { mediaPlayerCtrl.Stop(); } }
/// <summary> /// 清空所有对按钮的事件添加 /// </summary> public void OnDisable() { //Remove evnet favorite.onClick.RemoveAllListeners(); markless.onClick.RemoveAllListeners(); download.onClick.RemoveAllListeners(); videoplayerbtn.onClick.RemoveAllListeners(); markerlessclosebtn.onClick.RemoveAllListeners(); markerlesscdownloadbtn.onClick.RemoveAllListeners(); if (Scannermanager.Getinstance().onparsingitemend != null) { Scannermanager.Getinstance().onparsingitemend = null; } //clean cache mediaplayer.m_strFileName = null; mediaplayer.Stop(); mediaplayer.UnLoad(); DestroyImmediate(videopayer.texture); videoplayerbtn.gameObject.SetActive(true); //set favorite to null //favorite.GetComponent<Image>().sprite = Resources.Load<Sprite>("Ui/btn_like_nor"); }
public void OnStop() { #if UNITY_WEBGL //&& !UNITY_EDITOR #elif !UNITY_WEBGL mediaPlayerCtrl.Stop(); #endif }
public void FacebookBackPressed() { fb_movie_control.Stop(); iTween.ScaleTo(mainPush[1].sns_panel, iTween.Hash("scale", new Vector3(0, 0, 0), "time", 0.5f)); MainSetting(); }
public void Reload() { player.Stop(); player.UnLoad(); player.m_strFileName = null; youtubeLiveStream.PlayYoutubeVideo(youtubeLiveStream.videoId); }
public void selectMode(ref GameObject currentObject) { for (int i = 0; i < selectTarget.Length; ++i) { if (selectTarget[i] == currentObject) { Global.currentSelectMode = (SelectMode)i; Debug.Log(Global.currentSelectMode.ToString() + " Selected."); if (Global.currentSelectMode != SelectMode.Setting) { loadingToast.SetActive(true); changeScene(); for (int j = 0; j < Global.modeVideoName.Length; ++j) { MediaPlayerCtrl videoCache = RSC.GetVideo(Global.modeVideoName[j]).GetComponent <MediaPlayerCtrl>(); videoCache.Stop(); } } else { denyMessage(); return; } } } }
public void finishMovie() { m_TitleMovie.m_bPlayMovie = false; if (m_ScrMedia.GetCurrentState() != MediaPlayerCtrl.MEDIAPLAYER_STATE.END) { m_ScrMedia.Stop(); } m_ScrMedia.DeleteVideoTexture(); if (m_clear == true) { UnityUtil.SetObjectEnabledOnce(gameObject, false); if (m_destroy == true) { Destroy(gameObject); } } else { UnityUtil.SetObjectEnabled(m_kabe, true); } if (m_bgmid != BGMManager.EBGM_ID.eBGM_INIT) { SoundUtil.PlayBGM(m_bgmid, false); } }
void OnGUI() { if (GUI.Button(new Rect(50, 50, 100, 100), "Load")) { scrMedia.Load("Roof.mp4"); } if (GUI.Button(new Rect(50, 200, 100, 100), "Play")) { scrMedia.Play(); } if (GUI.Button(new Rect(50, 350, 100, 100), "stop")) { scrMedia.Stop(); } if (GUI.Button(new Rect(50, 500, 100, 100), "pause")) { scrMedia.Pause(); } if (GUI.Button(new Rect(50, 650, 100, 100), "Unload")) { scrMedia.UnLoad(); } }
void OnGUI() { if (GUI.Button(new Rect(50, 25, 50, 50), "Load")) { scrMedia.Load("EasyMovieTexture.mp4"); } if (GUI.Button(new Rect(50, 75, 50, 50), "Play")) { scrMedia.Play(); } if (GUI.Button(new Rect(50, 125, 50, 50), "stop")) { scrMedia.Stop(); } if (GUI.Button(new Rect(50, 175, 50, 50), "pause")) { scrMedia.Pause(); } if (GUI.Button(new Rect(50, 225, 50, 50), "Unload")) { scrMedia.UnLoad(); } }
IEnumerator Wait() { // scrMedia.Play(); // waitingActive = true; entered = true; L_buttons [0].SetActive(false); L_buttons [1].SetActive(false); start = false; Timer_Text.enabled = true; videoplayer [1].SetActive(true); Start_Time = 25; timer = Start_Time; yield return(new WaitForSeconds(20f)); print(Time.time); L_buttons [1].SetActive(true); // scrMedia.Stop(); // videoplayer [1].SetActive(false); Timer_Text.enabled = false; }
void Start() { mLoadBtn.onClick.AddListener(new UnityEngine.Events.UnityAction(() => { player.Load("EasyMovieTexture.mp4"); })); mPlayBtn.onClick.AddListener(new UnityEngine.Events.UnityAction(() => { if (player.GetCurrentState() == MediaPlayerCtrl.MEDIAPLAYER_STATE.PLAYING) { player.Stop(); mPlayBtn.GetComponentInChildren <Text>().text = "Play"; } else if (player.GetCurrentState() == MediaPlayerCtrl.MEDIAPLAYER_STATE.PAUSED) { player.Play(); mPlayBtn.GetComponentInChildren <Text>().text = "Pause"; } })); mQuitBtn.onClick.AddListener(new UnityEngine.Events.UnityAction(() => { player.UnLoad(); })); player.OnEnd += OnEnd; player.OnReady += OnReady; player.OnVideoFirstFrameReady += OnFirstFrameReady; }
void OnGUI() { if (GUI.Button(new Rect(50, 50, 100, 100), "Load")) { scrMedia.Load("EasyMovieTexture.mp4"); m_bFinish = false; } if (GUI.Button(new Rect(50, 200, 100, 100), "Play")) { scrMedia.Play(); m_bFinish = false; } if (GUI.Button(new Rect(50, 350, 100, 100), "stop")) { scrMedia.Stop(); } if (GUI.Button(new Rect(50, 500, 100, 100), "pause")) { scrMedia.Pause(); } if (GUI.Button(new Rect(50, 650, 100, 100), "Unload")) { scrMedia.UnLoad(); } if (GUI.Button(new Rect(50, 800, 100, 100), " " + m_bFinish)) { } }
void ScreenBack() { SendMsg(new MsgBase((ushort )UIEvent.ShowVideoDetailRoot)); VideoPlayerRoot.SetActive(false); scrMedia.Stop(); isStoped = true; }
public void LoadVideo(string currentVideo) { _videoPlayer.Stop(); _videoPlayer.UnLoad(); _videoPlayer.m_strFileName = videoPath + currentVideo + ".mp4"; _videoPlayer.Load(_videoPlayer.m_strFileName); _videoPlayer.Play(); }
void onAdminVideoEnded() { adminVideo.OnEnd -= onAdminVideoEnded; adminVideo.Stop(); adminVideo.UnLoad(); mainUI.SetActive(true); physicalMissionScreen.SetActive(true); pauseUI.SetActive(false); }
void onAdminVideoEnded() { adminVideo.OnEnd -= onAdminVideoEnded; adminVideo.Stop(); adminVideo.UnLoad(); adminVideo.gameObject.SetActive(false); mainUI.SetActive(true); photoController.GetImageFromCamera(); pauseUI.SetActive(false); }
void onChapterVideoEnded() { chapterVideo.OnEnd -= onChapterVideoEnded; chapterVideo.Stop(); chapterVideo.UnLoad(); pauseUI.SetActive(false); Resources.UnloadUnusedAssets(); System.GC.Collect(); SceneManager.LoadScene("Adventure1_2"); }
/// <summary> /// Stop the video. /// </summary> public void Stop() { if (CurrentState != StateType.Started) { return; } #if USE_EASY_MOVIE_TEXTURE if (easyMovieTexture == null) { return; } easyMovieTexture.Stop(); #elif USE_UNITY_VIDEO_PLAYER if (videoPlayer == null) { return; } videoPlayer.Stop(); #elif USE_ANDROID_MEDIA_PLAYER if (mediaPlayer == null) { return; } Pause(); try { mediaPlayer.Call("seekTo", 0); } catch (Exception e) { Debug.LogError(TAG + " Failed to stop mediaPlayer: " + e.Message); UpdateState(StateType.Error); } #elif USE_VIVE_MEDIA_DECODER if (mediaDecoder == null) { return; } Pause(); mediaDecoder.setSeekTime(0); #else if (movieTexture == null || audioSource == null) { return; } movieTexture.Stop(); audioSource.Stop(); #endif UpdateState(StateType.Stopped); }
public void Stop(bool startMusic = true) { if (isPlaying || isPaused) { videoPlayer.Stop(); if (startMusic) { transform.localScale = new Vector3(0, 0, 0); StartCoroutine(CueBackgroundMusic()); } isPlaying = false; isPaused = false; } }
void OnGUI() { if (GUI.Button(new Rect(50, 50, 100, 100), "Load")) { scrMedia.Load("EasyMovieTexture.mp4"); m_bFinish = false; } if (GUI.Button(new Rect(50, 200, 100, 100), "Play")) { scrMedia.Play(); m_bFinish = false; } if (GUI.Button(new Rect(50, 350, 100, 100), "stop")) { scrMedia.Stop(); } if (GUI.Button(new Rect(50, 500, 100, 100), "pause")) { scrMedia.Pause(); } if (GUI.Button(new Rect(50, 650, 100, 100), "Unload")) { scrMedia.UnLoad(); } if (GUI.Button(new Rect(50, 800, 100, 100), " " + m_bFinish)) { } if (GUI.Button(new Rect(200, 50, 100, 100), "SeekTo")) { scrMedia.SeekTo(10000); } if (scrMedia.GetCurrentState() == MediaPlayerCtrl.MEDIAPLAYER_STATE.PLAYING) { if (GUI.Button(new Rect(200, 200, 100, 100), scrMedia.GetSeekPosition().ToString())) { } if (GUI.Button(new Rect(200, 350, 100, 100), scrMedia.GetDuration().ToString())) { } } }
void OnGUI() { toolbarInt = GUI.Toolbar(new Rect(10, 10, 250, 50), toolbarInt, new string[] { "内网", "腾讯云", "搬瓦工" }); GUI.Label(new Rect(400, 10, 450, 50), scrMedia.GetCurrentState().ToString()); GUI.Label(new Rect(500, 10, 550, 50), "本机IP:" + Network.player.ipAddress.ToString() + " 端口:8001"); GUI.Label(new Rect(500, 60, 550, 100), str_show); switch (toolbarInt) { case 0: url = "rtsp://192.168.2.124:9554/webcam"; break; case 1: url = "rtsp://rty813.xyz:28080/webcam"; break; case 2: url = "rtsp://23.105.201.132:39554/webcam"; break; } scrMedia.m_strFileName = url; if (GUI.Button(new Rect(50, 80, 100, 110), "Load")) { scrMedia.Load(url); m_bFinish = false; } if (GUI.Button(new Rect(50, 200, 100, 100), "Play")) { scrMedia.Play(); m_bFinish = false; } if (GUI.Button(new Rect(50, 350, 100, 100), "stop")) { scrMedia.Stop(); } if (GUI.Button(new Rect(50, 500, 100, 100), "pause")) { scrMedia.Pause(); } if (GUI.Button(new Rect(50, 650, 100, 100), "Unload")) { scrMedia.UnLoad(); } }
/// <summary> /// 返回主页面 /// </summary> public void BackMainClick() { Debug.Log("BackMainClick"); Transform VideoPlayFather = GameObject.Find("VideoPlayFather").transform; if (SceneManager.GetActiveScene().name == "Main" || SceneManager.GetActiveScene().name == "MainVR") { MediaPlayerCtrl mediaPlayerCtrl = VideoPlayFather.Find("Cinema/VideoScreen").GetComponent <MediaPlayerCtrl>(); mediaPlayerCtrl.Stop(); } LiveVideoCanvasRoot.gameObject.SetActive(false); LiveVideoRoot.gameObject.SetActive(false); LightManger.instance.VideoScreenVR.SetActive(false); LightManger.instance.VideoScreen.SetActive(false); LauncherUIManager.instance.LauncherView.gameObject.SetActive(true); SendMsg(new MsgBase((ushort)UIEvent.ShowBottomPart)); LiveVolumeSlider.gameObject.SetActive(false); LiveUImanager.instance.LiveRoot.gameObject.SetActive(true); }
public void LightOff() { if (!isOn) { return; } Debug.Log("LightController: Light off!"); isOn = false; Debug.Log("video state: " + backgroundPlayer.GetCurrentState()); Debug.Log("lightSwitch position: " + backgroundPlayer.GetSeekPosition()); if (backgroundPlayer.GetSeekPosition() > 0) { backgroundPlayer.Stop(); } else { backgroundPlayer.SeekTo(lightOffStartSeekPosition); } Debug.Log("lightSwitch position: " + backgroundPlayer.GetSeekPosition()); backgroundPlayer.Play(); }
void onAdminVideo2Ended() { if (adminVideo2.m_strFileName == "putitback.mp4") { mainUI.SetActive(true); enableNextBtn(); } else { adminVideo2.Stop(); adminVideo2.UnLoad(); //adminVideo2.gameObject.SetActive (false); adminVideo2.OnEnd -= onAdminVideo2Ended; mainUI.SetActive(true); adminVideo2.Load("putitback.mp4"); pauseUI.SetActive(false); photoController.GetImageFromCamera(); } }
/// <summary> /// 返回主页面 /// </summary> public void BackMainClick() { Debug.Log("BackMainClick"); Transform VideoPlayFather = GameObject.Find("VideoPlayFather").transform; if (SceneManager.GetActiveScene().name == "Main" || SceneManager.GetActiveScene().name == "MainVR") { MediaPlayerCtrl mediaPlayerCtrl = VideoPlayFather.Find("Cinema/VideoScreen").GetComponent <MediaPlayerCtrl>(); mediaPlayerCtrl.Stop(); } else { mediaPlayerCtrl.Stop(); } if (SceneStatus.sceneEnum == SceneEnum.MainVR) { LightManger.instance.VideoCanvasRoot.SetActive(false); LightManger.instance.VideoCanvasRootVR.SetActive(false); LightManger.instance.VideoCanvasRoot.transform.Find("VideoContolRoot").gameObject.SetActive(false); LightManger.instance.VideoCanvasRootVR.transform.Find("VideoContolRoot").gameObject.SetActive(false); LightManger.instance.VideoScreen.SetActive(false); LightManger.instance.VideoScreenVR.SetActive(false); } else { SceneManager.LoadScene("Main"); } VideoControl.instance.VideoDetailRoot.gameObject.SetActive(true); VideoCanvasRoot.SetActive(false); //LightManger.instance.VideoPlay.SetActive(false); }
public void StopButtonPressed() { controls.Stop(); }
public void continueVideo() { scrMedia.Stop(); scrMedia.Load("ContinueVideo.mp4"); scrMedia.Play(); }