// -------------------------------------------

        /*
         * 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
        }
Exemplo n.º 2
0
    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();
        }
    }
Exemplo n.º 3
0
    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;
        }
    }
Exemplo n.º 4
0
 /// <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);
     }
 }
Exemplo n.º 6
0
    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));
    }
Exemplo n.º 7
0
/*
 * 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();
    }
Exemplo n.º 8
0
    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);
    }
Exemplo n.º 9
0
    public void Play()
    {
        var t = UnityEngine.Random.Range(1, 100);

        Debug.Log("T: " + t);
        _mediaPlayer.Play();
        _mediaPlayer.Volume = t;
        Debug.Log("V: " + _mediaPlayer.Volume);
    }
Exemplo n.º 10
0
 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();
 }
Exemplo n.º 11
0
 public void Play()
 {
     if (_player == null)
     {
         return;
     }
     if (!File.Exists(_player.Path))
     {
         return;
     }
     _playingState = true;
     _player.Play();
 }
Exemplo n.º 12
0
        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();
        }
Exemplo n.º 13
0
    // 播放
    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));
    }
Exemplo n.º 14
0
    public void PlayCreditsRoll()
    {
        umpPlayer = GameObject.FindWithTag("UMP");
        ump       = umpPlayer.GetComponent <UniversalMediaPlayer>();

        if (!showing)
        {
            ump.Path = path;
            ump.Play();
            showing = true;
        }
        else
        {
            ump.PlayRate = 2;
        }
    }
Exemplo n.º 15
0
 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 = "스트리밍 시작";
     }
 }
Exemplo n.º 16
0
 /// <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!");
     }
 }
Exemplo n.º 17
0
    // 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();
 }
Exemplo n.º 19
0
    // 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);
        }
    }
Exemplo n.º 20
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();
             }
         }
     }
 }
Exemplo n.º 21
0
 void ReceiveVideoStream_Android()
 {
     universalMediaPlayer.Play();
 }
Exemplo n.º 22
0
 public void ConnectCamera()
 {
     Debug.Log("Connecting wifi cam");
     UMP.Play();
 }
Exemplo n.º 23
0
 public override void Setup(string path)
 {
     player.Path = rtspScheme + path;
     player.Play();
     Debug.Log("Startttt : " + path);
 }