Skip to content

Commit

Permalink
demo page: remove fake video ended event, as "ended" event is now tri…
Browse files Browse the repository at this point in the history
…ggered as expected
  • Loading branch information
mangui committed Jul 29, 2015
1 parent 3eaefdd commit ad2dd87
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@ <h4> Stats Display </h4>
}

var bufferingIdx = -1;
var playbackEnded = false;

function checkBuffer() {
var v = $('#video')[0];
Expand Down Expand Up @@ -489,10 +488,6 @@ <h4> Stats Display </h4>
if(bufferLen <= 0.1 && v.paused === false && (pos-lastStartPosition) > 0.5) {
// don't create buffering event if we are at the end of the playlist, don't report ended for live playlist
if(lastDuration -pos <= 0.5 && events.isLive === false) {
if(playbackEnded === false) {
events.video.push({ type : 'ended' , time : Date.now() - events.t0 });
playbackEnded = true;
}
} else {
// we are not at the end of the playlist ... real buffering
if(bufferingIdx !== -1) {
Expand All @@ -504,10 +499,7 @@ <h4> Stats Display </h4>
// we are in buffering state
bufferingIdx = events.video.length-1;
}
playbackEnded = false;
}
} else {
playbackEnded = false;
}

if(bufferLen > 0.1 && bufferingIdx !=-1) {
Expand Down

0 comments on commit ad2dd87

Please sign in to comment.