hls.js 1.5.14-0.canary.10602 → 1.5.14-0.canary.10603
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 +7 -4
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +7 -4
- 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 +7 -4
- 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 +7 -4
- 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/demux/mp4demuxer.ts +13 -9
package/package.json
CHANGED
package/src/demux/mp4demuxer.ts
CHANGED
@@ -20,6 +20,7 @@ import {
|
|
20
20
|
parseInitSegment,
|
21
21
|
RemuxerTrackIdConfig,
|
22
22
|
hasMoofData,
|
23
|
+
IEmsgParsingData,
|
23
24
|
} from '../utils/mp4-tools';
|
24
25
|
import { dummyTrack } from './dummy-demuxed-track';
|
25
26
|
import type { HlsEventEmitter } from '../events';
|
@@ -155,10 +156,7 @@ class MP4Demuxer implements Demuxer {
|
|
155
156
|
emsgs.forEach((data: Uint8Array) => {
|
156
157
|
const emsgInfo = parseEmsg(data);
|
157
158
|
if (emsgSchemePattern.test(emsgInfo.schemeIdUri)) {
|
158
|
-
const pts =
|
159
|
-
? emsgInfo.presentationTime! / emsgInfo.timeScale
|
160
|
-
: timeOffset +
|
161
|
-
emsgInfo.presentationTimeDelta! / emsgInfo.timeScale;
|
159
|
+
const pts = getEmsgStartTime(emsgInfo, timeOffset);
|
162
160
|
let duration =
|
163
161
|
emsgInfo.eventDuration === 0xffffffff
|
164
162
|
? Number.POSITIVE_INFINITY
|
@@ -180,11 +178,7 @@ class MP4Demuxer implements Demuxer {
|
|
180
178
|
this.config.enableEmsgKLVMetadata &&
|
181
179
|
emsgInfo.schemeIdUri.startsWith('urn:misb:KLV:bin:1910.1')
|
182
180
|
) {
|
183
|
-
const pts =
|
184
|
-
? emsgInfo.presentationTime! / emsgInfo.timeScale
|
185
|
-
: timeOffset +
|
186
|
-
emsgInfo.presentationTimeDelta! / emsgInfo.timeScale;
|
187
|
-
|
181
|
+
const pts = getEmsgStartTime(emsgInfo, timeOffset);
|
188
182
|
id3Track.samples.push({
|
189
183
|
data: emsgInfo.payload,
|
190
184
|
len: emsgInfo.payload.byteLength,
|
@@ -222,4 +216,14 @@ class MP4Demuxer implements Demuxer {
|
|
222
216
|
}
|
223
217
|
}
|
224
218
|
|
219
|
+
function getEmsgStartTime(
|
220
|
+
emsgInfo: IEmsgParsingData,
|
221
|
+
timeOffset: number,
|
222
|
+
): number {
|
223
|
+
return Number.isFinite(emsgInfo.presentationTime)
|
224
|
+
? (emsgInfo.presentationTime as number) / emsgInfo.timeScale
|
225
|
+
: timeOffset +
|
226
|
+
(emsgInfo.presentationTimeDelta as number) / emsgInfo.timeScale;
|
227
|
+
}
|
228
|
+
|
225
229
|
export default MP4Demuxer;
|