hls.js 1.6.0-beta.2.0.canary.10894 → 1.6.0-beta.2.0.canary.10895
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hls.js +55 -49
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +2 -2
- package/dist/hls.light.min.js +1 -1
- package/dist/hls.light.mjs +2 -2
- package/dist/hls.min.js +1 -1
- package/dist/hls.min.js.map +1 -1
- package/dist/hls.mjs +55 -52
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/package.json +1 -1
- package/src/controller/audio-stream-controller.ts +27 -31
package/dist/hls.js
CHANGED
@@ -1059,7 +1059,7 @@
|
|
1059
1059
|
// Some browsers don't allow to use bind on console object anyway
|
1060
1060
|
// fallback to default if needed
|
1061
1061
|
try {
|
1062
|
-
newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.2.0.canary.
|
1062
|
+
newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.2.0.canary.10895");
|
1063
1063
|
} catch (e) {
|
1064
1064
|
/* log fn threw an exception. All logger methods are no-ops. */
|
1065
1065
|
return createLogger();
|
@@ -16308,7 +16308,7 @@
|
|
16308
16308
|
return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
|
16309
16309
|
}
|
16310
16310
|
|
16311
|
-
var version = "1.6.0-beta.2.0.canary.
|
16311
|
+
var version = "1.6.0-beta.2.0.canary.10895";
|
16312
16312
|
|
16313
16313
|
// ensure the worker ends up in the bundle
|
16314
16314
|
// If the worker should not be included this gets aliased to empty.js
|
@@ -16679,32 +16679,6 @@
|
|
16679
16679
|
return TransmuxerInterface;
|
16680
16680
|
}();
|
16681
16681
|
|
16682
|
-
function subtitleOptionsIdentical(trackList1, trackList2) {
|
16683
|
-
if (trackList1.length !== trackList2.length) {
|
16684
|
-
return false;
|
16685
|
-
}
|
16686
|
-
for (var i = 0; i < trackList1.length; i++) {
|
16687
|
-
if (!mediaAttributesIdentical(trackList1[i].attrs, trackList2[i].attrs)) {
|
16688
|
-
return false;
|
16689
|
-
}
|
16690
|
-
}
|
16691
|
-
return true;
|
16692
|
-
}
|
16693
|
-
function mediaAttributesIdentical(attrs1, attrs2, customAttributes) {
|
16694
|
-
// Media options with the same rendition ID must be bit identical
|
16695
|
-
var stableRenditionId = attrs1['STABLE-RENDITION-ID'];
|
16696
|
-
if (stableRenditionId && !customAttributes) {
|
16697
|
-
return stableRenditionId === attrs2['STABLE-RENDITION-ID'];
|
16698
|
-
}
|
16699
|
-
// When rendition ID is not present, compare attributes
|
16700
|
-
return !(customAttributes || ['LANGUAGE', 'NAME', 'CHARACTERISTICS', 'AUTOSELECT', 'DEFAULT', 'FORCED', 'ASSOC-LANGUAGE']).some(function (subtitleAttribute) {
|
16701
|
-
return attrs1[subtitleAttribute] !== attrs2[subtitleAttribute];
|
16702
|
-
});
|
16703
|
-
}
|
16704
|
-
function subtitleTrackMatchesTextTrack(subtitleTrack, textTrack) {
|
16705
|
-
return textTrack.label.toLowerCase() === subtitleTrack.name.toLowerCase() && (!textTrack.language || textTrack.language.toLowerCase() === (subtitleTrack.lang || '').toLowerCase());
|
16706
|
-
}
|
16707
|
-
|
16708
16682
|
var TICK_INTERVAL$2 = 100; // how often to tick in ms
|
16709
16683
|
var AudioStreamController = /*#__PURE__*/function (_BaseStreamController) {
|
16710
16684
|
function AudioStreamController(hls, fragmentTracker, keyLoader) {
|
@@ -16957,9 +16931,7 @@
|
|
16957
16931
|
if (bufferInfo === null) {
|
16958
16932
|
return;
|
16959
16933
|
}
|
16960
|
-
|
16961
|
-
switchingTrack = this.switchingTrack;
|
16962
|
-
if (!switchingTrack && this._streamEnded(bufferInfo, trackDetails)) {
|
16934
|
+
if (!this.switchingTrack && this._streamEnded(bufferInfo, trackDetails)) {
|
16963
16935
|
hls.trigger(Events.BUFFER_EOS, {
|
16964
16936
|
type: 'audio'
|
16965
16937
|
});
|
@@ -16972,12 +16944,8 @@
|
|
16972
16944
|
var start = fragments[0].start;
|
16973
16945
|
var loadPosition = this.getLoadPosition();
|
16974
16946
|
var targetBufferTime = this.flushing ? loadPosition : bufferInfo.end;
|
16975
|
-
if (switchingTrack && media) {
|
16947
|
+
if (this.switchingTrack && media) {
|
16976
16948
|
var pos = loadPosition;
|
16977
|
-
// STABLE
|
16978
|
-
if (bufferedTrack && !mediaAttributesIdentical(switchingTrack.attrs, bufferedTrack.attrs)) {
|
16979
|
-
targetBufferTime = pos;
|
16980
|
-
}
|
16981
16949
|
// if currentTime (pos) is less than alt audio playlist start time, it means that alt audio is ahead of currentTime
|
16982
16950
|
if (trackDetails.PTSKnown && pos < start) {
|
16983
16951
|
// if everything is buffered from pos to start or if audio buffer upfront, let's seek to start
|
@@ -16989,7 +16957,7 @@
|
|
16989
16957
|
}
|
16990
16958
|
|
16991
16959
|
// if buffer length is less than maxBufLen, or near the end, find a fragment to load
|
16992
|
-
if (bufferLen >= maxBufLen && !switchingTrack && targetBufferTime < fragments[fragments.length - 1].start) {
|
16960
|
+
if (bufferLen >= maxBufLen && !this.switchingTrack && targetBufferTime < fragments[fragments.length - 1].start) {
|
16993
16961
|
return;
|
16994
16962
|
}
|
16995
16963
|
var frag = this.getNextFragment(targetBufferTime, trackDetails);
|
@@ -17457,18 +17425,30 @@
|
|
17457
17425
|
}
|
17458
17426
|
};
|
17459
17427
|
_proto.flushAudioIfNeeded = function flushAudioIfNeeded(switchingTrack) {
|
17460
|
-
|
17461
|
-
bufferedTrack = this.bufferedTrack
|
17462
|
-
|
17463
|
-
|
17464
|
-
|
17465
|
-
|
17466
|
-
|
17467
|
-
|
17468
|
-
|
17469
|
-
|
17470
|
-
|
17471
|
-
|
17428
|
+
if (this.media && this.bufferedTrack) {
|
17429
|
+
var _this$bufferedTrack = this.bufferedTrack,
|
17430
|
+
name = _this$bufferedTrack.name,
|
17431
|
+
lang = _this$bufferedTrack.lang,
|
17432
|
+
assocLang = _this$bufferedTrack.assocLang,
|
17433
|
+
characteristics = _this$bufferedTrack.characteristics,
|
17434
|
+
audioCodec = _this$bufferedTrack.audioCodec,
|
17435
|
+
channels = _this$bufferedTrack.channels;
|
17436
|
+
if (!matchesOption({
|
17437
|
+
name: name,
|
17438
|
+
lang: lang,
|
17439
|
+
assocLang: assocLang,
|
17440
|
+
characteristics: characteristics,
|
17441
|
+
audioCodec: audioCodec,
|
17442
|
+
channels: channels
|
17443
|
+
}, switchingTrack, audioMatchPredicate)) {
|
17444
|
+
if (useAlternateAudio(switchingTrack.url, this.hls)) {
|
17445
|
+
this.log('Switching audio track : flushing all audio');
|
17446
|
+
_BaseStreamController.prototype.flushMainBuffer.call(this, 0, Number.POSITIVE_INFINITY, 'audio');
|
17447
|
+
this.bufferedTrack = null;
|
17448
|
+
} else {
|
17449
|
+
// Main is being buffered. Set bufferedTrack so that it is flushed when switching back to alt-audio
|
17450
|
+
this.bufferedTrack = switchingTrack;
|
17451
|
+
}
|
17472
17452
|
}
|
17473
17453
|
}
|
17474
17454
|
};
|
@@ -17748,6 +17728,32 @@
|
|
17748
17728
|
return BasePlaylistController;
|
17749
17729
|
}(Logger);
|
17750
17730
|
|
17731
|
+
function subtitleOptionsIdentical(trackList1, trackList2) {
|
17732
|
+
if (trackList1.length !== trackList2.length) {
|
17733
|
+
return false;
|
17734
|
+
}
|
17735
|
+
for (var i = 0; i < trackList1.length; i++) {
|
17736
|
+
if (!mediaAttributesIdentical(trackList1[i].attrs, trackList2[i].attrs)) {
|
17737
|
+
return false;
|
17738
|
+
}
|
17739
|
+
}
|
17740
|
+
return true;
|
17741
|
+
}
|
17742
|
+
function mediaAttributesIdentical(attrs1, attrs2, customAttributes) {
|
17743
|
+
// Media options with the same rendition ID must be bit identical
|
17744
|
+
var stableRenditionId = attrs1['STABLE-RENDITION-ID'];
|
17745
|
+
if (stableRenditionId && !customAttributes) {
|
17746
|
+
return stableRenditionId === attrs2['STABLE-RENDITION-ID'];
|
17747
|
+
}
|
17748
|
+
// When rendition ID is not present, compare attributes
|
17749
|
+
return !(customAttributes || ['LANGUAGE', 'NAME', 'CHARACTERISTICS', 'AUTOSELECT', 'DEFAULT', 'FORCED', 'ASSOC-LANGUAGE']).some(function (subtitleAttribute) {
|
17750
|
+
return attrs1[subtitleAttribute] !== attrs2[subtitleAttribute];
|
17751
|
+
});
|
17752
|
+
}
|
17753
|
+
function subtitleTrackMatchesTextTrack(subtitleTrack, textTrack) {
|
17754
|
+
return textTrack.label.toLowerCase() === subtitleTrack.name.toLowerCase() && (!textTrack.language || textTrack.language.toLowerCase() === (subtitleTrack.lang || '').toLowerCase());
|
17755
|
+
}
|
17756
|
+
|
17751
17757
|
var AudioTrackController = /*#__PURE__*/function (_BasePlaylistControll) {
|
17752
17758
|
function AudioTrackController(hls) {
|
17753
17759
|
var _this;
|