video.js icon indicating copy to clipboard operation
video.js copied to clipboard

event: onBuffering?

Open zakdances opened this issue 14 years ago • 10 comments

I've read the VideoJS api (http://videojs.com/docs/api/) and I can't figure out how I can get the player to fire an event when it starts buffering. I want to know when the player pauses to buffer ( at any point in playback ) so that I can sync another video on my webpage. How can I get the player to listen for this event?

zakdances avatar Jun 18 '12 04:06 zakdances

As far as knowing when the player stops to buffer during playback, unfortunately there's no direct API to this yet in HTML5. Otherwise you can use the 'progress' event to know when the browser is downloading any data, whether it's playing or not.

On Jun 17, 2012, at 9:18 PM, zakdances wrote:

I've read the VideoJS api (http://videojs.com/docs/api/) and I can't figure out how I can get the player to fire an event when it starts buffering. I want to know when the player pauses to buffer ( at any point in playback ) so that I can sync another video on my webpage. How can I get the player to listen for this event?


Reply to this email directly or view it on GitHub: https://github.com/zencoder/video-js/issues/198

heff avatar Jun 18 '12 17:06 heff

Can this be enabled for the flash player? Does the pause event fire when the video pauses to buffer?

zakdances avatar Jun 18 '12 17:06 zakdances

No, I don't believe so. If it did the play button icon would show the triangle, not he double bars.

I believe you can build more QOS metrics into the flash player but there isn't any right now. Sorry.

On Jun 18, 2012, at 10:31 AM, zakdances wrote:

Can this be enabled for the flash player? Does the pause event fire when the video pauses to buffer?


Reply to this email directly or view it on GitHub: https://github.com/zencoder/video-js/issues/198#issuecomment-6403083

heff avatar Jun 18 '12 17:06 heff

Buffering is a pretty important event in the life of the video player. How can I submit a feature request to, at the very least, expand the "paused" event to include pause on buffering? The player does detect it, otherwise how does it know when to show the spinner?

zakdances avatar Jun 18 '12 17:06 zakdances

Ah, I see what you mean. I think you're looking for the 'waiting' event then. Try this.

player.on("waiting", function(){ ... });

On Jun 18, 2012, at 10:47 AM, zakdances wrote:

Buffering is a pretty important event in the life of the video player. How can I submit a feature request to, at the very least, expand the "paused" event to include pause on buffering? The player does detect it, otherwise how does it know when to show the spinner?


Reply to this email directly or view it on GitHub: https://github.com/zencoder/video-js/issues/198#issuecomment-6403572

heff avatar Jun 18 '12 17:06 heff

Has there been any progress on this issue? Has anyone come up with a solid method for detecting buffering?

MrWiLofDoom avatar Jun 26 '18 17:06 MrWiLofDoom

Also interested in this...

otoinsa avatar Apr 28 '20 18:04 otoinsa

Me too

rxluz avatar Nov 19 '20 08:11 rxluz

me too

manojkumarboppisetti avatar May 19 '21 09:05 manojkumarboppisetti

This is a really old issue. You likely want to listen to the progress event to know when content is being loaded. Depending on your needs you also want to keep track on the player.buffered() property and see that the player.buffered().end(0) is increasing as you expect. If you're having a separate problem, please open a new issue with a detailed description of it, ideally with a live minimal example.

gkatsev avatar May 19 '21 23:05 gkatsev