Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
main, playback_info: avoid excessive stats:add event triggering
Browse files Browse the repository at this point in the history
  • Loading branch information
flavioribeiro committed Oct 20, 2014
1 parent 9d6a85b commit d772f14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ class P2PHLS extends HLS {

requestResource(url) {
this.currentUrl = url
this.playbackInfo.updateData({
'segmentSize': this.getAverageSegmentSize(),
'levels': this.getLevels(),
})
this.resourceRequester.requestResource(url, this.bufferLength, (chunk, method) => this.resourceLoaded(chunk, method))
}

Expand Down
8 changes: 7 additions & 1 deletion src/playback_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ class PlaybackInfo extends BaseObject {
var bufferLength = this.main.el.globoGetbufferLength()
bitrate = !_.isNaN(bitrate) ? bitrate : 'UNKNOWN'
bufferLength = !_.isNaN(bufferLength) ? bufferLength: 0
var data = {state: this.main.currentState, currentBitrate: bitrate, bufferLength: bufferLength.toFixed(2)}
var data = {
state: this.main.currentState,
currentBitrate: bitrate,
bufferLength: bufferLength.toFixed(2),
segmentSize: this.main.getAverageSegmentSize(),
levels: this.main.getLevels()
}
this.updateData(data)
}

Expand Down

0 comments on commit d772f14

Please sign in to comment.