Example #1
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;
    }
 public void Seek(float time)
 {
     if (IsReadyToPlay)
     {
         float clampedTime = Mathf.Min(PluginMathUtils.GetSafeFloat(time), m_movieTexture.duration);
         m_movieTexture.Seek(clampedTime);
     }
 }
Example #3
0
        public void Stop()
        {
#if UNITY_WEBPLAYER || UNITY_WEBGL
            Movie.Pause();
            Movie.Seek(0f);
#elif UNITY_ANDROID || UNITY_IPHONE
#else
            Movie.Stop();
#endif
        }