public void Stop()
 {
     y.Stop();
     yplayer.SetActive(false);
     //PopupYoutube.FullYoutubeView(youtubeid);
     // PopupYoutube.CustomYoutubeView(youtubeid,true,false,true,800,400);
 }
Beispiel #2
0
        private IEnumerator SkipVideoRoutine()
        {
            _player.Stop();
            _skipButton.SetActive(false);

            yield return(new WaitForSeconds(0.1f));

            ViewOverlay.Instance.EnableFor(1f);

            _expoCharacterCustomizationUI.OnJoinClick();
        }
 //Experimental YouTube player
 public bool tryLoadYoutube(string url)
 {
     if (youtubePlayer != null)
     {
         youtubePlayer.Stop();
         youtubePlayer.HideLoading();
         youtubePlayer.OnVideoPlayerFinished();
         //If detect Youtube video, play Youtube video!
         if (youtubePlayer.TryNormalizeYoutubeUrlLocal(url, out url))
         {
             Debug.Log(url);
             youtubePlayer.ShowLoading();
             youtubePlayer.Play(url);
             return(true);
         }
     }
     return(false);
 }
Beispiel #4
0
    //set face data
    public void setFaceData(string json)
    {
        if (json == null)
        {
            return;
        }

        //Quick Blink message
        if (json.Equals("blink"))
        {
            blinkTimer = 0; return;
        }

        //Tank control message (Prefaced with a "t")
        if (json.Substring(0, 1).Equals("t"))
        {
            TankSpeed tankSpeed = JsonUtility.FromJson <TankSpeed>(json.Substring(1));
            tankController.remoteControlTank(tankSpeed.x * 0.01f, tankSpeed.y * 0.01f);
            return;
        }

        //Full face message
        previousExpression = expression;
        FaceData faceData = JsonUtility.FromJson <FaceData>(json);

        if (faceData != null)
        {
            try {
                rate       = faceData.ra * 0.01f;
                pitch      = faceData.p * 0.01f;
                expression = faceData.e;
                speech     = faceData.s;
                faceColor  = new Color(faceData.r / 255f,
                                       faceData.g / 255f,
                                       faceData.b / 255f);

                Speaker.Silence();
                mp3MusicPlayer.StopMP3();

                youtubePlayer.Stop();
                youtubePlayer.HideLoading();
                youtubePlayer.OnVideoPlayerFinished();

                //If detect Youtube video, play Youtube video!
                string checkYoutubeUrl = speech;
                if (youtubePlayer.TryNormalizeYoutubeUrlLocal(checkYoutubeUrl, out checkYoutubeUrl))
                {
                    Debug.Log(checkYoutubeUrl);
                    youtubePlayer.ShowLoading();
                    youtubePlayer.Play(checkYoutubeUrl);
                    //    youtubePlayer.PlayYoutubeVideo(checkYoutubeUrl);
                }
                //If detect MP3 music file, play MP3 from local file.
                else if (speech.Length > 4 && speech.Substring(speech.Length - 4).ToLower() == ".mp3")
                {
                    mp3MusicPlayer.PlayMP3FromFile(speech);
                }
                //Otherwise play Speech-to-Text;
                else
                {
                    Speaker.Speak(speech, null, null, true, rate, pitch, 1); //rate = 0-3, pitch = 0-2, volume = 0-1
                }
                if (chatlog)
                {
                    chatlog.userSpoke(speech);
                }

                //Blink
                eyeBlend = 0f;
            } catch (Exception e) { Debug.LogException(e, this); }
        }
    }
 private void CloseStreamFile()
 {
     mPlayer.Stop();
 }
Beispiel #6
0
 public void Stop()
 {
     player.Stop();
 }
 public void StopYoutube()
 {
     y.Stop();
     yplayer.SetActive(false);
 }
Beispiel #8
0
 public void DisableVideo()
 {
     _youTubePlayerScript.Stop();
     _youTubePlayerScript.gameObject.SetActive(false);
     _youTubePlayerScript.youtubeUrl = null;
 }