831c403d by Gary Katsevman

Move bandwidthupdate event up in loadedmetadata

1 parent fa661f2f
...@@ -126,6 +126,8 @@ videojs.Hls.prototype.handleSourceOpen = function() { ...@@ -126,6 +126,8 @@ videojs.Hls.prototype.handleSourceOpen = function() {
126 126
127 oldMediaPlaylist = this.playlists.media(); 127 oldMediaPlaylist = this.playlists.media();
128 this.bandwidth = this.playlists.bandwidth; 128 this.bandwidth = this.playlists.bandwidth;
129 this.trigger('bandwidthupdate');
130
129 selectedPlaylist = this.selectPlaylist(); 131 selectedPlaylist = this.selectPlaylist();
130 oldBitrate = oldMediaPlaylist.attributes && 132 oldBitrate = oldMediaPlaylist.attributes &&
131 oldMediaPlaylist.attributes.BANDWIDTH || 0; 133 oldMediaPlaylist.attributes.BANDWIDTH || 0;
...@@ -155,8 +157,6 @@ videojs.Hls.prototype.handleSourceOpen = function() { ...@@ -155,8 +157,6 @@ videojs.Hls.prototype.handleSourceOpen = function() {
155 } else { 157 } else {
156 setupEvents.call(this); 158 setupEvents.call(this);
157 } 159 }
158
159 this.trigger('bandwidthupdate');
160 })); 160 }));
161 161
162 this.playlists.on('error', videojs.bind(this, function() { 162 this.playlists.on('error', videojs.bind(this, function() {
......