- Home /
Question by
ocramot · Jul 20, 2018 at 03:35 PM ·
videovideo streamingbuffer
VideoPlayer streaming and buffering
Hello, I'm trying to use the VideoPlayer to show a video with an URL source.
The WiFi connection here isn't great, so it happens from time to time that the video is slow to load, and it takes some time to start playing (or it stops midway).
Is there some way to detect when the videoplayer is buffering and when the video restarts playing? I would use some callbacks to toggle some "loading" text, or a rotating spinner.
I am trying to use these delegates from VideoPlayer, but I'm not sure if they're right for my case:
videoPlayer = GetComponent<VideoPlayer>();
//Setup Delegates
videoPlayer.errorReceived += HandleVideoError;
videoPlayer.started += HandleStartedEvent;
videoPlayer.prepareCompleted += HandlePrepareCompleted;
videoPlayer.seekCompleted += HandleSeekCompleted;
videoPlayer.loopPointReached += HandleLoopPointReached;
videoPlayer.frameReady += HandleFrameReady;
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612171141im_/https://answers.unity.com/themes/thub/images/avi.jpg)