// ------------------------------------------- /* * The video is prepared and ready to play */ private void OnPreparedVideo(Texture2D _event) { #if ENABLE_STREAMING m_streamingWindow.color = new Color(1, 1, 1, 1); m_ump.Play(); #endif }
private void Play(string url) { Url = url; if (TbURL != null) { TbURL.text = url; } else { Debug.LogError("TbURL == null"); } if (Player != null) { Player.Path = url; } else { Debug.LogError("Player == null"); } if (PlayAction != null) { PlayAction(url); } else { Player.Stop(); Player.Play(); PlayVideo(); } }
public void StreamingToggle() { if (isStreaming == false) { ump.Path = "rtsp://" + ipAddress.text + ":8554"; ump.Play(); isStreaming = true; txtStreaming.text = "스트리밍 멈춤"; btnLeft.interactable = true; btnRight.interactable = true; btnUp.interactable = true; btnDown.interactable = true; btnZoomIn.interactable = true; btnZoomOut.interactable = true; } else { ump.Stop(); cctvView.texture = null; isStreaming = false; txtStreaming.text = "스트리밍 시작"; btnLeft.interactable = false; btnRight.interactable = false; btnUp.interactable = false; btnDown.interactable = false; btnZoomIn.interactable = false; btnZoomOut.interactable = false; } }
/// <summary> /// 显示视屏(通过Rtsp地址) /// </summary> /// <param name="rtspUrl"></param> public void ShowVideo(string rtspUrl, DevInfo devInfo) { if (window) { window.SetActive(true); } if (connectBg) { connectBg.SetActive(true); } tempDevInfo = devInfo; if (string.IsNullOrEmpty(rtspUrl)) { Debug.LogError("Error : RtspVideo.ShowVideo-> rtspURL is null!"); UGUIMessageBox.Show("Rtsp地址未输入,是否启用霍尼韦尔视频?", "确定", "取消", ShowHoneyWellVideo, Close, Close); return; } if (player) { if (player.IsPlaying) { player.Stop(); } player.Path = rtspUrl; player.Play(); } else { Debug.LogError("Error : RtspVideo.ShowVideo-> UniversalMediaPlayer is null!"); } }
/// <summary> /// 显示视屏(通过Rtsp地址) /// </summary> /// <param name="rtspUrl"></param> public void ShowVideo(string rtspUrl, UniversalMediaPlayer vedioPlayer) { try { if (connectBg) { connectBg.SetActive(true); } if (vedioPlayer) { if (vedioPlayer.Player == null) { Debug.LogError("Error : RtspVideo.ShowVideo-> vedioPlayer.Player == null!"); return; } if (vedioPlayer.IsPlaying) { vedioPlayer.Stop(); } vedioPlayer.Path = rtspUrl; vedioPlayer.Volume = 100; vedioPlayer.PlayRate = 1; vedioPlayer.Play(); } else { Debug.LogError("Error : RtspVideo.ShowVideo-> UniversalMediaPlayer is null!"); } } catch (Exception ex) { Debug.LogError("Error : RtspVideo.ShowVideo-> " + ex); } }
public void Play() { Log.Info("PlaybackWindow.Play1", string.Format("IsPlaying:{0},AbleToPlay:{1},IsReady:{2},Length:{3},AutoPlay:{4}", Player.IsPlaying, Player.AbleToPlay, Player.IsReady, Player.Length, Player.AutoPlay)); if (Player.IsPlaying) { Player.Stop(); Log.Info("PlaybackWindow.Play", "Stop"); } //Player.Play(); //ContentMask.SetActive(false); Player.AutoPlay = true; Player.Play(); ContentMask.SetActive(false); StartPlay = true; Log.Info("PlaybackWindow.Play2", string.Format("IsPlaying:{0},AbleToPlay:{1},IsReady:{2},Length:{3},AutoPlay:{4}", Player.IsPlaying, Player.AbleToPlay, Player.IsReady, Player.Length, Player.AutoPlay)); }
/* * How to reproduce the bug: * 1. Run the app on an Android device. * 2. Press Play button. * 3. After the video has been started, press Quit. * 4. Run the app again. * 5. Press Play button. * 6. Crash. */ public void PlayButtonHandler() { UniversalMediaPlayer player = FindObjectOfType <UniversalMediaPlayer>(); Assert.IsNotNull(player); player.Path = "rtmp://vd2.wmspanel.com/video_demo/stream"; player.Play(); }
public IEnumerator OpenCloseTwoVideo() { IsActionOnScene = true; TwoGamesTarget = false; MediaPlayer.IsVideoEnded = false; if (!string.IsNullOrEmpty(DataTargetManager.Instance.VideoLink1)) { UniWebPLayerObject.SetActive(true); MediaPlayer._path = DataTargetManager.Instance.VideoLink1; MediaPlayer.Play(); while (!MediaPlayer.IsVideoEnded) { yield return(new WaitForEndOfFrame()); } UniWebPLayerObject.SetActive(false); } MediaPlayer.IsVideoEnded = false; if (!string.IsNullOrEmpty(DataTargetManager.Instance.VideoLink2)) { UniWebPLayerObject.SetActive(true); MediaPlayer._path = DataTargetManager.Instance.VideoLink2; MediaPlayer.Play(); while (!MediaPlayer.IsVideoEnded) { yield return(new WaitForEndOfFrame()); } UniWebPLayerObject.SetActive(false); } MediaPlayer.IsVideoEnded = true; if (!RecognizeColorComponent.IsRecognizeAvailable) { IsActionOnScene = false; } HideAllObjects(); yield return(null); }
public void Play() { var t = UnityEngine.Random.Range(1, 100); Debug.Log("T: " + t); _mediaPlayer.Play(); _mediaPlayer.Volume = t; Debug.Log("V: " + _mediaPlayer.Volume); }
public override void Init(params object[] args) { base.Init(args); videoPLayerRoot = PanManager.GlobalUIRoot.Find("3DVideoRoot").transform; videoPLayerRoot.gameObject.SetActive(true); mediaPlayer = videoPLayerRoot.Find("360SphereVideo/UniversalMediaPlayer").GetComponent <UniversalMediaPlayer>(); videoCameraTran = videoPLayerRoot.Find("VideoCamera"); mediaPlayer.Path = args[0].ToString(); mediaPlayer.Play(); }
public void Play() { if (_player == null) { return; } if (!File.Exists(_player.Path)) { return; } _playingState = true; _player.Play(); }
public void StreamRoom(string classroomname, int roomid) { //universalMediaPlayer.Path = "rtmp://" + serverAddress + "/live/" + classroomname; //#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN // //universalMediaPlayer.Path = "http://" + ipAddress + "/dash/" + classroomname + ".mpd"; // universalMediaPlayer.Path = "rtmp://" + ipAddress + "/live/" + classroomname; //#if UNITY_ANDROID // universalMediaPlayer.Path = "http://77.232.100.197/hls/class01.m3u8"; //#endif currentSelectedRoomID = roomid; universalMediaPlayer.Play(); }
// 播放 private void OnPlayButton() { if (mediaPlayer) { mediaPlayer.Play(); } pauseBtn.gameObject.SetActive(true); playBtn.gameObject.SetActive(false); AdminMessage msg = new AdminMessage(); msg.Type = DataType.AdminEvent; msg.Data.Progress = mediaPlayer.Time; msg.Data.Control = ControlState.Play; NetManager.SendMessage(Util.ObjectToJson(msg)); }
public void PlayCreditsRoll() { umpPlayer = GameObject.FindWithTag("UMP"); ump = umpPlayer.GetComponent <UniversalMediaPlayer>(); if (!showing) { ump.Path = path; ump.Play(); showing = true; } else { ump.PlayRate = 2; } }
public void StreamingToggle() { if (isStreaming == false) { ump.Path = rtspURL.text; ump.Play(); isStreaming = true; txtStreaming.text = "스트리밍 멈춤"; } else { ump.Stop(); cctvView.texture = null; isStreaming = false; txtStreaming.text = "스트리밍 시작"; } }
/// <summary> /// 显示视屏(通过Rtsp地址) /// </summary> /// <param name="rtspUrl"></param> private void ShowVideo(string rtspUrl, UniversalMediaPlayer vedioPlayer) { if (connectBg) { connectBg.SetActive(true); } if (vedioPlayer) { if (vedioPlayer.IsPlaying) { vedioPlayer.Stop(); } vedioPlayer.Path = rtspUrl; vedioPlayer.Play(); } else { Debug.LogError("Error : RtspVideo.ShowVideo-> UniversalMediaPlayer is null!"); } }
// Update is called once per frame void Update() { if (switchCued) { ump.Play(); switchCued = false; } if (Input.GetKeyUp("1")) { if (using2) { ump.Path = file1; } else { ump.Path = file2; } using2 = !using2; ump.Stop(); switchCued = true; } }
public void Play() { _mediaPlayer.Play(); }
// Update is called once per frame void Update() { if (umpSwitchQueued) { umPlayer.Play(); umpSwitchQueued = false; } if (!shouldLoop && umPlayer.Length - umPlayer.Time < 300) { umPlayer.Pause(); //print("End Pause"); } if (umPlayer.Path != curPath) { print("Attempting Change"); // works correctly umPlayer.Stop(); umPlayer.Play(); curPath = umPlayer.Path; } if (fileMode) { umPlayer.Pause(); //print("File Pause"); } if (timeShifting != 0) { umPlayer.Pause(); //print("Timeshift Pause"); progContainer.SetActive(true); vidProgress.enabled = true; vidProgressChange.enabled = true; forwardTime += Time.deltaTime; float shift = timeShifting * 25 * Time.deltaTime * Mathf.Pow(forwardTime, 1.5f); umPlayer.Position += shift * 1000 / umPlayer.Length; //print("Shifting - FTime:" + forwardTime + ", Shift: " + shift); source.volume = 0.0f; } else { progContainer.SetActive(false); vidProgress.enabled = false; vidProgressChange.enabled = false; forwardTime = 0; source.volume = 1.0f; if (!fileMode && umPlayer.Length - umPlayer.Time > 1000 && !umPlayer.IsPlaying) { umPlayer.Play(); } } if (progHover) { progContainer.SetActive(true); vidProgress.enabled = true; vidProgressChange.enabled = true; } timeShifting = 0; float videoLength = umPlayer.Length / 1000f; float vTime = umPlayer.Time / 1000f; vidProgress.fillAmount = vTime / videoLength; int minutes = Mathf.FloorToInt(vTime / 60); int seconds = Mathf.FloorToInt(vTime - 60 * minutes); string vidProgString; if (seconds < 10) { vidProgString = minutes + ":0" + seconds; } else { vidProgString = minutes + ":" + seconds; } timeText.text = vidProgString + "/" + vidLengthString; //print("Frame Extension: " + (vPlayer.frameCount / vPlayer.frameRate)); // this method actually works //print("ClipLength: " + (vPlayer.clip.length / 60)); // 3.8 min is double recorded amount ------ is the same amount for all videos!!! if (Input.GetKeyUp("9")) { Application.LoadLevel(0); } }
private void OnlineAudioConroller() { if (Application.internetReachability == NetworkReachability.NotReachable) { if (isOnline || !isOnline && debug.text == ("You're offline")) { isOnline = false; isRelax = false; isCalm = false; isEnergize = false; isPlaySprite = true; playBtn.sprite = playSpr; debug.text = ("You're offline"); UMP.Stop(); audioSource.Stop(); if (offlineAudioSource.clip != defaultClip) { offlineAudioSource.clip = defaultClip; } if (!offlineAudioSource.isPlaying) { offlineAudioSource.Play(); } } } else { if (!isOnline) { isOnline = true; debug.text = ""; } if (!audioSource.isPlaying) { if (isRelax) { if (offlineAudioSource.isPlaying) { offlineAudioSource.Stop(); } UMP.Path = relaxURL; UMP.Play(); } else if (isCalm) { if (offlineAudioSource.isPlaying) { offlineAudioSource.Stop(); } UMP.Path = calmURL; UMP.Play(); } else if (isEnergize) { if (offlineAudioSource.isPlaying) { offlineAudioSource.Stop(); } UMP.Path = energizeURL; UMP.Play(); } } } }
void ReceiveVideoStream_Android() { universalMediaPlayer.Play(); }
public void ConnectCamera() { Debug.Log("Connecting wifi cam"); UMP.Play(); }
public override void Setup(string path) { player.Path = rtspScheme + path; player.Play(); Debug.Log("Startttt : " + path); }