Video Player on WebGL stops working after calling the Stop() function
In the game I'm working on, the Video Player is used in WebGL. When the player hovers the mouse over an object a video plays.
The video should stop playing when the mouse moves and resume when the mouse returns by using the Stop() and Play() functions respectively. Also, the URL changes depending on the player's action.
Everything works as expected in the Unity editor but when the Stop() function is called in the WebGL build the video stops playing and I get an error saying:
The play() request was interrupted by a call to pause()
Before you ask, the VideoPlayer source is already set to URL, not Video Clip.
Does WebGL have a problem with the Stop() function?
Thanks in Advance :)
Answer by clarHandsome · Aug 14, 2018 at 04:44 PM
Same here. Just don't use Stop().
Instead:
videoPlayer.frame = 0; videoPlayer.Play();