hls.js 1.6.0-beta.2.0.canary.10894 → 1.6.0-beta.2.0.canary.10896
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 +56 -51
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +2 -2
- package/dist/hls.light.js.map +1 -1
- package/dist/hls.light.min.js +1 -1
- package/dist/hls.light.min.js.map +1 -1
- package/dist/hls.light.mjs +2 -2
- package/dist/hls.light.mjs.map +1 -1
- package/dist/hls.min.js +1 -1
- package/dist/hls.min.js.map +1 -1
- package/dist/hls.mjs +56 -54
- 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/src/utils/rendition-helper.ts +6 -10
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.10896");
|
1063
1063
|
} catch (e) {
|
1064
1064
|
/* log fn threw an exception. All logger methods are no-ops. */
|
1065
1065
|
return createLogger();
|
@@ -1967,10 +1967,9 @@
|
|
1967
1967
|
name = option.name,
|
1968
1968
|
lang = option.lang,
|
1969
1969
|
assocLang = option.assocLang,
|
1970
|
-
characteristics = option.characteristics,
|
1971
1970
|
isDefault = option.default;
|
1972
1971
|
var forced = option.forced;
|
1973
|
-
return (groupId === undefined || track.groupId === groupId) && (name === undefined || track.name === name) && (lang === undefined || languagesMatch(lang, track.lang)) && (lang === undefined || track.assocLang === assocLang) && (isDefault === undefined || track.default === isDefault) && (forced === undefined || track.forced === forced) && (characteristics
|
1972
|
+
return (groupId === undefined || track.groupId === groupId) && (name === undefined || track.name === name) && (lang === undefined || languagesMatch(lang, track.lang)) && (lang === undefined || track.assocLang === assocLang) && (isDefault === undefined || track.default === isDefault) && (forced === undefined || track.forced === forced) && (!('characteristics' in option) || characteristicsMatch(option.characteristics || '', track.characteristics)) && (matchPredicate === undefined || matchPredicate(option, track));
|
1974
1973
|
}
|
1975
1974
|
function languagesMatch(languageA, languageB) {
|
1976
1975
|
if (languageB === undefined) {
|
@@ -16308,7 +16307,7 @@
|
|
16308
16307
|
return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
|
16309
16308
|
}
|
16310
16309
|
|
16311
|
-
var version = "1.6.0-beta.2.0.canary.
|
16310
|
+
var version = "1.6.0-beta.2.0.canary.10896";
|
16312
16311
|
|
16313
16312
|
// ensure the worker ends up in the bundle
|
16314
16313
|
// If the worker should not be included this gets aliased to empty.js
|
@@ -16679,32 +16678,6 @@
|
|
16679
16678
|
return TransmuxerInterface;
|
16680
16679
|
}();
|
16681
16680
|
|
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
16681
|
var TICK_INTERVAL$2 = 100; // how often to tick in ms
|
16709
16682
|
var AudioStreamController = /*#__PURE__*/function (_BaseStreamController) {
|
16710
16683
|
function AudioStreamController(hls, fragmentTracker, keyLoader) {
|
@@ -16957,9 +16930,7 @@
|
|
16957
16930
|
if (bufferInfo === null) {
|
16958
16931
|
return;
|
16959
16932
|
}
|
16960
|
-
|
16961
|
-
switchingTrack = this.switchingTrack;
|
16962
|
-
if (!switchingTrack && this._streamEnded(bufferInfo, trackDetails)) {
|
16933
|
+
if (!this.switchingTrack && this._streamEnded(bufferInfo, trackDetails)) {
|
16963
16934
|
hls.trigger(Events.BUFFER_EOS, {
|
16964
16935
|
type: 'audio'
|
16965
16936
|
});
|
@@ -16972,12 +16943,8 @@
|
|
16972
16943
|
var start = fragments[0].start;
|
16973
16944
|
var loadPosition = this.getLoadPosition();
|
16974
16945
|
var targetBufferTime = this.flushing ? loadPosition : bufferInfo.end;
|
16975
|
-
if (switchingTrack && media) {
|
16946
|
+
if (this.switchingTrack && media) {
|
16976
16947
|
var pos = loadPosition;
|
16977
|
-
// STABLE
|
16978
|
-
if (bufferedTrack && !mediaAttributesIdentical(switchingTrack.attrs, bufferedTrack.attrs)) {
|
16979
|
-
targetBufferTime = pos;
|
16980
|
-
}
|
16981
16948
|
// if currentTime (pos) is less than alt audio playlist start time, it means that alt audio is ahead of currentTime
|
16982
16949
|
if (trackDetails.PTSKnown && pos < start) {
|
16983
16950
|
// if everything is buffered from pos to start or if audio buffer upfront, let's seek to start
|
@@ -16989,7 +16956,7 @@
|
|
16989
16956
|
}
|
16990
16957
|
|
16991
16958
|
// 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) {
|
16959
|
+
if (bufferLen >= maxBufLen && !this.switchingTrack && targetBufferTime < fragments[fragments.length - 1].start) {
|
16993
16960
|
return;
|
16994
16961
|
}
|
16995
16962
|
var frag = this.getNextFragment(targetBufferTime, trackDetails);
|
@@ -17457,18 +17424,30 @@
|
|
17457
17424
|
}
|
17458
17425
|
};
|
17459
17426
|
_proto.flushAudioIfNeeded = function flushAudioIfNeeded(switchingTrack) {
|
17460
|
-
|
17461
|
-
bufferedTrack = this.bufferedTrack
|
17462
|
-
|
17463
|
-
|
17464
|
-
|
17465
|
-
|
17466
|
-
|
17467
|
-
|
17468
|
-
|
17469
|
-
|
17470
|
-
|
17471
|
-
|
17427
|
+
if (this.media && this.bufferedTrack) {
|
17428
|
+
var _this$bufferedTrack = this.bufferedTrack,
|
17429
|
+
name = _this$bufferedTrack.name,
|
17430
|
+
lang = _this$bufferedTrack.lang,
|
17431
|
+
assocLang = _this$bufferedTrack.assocLang,
|
17432
|
+
characteristics = _this$bufferedTrack.characteristics,
|
17433
|
+
audioCodec = _this$bufferedTrack.audioCodec,
|
17434
|
+
channels = _this$bufferedTrack.channels;
|
17435
|
+
if (!matchesOption({
|
17436
|
+
name: name,
|
17437
|
+
lang: lang,
|
17438
|
+
assocLang: assocLang,
|
17439
|
+
characteristics: characteristics,
|
17440
|
+
audioCodec: audioCodec,
|
17441
|
+
channels: channels
|
17442
|
+
}, switchingTrack, audioMatchPredicate)) {
|
17443
|
+
if (useAlternateAudio(switchingTrack.url, this.hls)) {
|
17444
|
+
this.log('Switching audio track : flushing all audio');
|
17445
|
+
_BaseStreamController.prototype.flushMainBuffer.call(this, 0, Number.POSITIVE_INFINITY, 'audio');
|
17446
|
+
this.bufferedTrack = null;
|
17447
|
+
} else {
|
17448
|
+
// Main is being buffered. Set bufferedTrack so that it is flushed when switching back to alt-audio
|
17449
|
+
this.bufferedTrack = switchingTrack;
|
17450
|
+
}
|
17472
17451
|
}
|
17473
17452
|
}
|
17474
17453
|
};
|
@@ -17748,6 +17727,32 @@
|
|
17748
17727
|
return BasePlaylistController;
|
17749
17728
|
}(Logger);
|
17750
17729
|
|
17730
|
+
function subtitleOptionsIdentical(trackList1, trackList2) {
|
17731
|
+
if (trackList1.length !== trackList2.length) {
|
17732
|
+
return false;
|
17733
|
+
}
|
17734
|
+
for (var i = 0; i < trackList1.length; i++) {
|
17735
|
+
if (!mediaAttributesIdentical(trackList1[i].attrs, trackList2[i].attrs)) {
|
17736
|
+
return false;
|
17737
|
+
}
|
17738
|
+
}
|
17739
|
+
return true;
|
17740
|
+
}
|
17741
|
+
function mediaAttributesIdentical(attrs1, attrs2, customAttributes) {
|
17742
|
+
// Media options with the same rendition ID must be bit identical
|
17743
|
+
var stableRenditionId = attrs1['STABLE-RENDITION-ID'];
|
17744
|
+
if (stableRenditionId && !customAttributes) {
|
17745
|
+
return stableRenditionId === attrs2['STABLE-RENDITION-ID'];
|
17746
|
+
}
|
17747
|
+
// When rendition ID is not present, compare attributes
|
17748
|
+
return !(customAttributes || ['LANGUAGE', 'NAME', 'CHARACTERISTICS', 'AUTOSELECT', 'DEFAULT', 'FORCED', 'ASSOC-LANGUAGE']).some(function (subtitleAttribute) {
|
17749
|
+
return attrs1[subtitleAttribute] !== attrs2[subtitleAttribute];
|
17750
|
+
});
|
17751
|
+
}
|
17752
|
+
function subtitleTrackMatchesTextTrack(subtitleTrack, textTrack) {
|
17753
|
+
return textTrack.label.toLowerCase() === subtitleTrack.name.toLowerCase() && (!textTrack.language || textTrack.language.toLowerCase() === (subtitleTrack.lang || '').toLowerCase());
|
17754
|
+
}
|
17755
|
+
|
17751
17756
|
var AudioTrackController = /*#__PURE__*/function (_BasePlaylistControll) {
|
17752
17757
|
function AudioTrackController(hls) {
|
17753
17758
|
var _this;
|