Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

waiting event is being fired after ended #38

Closed
heff opened this issue Sep 5, 2013 · 3 comments · Fixed by #57
Closed

waiting event is being fired after ended #38

heff opened this issue Sep 5, 2013 · 3 comments · Fixed by #57
Labels

Comments

@heff
Copy link
Member

heff commented Sep 5, 2013

This is a hot issue if anyone's able to give some quick feedback.

Example: http://jsfiddle.net/heff/N8Zs5/
(The spinner will show after the video has ended)

Reported in videojs/video.js#708

My best guess is the cause is the NetStream.Buffer.Empty event handler.

It would make sense that this would fire after the video ends and the buffer is empty, but we shouldn't be firing the waiting event if we're not actually waiting for more data. I don't understand the netstream operation enough to dig much deeper and understand the best way to fix this.

This is a relatively new issue, though it could be caused by the fact that the player no longer manually seeks back to zero when the video ends.

A quick work around in JS layer would be to check the 'ended' property and block waiting events that happen while ended, except that the ended property in HTTPVideoProvider is set to always return false. I'm interested to know if there's a reason for that, because the other providers (Audio/RTMP) will return true when ended.
https://github.com/videojs/video-js-swf/blob/master/src/com/videojs/providers/HTTPVideoProvider.as#L180

@alemay
Copy link
Contributor

alemay commented Sep 5, 2013

The HTTPVideoProvider returning false for ended should definitely be adjusted - that may have been something left over from some initial testing at some point along the way?

My guess is that NetStream.Play.Stop is firing before NetStream.Buffer.Empty - we could probably check for _isPlaying in this handler:

https://github.com/videojs/video-js-swf/blob/master/src/com/videojs/providers/HTTPVideoProvider.as#L464-L467

And return; if false:

case "NetStream.Buffer.Empty":
    if(!_isPlaying){ return; }
    _isBuffering = true;
    _model.broadcastEventExternally(ExternalEventName.ON_BUFFER_EMPTY);
break;

@heff
Copy link
Member Author

heff commented Sep 5, 2013

Ok cool, that sounds like a good place to start.

On Sep 5, 2013, at 12:14 PM, Andy notifications@github.com wrote:

The HTTPVideoProvider returning false for ended should definitely be adjusted - that may have been something left over from some initial testing at some point along the way?

My guess is that NetStream.Play.Stop is firing before NetStream.Buffer.Empty - we could probably check for _isPlaying in this handler:

https://github.com/videojs/video-js-swf/blob/master/src/com/videojs/providers/HTTPVideoProvider.as#L464-L467

And return; if false:

case "NetStream.Buffer.Empty":
if(!_isPlaying){ return; }
_isBuffering = true;
_model.broadcastEventExternally(ExternalEventName.ON_BUFFER_EMPTY);
break;

Reply to this email directly or view it on GitHub.

@ridmahajan
Copy link

Hi @heff , I am facing this problem too, do we have a rough idea by when can this be fixed?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants