hls.js 1.5.8-0.canary.10054 → 1.5.8-0.canary.10057

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 CHANGED
@@ -644,7 +644,7 @@
644
644
  // Some browsers don't allow to use bind on console object anyway
645
645
  // fallback to default if needed
646
646
  try {
647
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.8-0.canary.10054");
647
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.8-0.canary.10057");
648
648
  } catch (e) {
649
649
  /* log fn threw an exception. All logger methods are no-ops. */
650
650
  return createLogger();
@@ -4766,11 +4766,10 @@
4766
4766
  this.media = data.media;
4767
4767
  };
4768
4768
  _proto.onMediaDetaching = function onMediaDetaching() {
4769
- if (!this.id3Track) {
4770
- return;
4769
+ if (this.id3Track) {
4770
+ clearCurrentCues(this.id3Track);
4771
+ this.id3Track = null;
4771
4772
  }
4772
- clearCurrentCues(this.id3Track);
4773
- this.id3Track = null;
4774
4773
  this.media = null;
4775
4774
  this.dateRangeCuesAppended = {};
4776
4775
  };
@@ -19300,34 +19299,34 @@
19300
19299
  mediaSource.removeEventListener('startstreaming', this._onStartStreaming);
19301
19300
  mediaSource.removeEventListener('endstreaming', this._onEndStreaming);
19302
19301
  }
19302
+ this.mediaSource = null;
19303
+ this._objectUrl = null;
19304
+ }
19303
19305
 
19304
- // Detach properly the MediaSource from the HTMLMediaElement as
19305
- // suggested in https://github.com/w3c/media-source/issues/53.
19306
- if (media) {
19307
- media.removeEventListener('emptied', this._onMediaEmptied);
19308
- if (_objectUrl) {
19309
- self.URL.revokeObjectURL(_objectUrl);
19310
- }
19306
+ // Detach properly the MediaSource from the HTMLMediaElement as
19307
+ // suggested in https://github.com/w3c/media-source/issues/53.
19308
+ if (media) {
19309
+ media.removeEventListener('emptied', this._onMediaEmptied);
19310
+ if (_objectUrl) {
19311
+ self.URL.revokeObjectURL(_objectUrl);
19312
+ }
19311
19313
 
19312
- // clean up video tag src only if it's our own url. some external libraries might
19313
- // hijack the video tag and change its 'src' without destroying the Hls instance first
19314
- if (this.mediaSrc === _objectUrl) {
19315
- media.removeAttribute('src');
19316
- if (this.appendSource) {
19317
- removeSourceChildren(media);
19318
- }
19319
- media.load();
19320
- } else {
19321
- this.warn('media|source.src was changed by a third party - skip cleanup');
19314
+ // clean up video tag src only if it's our own url. some external libraries might
19315
+ // hijack the video tag and change its 'src' without destroying the Hls instance first
19316
+ if (this.mediaSrc === _objectUrl) {
19317
+ media.removeAttribute('src');
19318
+ if (this.appendSource) {
19319
+ removeSourceChildren(media);
19322
19320
  }
19321
+ media.load();
19322
+ } else {
19323
+ this.warn('media|source.src was changed by a third party - skip cleanup');
19323
19324
  }
19324
- this.mediaSource = null;
19325
19325
  this.media = null;
19326
- this._objectUrl = null;
19327
- this.bufferCodecEventsExpected = this._bufferCodecEventsTotal;
19328
- this.pendingTracks = {};
19329
- this.tracks = {};
19330
19326
  }
19327
+ this.bufferCodecEventsExpected = this._bufferCodecEventsTotal;
19328
+ this.pendingTracks = {};
19329
+ this.tracks = {};
19331
19330
  this.hls.trigger(Events.MEDIA_DETACHED, undefined);
19332
19331
  };
19333
19332
  _proto.onBufferReset = function onBufferReset() {
@@ -22578,7 +22577,7 @@
22578
22577
  hls.off(Events.SUBTITLE_TRACKS_CLEARED, this.onSubtitleTracksCleared, this);
22579
22578
  hls.off(Events.BUFFER_FLUSHING, this.onBufferFlushing, this);
22580
22579
  // @ts-ignore
22581
- this.hls = this.config = null;
22580
+ this.hls = this.config = this.media = null;
22582
22581
  this.cea608Parser1 = this.cea608Parser2 = undefined;
22583
22582
  };
22584
22583
  _proto.initCea608Parsers = function initCea608Parsers() {
@@ -22733,6 +22732,7 @@
22733
22732
  delete captionsTracks[trackName];
22734
22733
  });
22735
22734
  this.nonNativeCaptionsTracks = {};
22735
+ this.media = null;
22736
22736
  };
22737
22737
  _proto.onManifestLoading = function onManifestLoading() {
22738
22738
  // Detect discontinuity in video fragment (CEA-608) parsing
@@ -23399,9 +23399,11 @@
23399
23399
  };
23400
23400
  _proto.registerListeners = function registerListeners() {
23401
23401
  this.hls.on(Events.MEDIA_ATTACHING, this.onMediaAttaching, this);
23402
+ this.hls.on(Events.MEDIA_DETACHING, this.onMediaDetaching, this);
23402
23403
  };
23403
23404
  _proto.unregisterListeners = function unregisterListeners() {
23404
23405
  this.hls.off(Events.MEDIA_ATTACHING, this.onMediaAttaching, this);
23406
+ this.hls.off(Events.MEDIA_DETACHING, this.onMediaDetaching, this);
23405
23407
  };
23406
23408
  _proto.destroy = function destroy() {
23407
23409
  if (this.timer) {
@@ -23423,6 +23425,9 @@
23423
23425
  this.timer = self.setInterval(this.checkFPSInterval.bind(this), config.fpsDroppedMonitoringPeriod);
23424
23426
  }
23425
23427
  };
23428
+ _proto.onMediaDetaching = function onMediaDetaching() {
23429
+ this.media = null;
23430
+ };
23426
23431
  _proto.checkFPS = function checkFPS(video, decodedFrames, droppedFrames) {
23427
23432
  var currentTime = performance.now();
23428
23433
  if (decodedFrames) {
@@ -25458,7 +25463,7 @@
25458
25463
  // @ts-ignore
25459
25464
  this.hls = this.config = this.audioBuffer = this.videoBuffer = null;
25460
25465
  // @ts-ignore
25461
- this.onWaiting = this.onPlaying = null;
25466
+ this.onWaiting = this.onPlaying = this.media = null;
25462
25467
  };
25463
25468
  _proto.onMediaAttached = function onMediaAttached(event, data) {
25464
25469
  this.media = data.media;
@@ -25595,7 +25600,7 @@
25595
25600
  * Get the buffer length for a media type in milliseconds
25596
25601
  */;
25597
25602
  _proto.getBufferLength = function getBufferLength(type) {
25598
- var media = this.hls.media;
25603
+ var media = this.media;
25599
25604
  var buffer = type === CmObjectType.AUDIO ? this.audioBuffer : this.videoBuffer;
25600
25605
  if (!buffer || !media) {
25601
25606
  return NaN;
@@ -28621,8 +28626,8 @@
28621
28626
  if (media) {
28622
28627
  media.removeEventListener('playing', this.onMediaPlaying);
28623
28628
  media.removeEventListener('seeked', this.onMediaSeeked);
28624
- this.videoBuffer = null;
28625
28629
  }
28630
+ this.videoBuffer = null;
28626
28631
  this.fragPlaying = null;
28627
28632
  if (this.gapController) {
28628
28633
  this.gapController.destroy();
@@ -30220,7 +30225,7 @@
30220
30225
  * Get the video-dev/hls.js package version.
30221
30226
  */
30222
30227
  function get() {
30223
- return "1.5.8-0.canary.10054";
30228
+ return "1.5.8-0.canary.10057";
30224
30229
  }
30225
30230
  }, {
30226
30231
  key: "Events",
package/dist/hls.js.d.ts CHANGED
@@ -1070,6 +1070,7 @@ export declare class FPSController implements ComponentAPI {
1070
1070
  protected unregisterListeners(): void;
1071
1071
  destroy(): void;
1072
1072
  protected onMediaAttaching(event: Events.MEDIA_ATTACHING, data: MediaAttachingData): void;
1073
+ private onMediaDetaching;
1073
1074
  checkFPS(video: HTMLVideoElement, decodedFrames: number, droppedFrames: number): void;
1074
1075
  checkFPSInterval(): void;
1075
1076
  }