1
0
mirror of https://github.com/videojs/video.js.git synced 2025-07-15 01:34:23 +02:00

Fixed an issue with the firstplay event not firing when autoplaying. closes #1271

This commit is contained in:
Steve Heffernan
2014-06-10 16:55:08 -07:00
parent 5edc3a5cbc
commit 71c0a72717
5 changed files with 81 additions and 38 deletions

View File

@ -32,10 +32,7 @@ vjs.Html5 = vjs.MediaTechController.extend({
// If the element source is already set, we may have missed the loadstart event, and want to trigger it.
// We don't want to set the source again and interrupt playback.
if (source && this.el_.currentSrc === source.src && this.el_.networkState > 0) {
// wait for the player to be ready so the player listeners are attached
player.ready(function(){
player.trigger('loadstart');
});
player.trigger('loadstart');
// Otherwise set the source if one was provided.
} else if (source) {
this.el_.src = source.src;