Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Video Close Video Player and free memory

Discussion in 'Audio & Video' started by danielesuppo, Aug 30, 2017.

  1. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Hello all,
    does someone know how to close video player (Something like VideoPlayer.Close() or VideoPlayer.Dispose() that do not exist) to free up memory and be ready for a new video?
    Thanks!
    Daniele
     
    Last edited: Aug 30, 2017
  2. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Stop 'unprepairs' the video and frees everything up (Unlike Pause, which keeps everything around for quick resume)
     
  3. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Thank-you Prodigga for your reply,
    but as I can read on the manual "VideoPlayer.Stop - Pauses the playback and sets the current time to 0".
    It does not talk about unpreparing and other stuffs..
    It seem just the .Pause but with rewind of the movie.
    Maybe I've missed some forum thread? :)
     
  4. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Yes, I read it on the forum sorry for the confusion.

    The docs are not very technical. They don't explain what and how it really works.. as with most Unity features you just have to do lots of experimenting and lots of reading to learn how something really works..!

    I can't find the thread where the developer explains the difference between stop and pause, sorry. I was looking in to why videos were stuttering on Android when I ran across the developer post.