hls.js 1.5.13-0.canary.10408 → 1.5.13-0.canary.10411
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 +32 -49
- package/dist/hls.js.d.ts +1 -1
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +14 -44
- 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 +13 -43
- 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 +32 -49
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/dist/hls.worker.js.map +1 -1
- package/package.json +1 -1
- package/src/controller/audio-stream-controller.ts +25 -9
- package/src/controller/base-stream-controller.ts +1 -1
- package/src/remux/mp4-remuxer.ts +0 -50
- package/src/utils/codecs.ts +13 -9
package/dist/hls.light.mjs
CHANGED
@@ -420,7 +420,7 @@ function enableLogs(debugConfig, context, id) {
|
|
420
420
|
// Some browsers don't allow to use bind on console object anyway
|
421
421
|
// fallback to default if needed
|
422
422
|
try {
|
423
|
-
newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.5.13-0.canary.
|
423
|
+
newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.5.13-0.canary.10411"}`);
|
424
424
|
} catch (e) {
|
425
425
|
/* log fn threw an exception. All logger methods are no-ops. */
|
426
426
|
return createLogger();
|
@@ -2507,14 +2507,18 @@ function pickMostCompleteCodecName(parsedCodec, levelCodec) {
|
|
2507
2507
|
}
|
2508
2508
|
function convertAVC1ToAVCOTI(codec) {
|
2509
2509
|
// Convert avc1 codec string from RFC-4281 to RFC-6381 for MediaSource.isTypeSupported
|
2510
|
-
|
2511
|
-
|
2512
|
-
|
2513
|
-
|
2514
|
-
|
2515
|
-
|
2510
|
+
// Examples: avc1.66.30 to avc1.42001e and avc1.77.30,avc1.66.30 to avc1.4d001e,avc1.42001e.
|
2511
|
+
const codecs = codec.split(',');
|
2512
|
+
for (let i = 0; i < codecs.length; i++) {
|
2513
|
+
const avcdata = codecs[i].split('.');
|
2514
|
+
if (avcdata.length > 2) {
|
2515
|
+
let result = avcdata.shift() + '.';
|
2516
|
+
result += parseInt(avcdata.shift()).toString(16);
|
2517
|
+
result += ('000' + parseInt(avcdata.shift()).toString(16)).slice(-4);
|
2518
|
+
codecs[i] = result;
|
2519
|
+
}
|
2516
2520
|
}
|
2517
|
-
return
|
2521
|
+
return codecs.join(',');
|
2518
2522
|
}
|
2519
2523
|
function getM2TSSupportedAudioTypes(preferManagedMediaSource) {
|
2520
2524
|
const MediaSource = getMediaSource(preferManagedMediaSource) || {
|
@@ -17811,40 +17815,6 @@ class MP4Remuxer {
|
|
17811
17815
|
this.isAudioContiguous = true;
|
17812
17816
|
return audioData;
|
17813
17817
|
}
|
17814
|
-
remuxEmptyAudio(track, timeOffset, contiguous, videoData) {
|
17815
|
-
const inputTimeScale = track.inputTimeScale;
|
17816
|
-
const mp4timeScale = track.samplerate ? track.samplerate : inputTimeScale;
|
17817
|
-
const scaleFactor = inputTimeScale / mp4timeScale;
|
17818
|
-
const nextAudioPts = this.nextAudioPts;
|
17819
|
-
// sync with video's timestamp
|
17820
|
-
const initDTS = this._initDTS;
|
17821
|
-
const init90kHz = initDTS.baseTime * 90000 / initDTS.timescale;
|
17822
|
-
const startDTS = (nextAudioPts !== null ? nextAudioPts : videoData.startDTS * inputTimeScale) + init90kHz;
|
17823
|
-
const endDTS = videoData.endDTS * inputTimeScale + init90kHz;
|
17824
|
-
// one sample's duration value
|
17825
|
-
const frameDuration = scaleFactor * AAC_SAMPLES_PER_FRAME;
|
17826
|
-
// samples count of this segment's duration
|
17827
|
-
const nbSamples = Math.ceil((endDTS - startDTS) / frameDuration);
|
17828
|
-
// silent frame
|
17829
|
-
const silentFrame = AAC.getSilentFrame(track.parsedCodec || track.manifestCodec || track.codec, track.channelCount);
|
17830
|
-
logger.warn('[mp4-remuxer]: remux empty Audio');
|
17831
|
-
// Can't remux if we can't generate a silent frame...
|
17832
|
-
if (!silentFrame) {
|
17833
|
-
logger.trace('[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec');
|
17834
|
-
return;
|
17835
|
-
}
|
17836
|
-
const samples = [];
|
17837
|
-
for (let i = 0; i < nbSamples; i++) {
|
17838
|
-
const stamp = startDTS + i * frameDuration;
|
17839
|
-
samples.push({
|
17840
|
-
unit: silentFrame,
|
17841
|
-
pts: stamp,
|
17842
|
-
dts: stamp
|
17843
|
-
});
|
17844
|
-
}
|
17845
|
-
track.samples = samples;
|
17846
|
-
return this.remuxAudio(track, timeOffset, contiguous, false);
|
17847
|
-
}
|
17848
17818
|
}
|
17849
17819
|
function normalizePts(value, reference) {
|
17850
17820
|
let offset;
|
@@ -20670,7 +20640,7 @@ class Hls {
|
|
20670
20640
|
* Get the video-dev/hls.js package version.
|
20671
20641
|
*/
|
20672
20642
|
static get version() {
|
20673
|
-
return "1.5.13-0.canary.
|
20643
|
+
return "1.5.13-0.canary.10411";
|
20674
20644
|
}
|
20675
20645
|
|
20676
20646
|
/**
|