1
0
mirror of https://github.com/videojs/video.js.git synced 2025-07-03 00:57:02 +02:00

Fixed the loadstart event listener order so it's attached before the HTML5 tech triggers it. fixes #1208 fixes #1207 fixes #1193

This commit is contained in:
Steve Heffernan
2014-05-14 14:58:20 -07:00
parent 8dfe0a4d06
commit bad5130c8f
2 changed files with 18 additions and 11 deletions

View File

@ -32,8 +32,10 @@ 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) {
player.trigger('loadstart');
// wait for the player to be ready so the player listeners are attached
player.ready(function(){
player.trigger('loadstart');
});
// Otherwise set the source if one was provided.
} else if (source) {
this.el_.src = source.src;