hls.js 1.6.0-beta.1.0.canary.10809 → 1.6.0-beta.1.0.canary.10810
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 +16 -11
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +9 -6
- 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 +9 -6
- 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 +16 -11
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/package.json +1 -1
- package/src/controller/audio-track-controller.ts +4 -4
- package/src/controller/interstitials-controller.ts +4 -0
- package/src/controller/stream-controller.ts +4 -4
- package/src/utils/rendition-helper.ts +5 -0
package/dist/hls.light.mjs
CHANGED
@@ -400,7 +400,7 @@ function enableLogs(debugConfig, context, id) {
|
|
400
400
|
// Some browsers don't allow to use bind on console object anyway
|
401
401
|
// fallback to default if needed
|
402
402
|
try {
|
403
|
-
newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.1.0.canary.
|
403
|
+
newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.1.0.canary.10810"}`);
|
404
404
|
} catch (e) {
|
405
405
|
/* log fn threw an exception. All logger methods are no-ops. */
|
406
406
|
return createLogger();
|
@@ -1059,6 +1059,10 @@ function getCodecTiers(levels, audioTracksByGroup, minAutoLevel, maxAutoLevel) {
|
|
1059
1059
|
return tiers;
|
1060
1060
|
}, {});
|
1061
1061
|
}
|
1062
|
+
function useAlternateAudio(audioTrackUrl, hls) {
|
1063
|
+
var _hls$levels$hls$loadL;
|
1064
|
+
return !!audioTrackUrl && audioTrackUrl !== ((_hls$levels$hls$loadL = hls.levels[hls.loadLevel]) == null ? void 0 : _hls$levels$hls$loadL.uri);
|
1065
|
+
}
|
1062
1066
|
|
1063
1067
|
class AbrController extends Logger {
|
1064
1068
|
constructor(_hls) {
|
@@ -19138,7 +19142,7 @@ class GapController extends Logger {
|
|
19138
19142
|
}
|
19139
19143
|
}
|
19140
19144
|
|
19141
|
-
const version = "1.6.0-beta.1.0.canary.
|
19145
|
+
const version = "1.6.0-beta.1.0.canary.10810";
|
19142
19146
|
|
19143
19147
|
// ensure the worker ends up in the bundle
|
19144
19148
|
// If the worker should not be included this gets aliased to empty.js
|
@@ -20162,9 +20166,10 @@ class StreamController extends BaseStreamController {
|
|
20162
20166
|
transmuxer.push(payload, initSegmentData, audioCodec, videoCodec, frag, part, details.totalduration, accurateTimeOffset, chunkMeta, initPTS);
|
20163
20167
|
}
|
20164
20168
|
onAudioTrackSwitching(event, data) {
|
20169
|
+
const hls = this.hls;
|
20165
20170
|
// if any URL found on new audio track, it is an alternate audio track
|
20166
20171
|
const fromAltAudio = this.altAudio === 2;
|
20167
|
-
const altAudio =
|
20172
|
+
const altAudio = useAlternateAudio(data.url, hls);
|
20168
20173
|
// if we switch on main audio, ensure that main fragment scheduling is synced with media.buffered
|
20169
20174
|
// don't do anything if we switch to alt audio: audio stream controller is handling it.
|
20170
20175
|
// we will just have to change buffer scheduling on audioTrackSwitched
|
@@ -20187,7 +20192,6 @@ class StreamController extends BaseStreamController {
|
|
20187
20192
|
// Reset audio transmuxer so when switching back to main audio we're not still appending where we left off
|
20188
20193
|
this.resetTransmuxer();
|
20189
20194
|
}
|
20190
|
-
const hls = this.hls;
|
20191
20195
|
// If switching from alt to main audio, flush all audio and trigger track switched
|
20192
20196
|
if (fromAltAudio) {
|
20193
20197
|
hls.trigger(Events.BUFFER_FLUSHING, {
|
@@ -20203,8 +20207,7 @@ class StreamController extends BaseStreamController {
|
|
20203
20207
|
}
|
20204
20208
|
}
|
20205
20209
|
onAudioTrackSwitched(event, data) {
|
20206
|
-
const
|
20207
|
-
const altAudio = !!this.hls.audioTracks[trackId].url;
|
20210
|
+
const altAudio = useAlternateAudio(data.url, this.hls);
|
20208
20211
|
if (altAudio) {
|
20209
20212
|
const videoBuffer = this.videoBuffer;
|
20210
20213
|
// if we switched on alternate audio, ensure that main fragment scheduling is synced with video sourcebuffer buffered
|