Embed: edits to videojs main player to correctly handle ending live streams

This commit is contained in:
Cat 2019-04-25 13:52:37 +02:00
parent 017e28932a
commit 80a3618bc4
4 changed files with 20 additions and 31 deletions

View file

@ -52262,13 +52262,18 @@
if (!playlist || !mediaSource) {
return false;
}
var segments = playlist.segments; // determine a few boolean values to help make the branch below easier
// to read
var appendedLastSegment = segmentIndex === segments.length; // if we've buffered to the end of the video, we need to call endOfStream
// so that MediaSources can trigger the `ended` event when it runs out of
// buffered data instead of waiting for me
if (segments.length || (segmentIndex !== null)) {
var appendedLastSegment = segmentIndex === segments.length; // if we've buffered to the end of the video, we need to call endOfStream
// so that MediaSources can trigger the `ended` event when it runs out of
// buffered data instead of waiting for me
}
else {
appendedLastSegment = true;
}
return playlist.endList && mediaSource.readyState === 'open' && appendedLastSegment;
};
@ -52920,12 +52925,12 @@
var segmentInfo = this.checkBuffer_(this.buffered_(), this.playlist_, this.mediaIndex, this.hasPlayed_(), this.currentTime_(), this.syncPoint_);
if (!segmentInfo) {
if (this.isEndOfStream_(segmentInfo ? segmentInfo.mediaIndex : null)) {
this.endOfStream();
return;
}
if (this.isEndOfStream_(segmentInfo.mediaIndex)) {
this.endOfStream();
if (!segmentInfo) {
return;
}
@ -58923,4 +58928,4 @@
}));
!function(){!function(a){var b=a&&a.videojs;b&&(b.CDN_VERSION="7.5.4")}(window)}();
!function(){!function(a){var b=a&&a.videojs;b&&(b.CDN_VERSION="7.5.4")}(window)}();

File diff suppressed because one or more lines are too long