IEnumerator WaitToPlay()
    {
        print(Time.time);
        yield return(new WaitForSeconds(58)); // Will update wait time to 58 seconds later, set to 2 seconds for testing.

        tex.Play();
        print(Time.time);
    }
Beispiel #2
0
        public void Play()
        {
#if UNITY_WEBPLAYER || UNITY_WEBGL
            Debug.Log("playing");
            Movie.Play();
#elif UNITY_ANDROID || UNITY_IPHONE
#else
            Movie.Play();
#endif
        }
Beispiel #3
0
    void OnGUI()
    {
        GUI.enabled = tex.isReady;

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Play"))
        {
            tex.Play();
        }
        if (GUILayout.Button("Pause"))
        {
            tex.Pause();
        }
        tex.loop = GUILayout.Toggle(tex.loop, "Loop");
        GUILayout.EndHorizontal();

        var oldT = tex.time;
        var newT = GUILayout.HorizontalSlider(tex.time, 0.0f, tex.duration);

        if (oldT != newT)
        {
            tex.Seek(newT);
        }

        GUI.enabled = true;
    }
 // Use this for initialization
 void Start()
 {
     webGLMovieTexture = new WebGLMovieTexture("StreamingAssets/Chrome_ImF.mp4");
     cube.GetComponent<MeshRenderer>().material = new Material(Shader.Find("Diffuse"));
     cube.GetComponent<MeshRenderer>().material.mainTexture = webGLMovieTexture;
     webGLMovieTexture.Play();
 }
Beispiel #5
0
    void OnGUI()
    {
#if UNITY_WEBGL && !UNITY_EDITOR
#else
        return;
#endif

        GUI.enabled = tex.isReady;

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Play"))
        {
            tex.Play();
        }

        /*if (GUILayout.Button("Pause"))
         *      tex.Pause();
         * tex.loop = GUILayout.Toggle(tex.loop, "Loop");
         * GUILayout.EndHorizontal();
         *
         * var oldT = tex.time;
         * var newT = GUILayout.HorizontalSlider(tex.time, 0.0f, tex.duration);
         * if (!Mathf.Approximately(oldT, newT))
         *      tex.Seek(newT);
         */
        GUI.enabled = true;
    }
Beispiel #6
0
 public void Play()
 {
     if (IsReadyToPlay)
     {
         _movieTexture.Play();
         _status = StreamingVideoStatus.Playing;
     }
 }
    IEnumerator WaitToPlay()
    {
        print(Time.time);
        yield return(new WaitForSeconds(147));

        tex2.Play();
        print(Time.time);
    }
 public void OnResume()
 {
             #if UNITY_WEBGL
     tex.Play();
             #elif !UNITY_WEBGL
     mediaPlayerCtrl.Play();
             #endif
 }
Beispiel #9
0
    private void Start()
    {
        CommMovie = new WebGLMovieTexture("StreamingAssets/vid_Comm.ogg");

        GetComponent <Renderer>().materials[1].mainTexture = CommMovie;
        CommMovie.Play();
        //      ((MovieTexture)GetComponent<Renderer>().materials[1].mainTexture).loop = true;
        //((MovieTexture)GetComponent<Renderer>().materials[1].mainTexture).Play();
    }
        public void Play()
        {
            Debug.Log("Play() IsReadyToPlay: " + IsReadyToPlay);

            if (IsReadyToPlay)
            {
                m_movieTexture.Play();
                _status = StreamingVideoStatus.Playing;
            }
        }
 public void OnPlayVideo()
 {
             #if UNITY_WEBGL //&& !UNITY_EDITOR
     tex = new WebGLMovieTexture("StreamingAssets/EasyMovieTexture.mp4");
     videoPlaySurface.GetComponent <MeshRenderer>().material             = new Material(Shader.Find("Diffuse"));
     videoPlaySurface.GetComponent <MeshRenderer>().material.mainTexture = tex;
     tex.Play();
     tex.loop = true;
             #elif !UNITY_WEBGL
     Debug.LogError("Play Video");
     mediaPlayerCtrl.Play();
     mediaPlayerCtrl.m_bAutoPlay = true;
             #endif
 }
 public void Start()
 {
     //StartCoroutine(WaitToPlay());
     visualiser.Play();
 }