title: Unity VideoPlayer and WebGLMovieTexture cant play two videos in a row
body: <p>I'm trying to play videos in Unity WebGL in the browser, but having lots of problems.</p>
  
  <p>I tried two different video players and none of them work fully.</p>
  
  <p>The WebGLMovieTexture player works like this</p>
  
  <pre><code>public WebGLStreamingVideoPlugin _videoPlugin = new WebGLStreamingVideoPlugin("http://www.example.net/video.mp4");
  _videoPlugin.Play();
  </code></pre>
  
  <p>Basically when you want to play a video you create a new instance and give it the URL like above, and it plays great!!</p>
  
  <p>The problem is when you want to stop that video, and play a different video, it seems impossible because there is no way dispose of the first video because there is only a Stop() in the API, which stops the playback but it continues to stream the video data from the internet in the background. </p>
  
  <p>There is no way to delete the instance because Destroy() cant be called since that WebGLMovieTexture is not derived from monodevelop, and C# does not seem to give a way to delete an object (how silly). Even setting it to null doesnt do it, it continues to stream the video in the background.</p>
  
  <p>So if you create a new instance in order to play a different video, you end up with TWO video streams, and if you do it again to play a third, you end up with THREE, and so on, so quickly you can see how bad that will end up.</p>
  
  <p>My question is how to dispose of or destroy the first WebGLMovieTexture player, or maybe tell it to stop streaming the first video and start playing a different one?</p>
  
  <p>The second player I tried is the VideoPlayer for WebGL in Unity Version 5.6.0b4, with this one I can only get it to play a video if I hardcode the URL in the inspector, if I put the URL in code it doesn't play it in the browser.</p>
  
  <pre><code>    vPlayer = gameObject.GetComponent&lt;UnityEngine.Video.VideoPlayer&gt;();
      if (vPlayer.isPlaying) {
          Debug.Log("STOPPING PLAY");
          vPlayer.Stop();
      }
      vPlayer.url = url;
      vPlayer.isLooping = true;
      vPlayer.frame = 0;
      vPlayer.targetCameraAlpha = 1F;
      vPlayer.Prepare();
      vPlayer.Play();
  </code></pre>
  
  <p>And to get it to play a second video I suspect I will have the same problems as the other one.</p>
  
  <p>Anybody have any ideas that can help me?</p>