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

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
@@ -613,7 +613,7 @@
613
613
  // Some browsers don't allow to use bind on console object anyway
614
614
  // fallback to default if needed
615
615
  try {
616
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.8-0.canary.10054");
616
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.8-0.canary.10055");
617
617
  } catch (e) {
618
618
  /* log fn threw an exception. All logger methods are no-ops. */
619
619
  return createLogger();
@@ -4240,11 +4240,10 @@
4240
4240
  this.media = data.media;
4241
4241
  };
4242
4242
  _proto.onMediaDetaching = function onMediaDetaching() {
4243
- if (!this.id3Track) {
4244
- return;
4243
+ if (this.id3Track) {
4244
+ clearCurrentCues(this.id3Track);
4245
+ this.id3Track = null;
4245
4246
  }
4246
- clearCurrentCues(this.id3Track);
4247
- this.id3Track = null;
4248
4247
  this.media = null;
4249
4248
  this.dateRangeCuesAppended = {};
4250
4249
  };
@@ -7509,34 +7508,34 @@
7509
7508
  mediaSource.removeEventListener('startstreaming', this._onStartStreaming);
7510
7509
  mediaSource.removeEventListener('endstreaming', this._onEndStreaming);
7511
7510
  }
7511
+ this.mediaSource = null;
7512
+ this._objectUrl = null;
7513
+ }
7512
7514
 
7513
- // Detach properly the MediaSource from the HTMLMediaElement as
7514
- // suggested in https://github.com/w3c/media-source/issues/53.
7515
- if (media) {
7516
- media.removeEventListener('emptied', this._onMediaEmptied);
7517
- if (_objectUrl) {
7518
- self.URL.revokeObjectURL(_objectUrl);
7519
- }
7515
+ // Detach properly the MediaSource from the HTMLMediaElement as
7516
+ // suggested in https://github.com/w3c/media-source/issues/53.
7517
+ if (media) {
7518
+ media.removeEventListener('emptied', this._onMediaEmptied);
7519
+ if (_objectUrl) {
7520
+ self.URL.revokeObjectURL(_objectUrl);
7521
+ }
7520
7522
 
7521
- // clean up video tag src only if it's our own url. some external libraries might
7522
- // hijack the video tag and change its 'src' without destroying the Hls instance first
7523
- if (this.mediaSrc === _objectUrl) {
7524
- media.removeAttribute('src');
7525
- if (this.appendSource) {
7526
- removeSourceChildren(media);
7527
- }
7528
- media.load();
7529
- } else {
7530
- this.warn('media|source.src was changed by a third party - skip cleanup');
7523
+ // clean up video tag src only if it's our own url. some external libraries might
7524
+ // hijack the video tag and change its 'src' without destroying the Hls instance first
7525
+ if (this.mediaSrc === _objectUrl) {
7526
+ media.removeAttribute('src');
7527
+ if (this.appendSource) {
7528
+ removeSourceChildren(media);
7531
7529
  }
7530
+ media.load();
7531
+ } else {
7532
+ this.warn('media|source.src was changed by a third party - skip cleanup');
7532
7533
  }
7533
- this.mediaSource = null;
7534
7534
  this.media = null;
7535
- this._objectUrl = null;
7536
- this.bufferCodecEventsExpected = this._bufferCodecEventsTotal;
7537
- this.pendingTracks = {};
7538
- this.tracks = {};
7539
7535
  }
7536
+ this.bufferCodecEventsExpected = this._bufferCodecEventsTotal;
7537
+ this.pendingTracks = {};
7538
+ this.tracks = {};
7540
7539
  this.hls.trigger(Events.MEDIA_DETACHED, undefined);
7541
7540
  };
7542
7541
  _proto.onBufferReset = function onBufferReset() {
@@ -8628,9 +8627,11 @@
8628
8627
  };
8629
8628
  _proto.registerListeners = function registerListeners() {
8630
8629
  this.hls.on(Events.MEDIA_ATTACHING, this.onMediaAttaching, this);
8630
+ this.hls.on(Events.MEDIA_DETACHING, this.onMediaDetaching, this);
8631
8631
  };
8632
8632
  _proto.unregisterListeners = function unregisterListeners() {
8633
8633
  this.hls.off(Events.MEDIA_ATTACHING, this.onMediaAttaching, this);
8634
+ this.hls.off(Events.MEDIA_DETACHING, this.onMediaDetaching, this);
8634
8635
  };
8635
8636
  _proto.destroy = function destroy() {
8636
8637
  if (this.timer) {
@@ -8652,6 +8653,9 @@
8652
8653
  this.timer = self.setInterval(this.checkFPSInterval.bind(this), config.fpsDroppedMonitoringPeriod);
8653
8654
  }
8654
8655
  };
8656
+ _proto.onMediaDetaching = function onMediaDetaching() {
8657
+ this.media = null;
8658
+ };
8655
8659
  _proto.checkFPS = function checkFPS(video, decodedFrames, droppedFrames) {
8656
8660
  var currentTime = performance.now();
8657
8661
  if (decodedFrames) {
@@ -19867,8 +19871,8 @@
19867
19871
  if (media) {
19868
19872
  media.removeEventListener('playing', this.onMediaPlaying);
19869
19873
  media.removeEventListener('seeked', this.onMediaSeeked);
19870
- this.videoBuffer = null;
19871
19874
  }
19875
+ this.videoBuffer = null;
19872
19876
  this.fragPlaying = null;
19873
19877
  if (this.gapController) {
19874
19878
  this.gapController.destroy();
@@ -21466,7 +21470,7 @@
21466
21470
  * Get the video-dev/hls.js package version.
21467
21471
  */
21468
21472
  function get() {
21469
- return "1.5.8-0.canary.10054";
21473
+ return "1.5.8-0.canary.10055";
21470
21474
  }
21471
21475
  }, {
21472
21476
  key: "Events",