Add a 'bandwidthupdate' event
Showing
1 changed file
with
4 additions
and
0 deletions
... | @@ -155,6 +155,8 @@ videojs.Hls.prototype.handleSourceOpen = function() { | ... | @@ -155,6 +155,8 @@ videojs.Hls.prototype.handleSourceOpen = function() { |
155 | } else { | 155 | } else { |
156 | setupEvents.call(this); | 156 | setupEvents.call(this); |
157 | } | 157 | } |
158 | |||
159 | this.trigger('bandwidthupdate'); | ||
158 | })); | 160 | })); |
159 | 161 | ||
160 | this.playlists.on('error', videojs.bind(this, function() { | 162 | this.playlists.on('error', videojs.bind(this, function() { |
... | @@ -464,6 +466,8 @@ videojs.Hls.prototype.setBandwidth = function(xhr) { | ... | @@ -464,6 +466,8 @@ videojs.Hls.prototype.setBandwidth = function(xhr) { |
464 | tech.segmentXhrTime = xhr.roundTripTime; | 466 | tech.segmentXhrTime = xhr.roundTripTime; |
465 | tech.bandwidth = xhr.bandwidth; | 467 | tech.bandwidth = xhr.bandwidth; |
466 | tech.bytesReceived += xhr.bytesReceived || 0; | 468 | tech.bytesReceived += xhr.bytesReceived || 0; |
469 | |||
470 | tech.trigger('bandwidthupdate'); | ||
467 | }; | 471 | }; |
468 | 472 | ||
469 | videojs.Hls.prototype.loadSegment = function(segmentUri, offset) { | 473 | videojs.Hls.prototype.loadSegment = function(segmentUri, offset) { | ... | ... |
-
Please register or sign in to post a comment