New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use `emptied` event to reset player states #1277

Open
heff opened this Issue Jun 10, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@heff
Member

heff commented Jun 10, 2014

In videojs/video.js#1124 we added a feature to let the player reset its 'has-started' state when a new source is loaded. It used the loadstart event to do this.

In #1271 we found that the play and loadstart events could fire in any order, so we made a fix so that the the firstplay event would be fired even if the play event came before the loadstart.

In videojs/video.js#1271 we also realized that emptied is the event we should be relying on to reset the player states. It always comes before the play event, so it can greatly simply the code we currently have for the firstplay event.

However, the Flash SWF doesn't fire the emptied event, so before we can use it we have to first implement it in Flash. Adding a related issue on the swf repo. videojs/video-js-swf#100

@gkatsev

This comment has been minimized.

Show comment
Hide comment
@gkatsev

gkatsev Aug 9, 2016

Member

Just ran into this. With autoplay and ads on safari, we end up getting the play event before loadstart but ads even up pausing the player before loadstart fires so we think we switched videos and we reset the started state but we shouldn't have because we didn't actually change videos.

Member

gkatsev commented Aug 9, 2016

Just ran into this. With autoplay and ads on safari, we end up getting the play event before loadstart but ads even up pausing the player before loadstart fires so we think we switched videos and we reset the started state but we shouldn't have because we didn't actually change videos.

@gkatsev gkatsev added the pinned label Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment