hls.js 1.6.3-0.canary.11211 → 1.6.3-0.canary.11214

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.light.js CHANGED
@@ -1165,7 +1165,7 @@
1165
1165
  // Some browsers don't allow to use bind on console object anyway
1166
1166
  // fallback to default if needed
1167
1167
  try {
1168
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.3-0.canary.11211");
1168
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.3-0.canary.11214");
1169
1169
  } catch (e) {
1170
1170
  /* log fn threw an exception. All logger methods are no-ops. */
1171
1171
  return createLogger();
@@ -2241,8 +2241,6 @@
2241
2241
  if (!track) {
2242
2242
  continue;
2243
2243
  }
2244
- var sampleCount = void 0;
2245
- var firstKeyFrame = void 0;
2246
2244
  var trackTimes = tracks[id] || (tracks[id] = {
2247
2245
  start: NaN,
2248
2246
  duration: 0,
@@ -2290,12 +2288,10 @@
2290
2288
  var sampleDuration = defaultSampleDuration;
2291
2289
  for (var j = 0; j < truns.length; j++) {
2292
2290
  var trun = truns[j];
2293
- sampleCount = readUint32(trun, 4);
2291
+ var sampleCount = readUint32(trun, 4);
2292
+ var sampleIndex = trackTimes.sampleCount;
2294
2293
  trackTimes.sampleCount += sampleCount;
2295
2294
  if (track.type === ElementaryStreamTypes.VIDEO) {
2296
- if (firstKeyFrame === undefined) {
2297
- firstKeyFrame = -1;
2298
- }
2299
2295
  var dataOffsetPresent = trun[3] & 0x01;
2300
2296
  var firstSampleFlagsPresent = trun[3] & 0x04;
2301
2297
  var sampleDurationPresent = trun[2] & 0x01;
@@ -2309,8 +2305,8 @@
2309
2305
  }
2310
2306
  if (firstSampleFlagsPresent && sampleCount) {
2311
2307
  var isNonSyncSample = trun[offset + 1] & 0x01;
2312
- if (!isNonSyncSample) {
2313
- firstKeyFrame = 0;
2308
+ if (!isNonSyncSample && trackTimes.keyFrameIndex === undefined) {
2309
+ trackTimes.keyFrameIndex = sampleIndex;
2314
2310
  }
2315
2311
  offset += 4;
2316
2312
  if (sampleDurationPresent) {
@@ -2342,8 +2338,8 @@
2342
2338
  if (sampleFlagsPresent) {
2343
2339
  var _isNonSyncSample = trun[offset + 1] & 0x01;
2344
2340
  if (!_isNonSyncSample) {
2345
- if (firstKeyFrame === -1) {
2346
- firstKeyFrame = sampleCount - (remaining + 1);
2341
+ if (trackTimes.keyFrameIndex === undefined) {
2342
+ trackTimes.keyFrameIndex = trackTimes.sampleCount - (remaining + 1);
2347
2343
  trackTimes.keyFrameStart = sampleDTS;
2348
2344
  }
2349
2345
  }
@@ -2355,7 +2351,6 @@
2355
2351
  sampleDTS += sampleDuration;
2356
2352
  rawDuration += sampleDuration;
2357
2353
  }
2358
- trackTimes.keyFrameIndex = firstKeyFrame;
2359
2354
  } else {
2360
2355
  rawDuration += defaultSampleDuration * sampleCount;
2361
2356
  }
@@ -20504,7 +20499,7 @@
20504
20499
  return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
20505
20500
  }
20506
20501
 
20507
- var version = "1.6.3-0.canary.11211";
20502
+ var version = "1.6.3-0.canary.11214";
20508
20503
 
20509
20504
  // ensure the worker ends up in the bundle
20510
20505
  // If the worker should not be included this gets aliased to empty.js