I am hitting a Bug, and I am trying to find a solution or a workaround. I am making a 360 video app in iOS. When users minimize the app and come back, the app crashes because the video player crashes do to the fact that iOS flushes the app memory and now unity cant access the video buffer. I have tried working around this by saving the video time, and stopping the video when the app is minimized and then playing and setting the video player time when the app is resumed. Unfortunately this also does not work as VideoPlayer.time usually fails. Is there a recommended way to resume a video? Notes: I have tried using prepare which hasn't worked. I have tried playing the video for a few seconds first which works sometimes but still fails often. It also seems like the larger the value of time, ie the further into the video Unity has to seek, the grater chance it will fail to so so. I am using Unity 2022.2.21
Hey, we would appreciate it if you could report the bugs. As for a workaround, making a seek before calling Play should do the trick. The order is important right now. It shouldn't and we are trying to improve it. Please let me know if it fixes your issue. Code (CSharp): VideoPlayer.clip = myclip; VideoPlayer.time = whatever; VideoPlayer.Play()
The result of doing it this way is that setting the time is always ignored. The video plays from the beginning. VideoPlayer.time = mySavedTime; //has no effect VideoPlayer.Play(); print(VideoPlayer.time); //prints 0