Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Help Wanted How to unload video with URL?

Discussion in 'Audio & Video' started by inkletom, Jul 28, 2020.

  1. inkletom

    inkletom

    Joined:
    Oct 13, 2016
    Posts:
    29
    Hey! I've noticed that setting "videoPlayer.url" to null causes an error - it seems that it tries to load it as a URL.
    I'm looking to unload the playing video and reset the state of the player for another video.

    What is the correct way to reset a VideoPlayer?

    Ta!
    Tom
     
  2. DominiqueLrx

    DominiqueLrx

    Unity Technologies

    Joined:
    Dec 14, 2016
    Posts:
    214
    Hi Tom!

    Indeed, the VideoPlayer is pesky in that it doesn't allow you to clear the url once it has been set. But just calling Stop() will clear any resource that has been allocated.

    Hope this helps,

    Dominique Leroux
    A/V developer at Unity
     
unityunity