rx-player 3.30.0-dev.2023020100 → 3.30.0-dev.2023022200

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.
Files changed (167) hide show
  1. package/CHANGELOG.md +2 -1
  2. package/VERSION +1 -1
  3. package/dist/_esm5.processed/compat/eme/close_session.js +2 -2
  4. package/dist/_esm5.processed/compat/event_listeners.js +1 -1
  5. package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.js +4 -2
  6. package/dist/_esm5.processed/core/api/debug/buffer_graph.d.ts +28 -0
  7. package/dist/_esm5.processed/core/api/debug/buffer_graph.js +175 -0
  8. package/dist/_esm5.processed/core/api/debug/buffer_size_graph.d.ts +10 -0
  9. package/dist/_esm5.processed/core/api/debug/buffer_size_graph.js +105 -0
  10. package/dist/_esm5.processed/core/api/debug/constants.d.ts +2 -0
  11. package/dist/_esm5.processed/core/api/debug/constants.js +2 -0
  12. package/dist/_esm5.processed/core/api/debug/index.d.ts +2 -0
  13. package/dist/_esm5.processed/core/api/debug/index.js +2 -0
  14. package/dist/_esm5.processed/core/api/debug/modules/general_info.d.ts +3 -0
  15. package/dist/_esm5.processed/core/api/debug/modules/general_info.js +199 -0
  16. package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_content.d.ts +4 -0
  17. package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_content.js +121 -0
  18. package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_size.d.ts +3 -0
  19. package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_size.js +35 -0
  20. package/dist/_esm5.processed/core/api/debug/render.d.ts +3 -0
  21. package/dist/_esm5.processed/core/api/debug/render.js +32 -0
  22. package/dist/_esm5.processed/core/api/debug/utils.d.ts +39 -0
  23. package/dist/_esm5.processed/core/api/debug/utils.js +57 -0
  24. package/dist/_esm5.processed/core/api/playback_observer.js +3 -2
  25. package/dist/_esm5.processed/core/api/public_api.d.ts +3 -0
  26. package/dist/_esm5.processed/core/api/public_api.js +24 -13
  27. package/dist/_esm5.processed/core/api/utils.js +3 -3
  28. package/dist/_esm5.processed/core/decrypt/__tests__/__global__/utils.d.ts +5 -5
  29. package/dist/_esm5.processed/core/decrypt/attach_media_keys.js +1 -1
  30. package/dist/_esm5.processed/core/decrypt/content_decryptor.js +1 -1
  31. package/dist/_esm5.processed/core/decrypt/session_events_listener.js +37 -47
  32. package/dist/_esm5.processed/core/decrypt/utils/check_key_statuses.js +4 -0
  33. package/dist/_esm5.processed/core/fetchers/cdn_prioritizer.d.ts +17 -8
  34. package/dist/_esm5.processed/core/fetchers/cdn_prioritizer.js +10 -6
  35. package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.js +5 -4
  36. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.d.ts +22 -5
  37. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.js +37 -21
  38. package/dist/_esm5.processed/core/fetchers/segment/task_prioritizer.js +21 -23
  39. package/dist/_esm5.processed/core/fetchers/utils/schedule_request.js +6 -5
  40. package/dist/_esm5.processed/core/init/directfile_content_initializer.js +1 -1
  41. package/dist/_esm5.processed/core/init/media_source_content_initializer.js +27 -31
  42. package/dist/_esm5.processed/core/init/utils/content_time_boundaries_observer.js +2 -2
  43. package/dist/_esm5.processed/core/init/utils/create_media_source.js +3 -12
  44. package/dist/_esm5.processed/core/init/utils/end_of_stream.js +6 -3
  45. package/dist/_esm5.processed/core/init/utils/get_loaded_reference.js +2 -1
  46. package/dist/_esm5.processed/core/init/utils/initial_seek_and_play.js +9 -5
  47. package/dist/_esm5.processed/core/init/utils/initialize_content_decryption.js +2 -1
  48. package/dist/_esm5.processed/core/init/utils/media_duration_updater.js +23 -19
  49. package/dist/_esm5.processed/core/init/utils/stream_events_emitter/stream_events_emitter.js +6 -4
  50. package/dist/_esm5.processed/core/init/utils/throw_on_media_error.js +1 -1
  51. package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +7 -10
  52. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +4 -2
  53. package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.js +13 -9
  54. package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.js +10 -11
  55. package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.js +26 -12
  56. package/dist/_esm5.processed/core/stream/period/period_stream.js +11 -10
  57. package/dist/_esm5.processed/core/stream/representation/representation_stream.js +15 -15
  58. package/dist/_esm5.processed/core/stream/representation/utils/append_segment_to_buffer.js +1 -1
  59. package/dist/_esm5.processed/core/stream/representation/utils/downloading_queue.js +16 -6
  60. package/dist/_esm5.processed/experimental/features/debug_element.d.ts +8 -0
  61. package/dist/_esm5.processed/experimental/features/debug_element.js +10 -0
  62. package/dist/_esm5.processed/experimental/features/index.d.ts +1 -0
  63. package/dist/_esm5.processed/experimental/features/index.js +1 -0
  64. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.js +7 -4
  65. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +5 -4
  66. package/dist/_esm5.processed/features/features_object.js +1 -0
  67. package/dist/_esm5.processed/features/initialize_features.js +13 -10
  68. package/dist/_esm5.processed/features/types.d.ts +3 -0
  69. package/dist/_esm5.processed/manifest/adaptation.js +4 -0
  70. package/dist/_esm5.processed/manifest/manifest.js +2 -0
  71. package/dist/_esm5.processed/manifest/representation.js +11 -4
  72. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.js +105 -137
  73. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.js +25 -5
  74. package/dist/_esm5.processed/public_types.d.ts +1 -0
  75. package/dist/_esm5.processed/transports/dash/add_segment_integrity_checks_to_loader.js +13 -12
  76. package/dist/_esm5.processed/transports/dash/low_latency_segment_loader.js +2 -2
  77. package/dist/_esm5.processed/transports/dash/manifest_parser.js +1 -1
  78. package/dist/_esm5.processed/transports/dash/segment_loader.js +4 -4
  79. package/dist/_esm5.processed/transports/local/segment_loader.js +13 -26
  80. package/dist/_esm5.processed/transports/smooth/segment_loader.js +4 -4
  81. package/dist/_esm5.processed/transports/utils/call_custom_manifest_loader.js +3 -3
  82. package/dist/_esm5.processed/utils/cancellable_sleep.js +4 -10
  83. package/dist/_esm5.processed/utils/create_cancellable_promise.d.ts +26 -0
  84. package/dist/_esm5.processed/utils/create_cancellable_promise.js +52 -0
  85. package/dist/_esm5.processed/utils/reference.js +6 -0
  86. package/dist/_esm5.processed/utils/request/xhr.js +1 -1
  87. package/dist/_esm5.processed/utils/task_canceller.d.ts +34 -15
  88. package/dist/_esm5.processed/utils/task_canceller.js +55 -22
  89. package/dist/rx-player.js +739 -626
  90. package/dist/rx-player.min.js +1 -1
  91. package/jest.config.js +1 -0
  92. package/package.json +18 -18
  93. package/scripts/build/constants.d.ts +1 -0
  94. package/scripts/report_build_sizes +4 -0
  95. package/sonar-project.properties +1 -1
  96. package/src/compat/eme/close_session.ts +2 -2
  97. package/src/compat/event_listeners.ts +1 -1
  98. package/src/core/adaptive/adaptive_representation_selector.ts +4 -2
  99. package/src/core/api/debug/buffer_graph.ts +247 -0
  100. package/src/core/api/debug/buffer_size_graph.ts +131 -0
  101. package/src/core/api/debug/constants.ts +2 -0
  102. package/src/core/api/debug/index.ts +3 -0
  103. package/src/core/api/debug/modules/general_info.ts +204 -0
  104. package/src/core/api/debug/modules/segment_buffer_content.ts +155 -0
  105. package/src/core/api/debug/modules/segment_buffer_size.ts +48 -0
  106. package/src/core/api/debug/render.ts +40 -0
  107. package/src/core/api/debug/utils.ts +103 -0
  108. package/src/core/api/playback_observer.ts +4 -2
  109. package/src/core/api/public_api.ts +27 -13
  110. package/src/core/api/utils.ts +3 -3
  111. package/src/core/decrypt/attach_media_keys.ts +1 -1
  112. package/src/core/decrypt/content_decryptor.ts +1 -1
  113. package/src/core/decrypt/session_events_listener.ts +37 -49
  114. package/src/core/decrypt/utils/check_key_statuses.ts +6 -0
  115. package/src/core/fetchers/cdn_prioritizer.ts +18 -9
  116. package/src/core/fetchers/manifest/manifest_fetcher.ts +5 -4
  117. package/src/core/fetchers/segment/segment_fetcher.ts +36 -14
  118. package/src/core/fetchers/segment/task_prioritizer.ts +25 -30
  119. package/src/core/fetchers/utils/schedule_request.ts +6 -5
  120. package/src/core/init/directfile_content_initializer.ts +1 -1
  121. package/src/core/init/media_source_content_initializer.ts +37 -41
  122. package/src/core/init/utils/content_time_boundaries_observer.ts +2 -2
  123. package/src/core/init/utils/create_media_source.ts +4 -16
  124. package/src/core/init/utils/end_of_stream.ts +6 -3
  125. package/src/core/init/utils/get_loaded_reference.ts +2 -1
  126. package/src/core/init/utils/initial_seek_and_play.ts +9 -5
  127. package/src/core/init/utils/initialize_content_decryption.ts +2 -1
  128. package/src/core/init/utils/media_duration_updater.ts +25 -20
  129. package/src/core/init/utils/stream_events_emitter/stream_events_emitter.ts +6 -4
  130. package/src/core/init/utils/throw_on_media_error.ts +1 -1
  131. package/src/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.ts +7 -11
  132. package/src/core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts +4 -2
  133. package/src/core/segment_buffers/segment_buffers_store.ts +16 -13
  134. package/src/core/stream/adaptation/adaptation_stream.ts +10 -11
  135. package/src/core/stream/orchestrator/stream_orchestrator.ts +26 -12
  136. package/src/core/stream/period/period_stream.ts +11 -10
  137. package/src/core/stream/representation/representation_stream.ts +15 -15
  138. package/src/core/stream/representation/utils/append_segment_to_buffer.ts +1 -1
  139. package/src/core/stream/representation/utils/downloading_queue.ts +16 -4
  140. package/src/experimental/features/__tests__/debug_element.test.ts +26 -0
  141. package/src/experimental/features/debug_element.ts +13 -0
  142. package/src/experimental/features/index.ts +1 -0
  143. package/src/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.ts +7 -4
  144. package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.ts +5 -4
  145. package/src/features/__tests__/initialize_features.test.ts +11 -0
  146. package/src/features/features_object.ts +1 -0
  147. package/src/features/initialize_features.ts +15 -10
  148. package/src/features/types.ts +9 -0
  149. package/src/manifest/adaptation.ts +7 -0
  150. package/src/manifest/manifest.ts +4 -0
  151. package/src/manifest/representation.ts +10 -4
  152. package/src/parsers/manifest/dash/common/parse_adaptation_sets.ts +116 -151
  153. package/src/parsers/manifest/dash/common/parse_representations.ts +21 -4
  154. package/src/public_types.ts +1 -0
  155. package/src/transports/dash/add_segment_integrity_checks_to_loader.ts +30 -24
  156. package/src/transports/dash/low_latency_segment_loader.ts +2 -2
  157. package/src/transports/dash/manifest_parser.ts +1 -1
  158. package/src/transports/dash/segment_loader.ts +4 -4
  159. package/src/transports/local/segment_loader.ts +14 -30
  160. package/src/transports/smooth/segment_loader.ts +4 -4
  161. package/src/transports/utils/call_custom_manifest_loader.ts +3 -3
  162. package/src/typings/globals.d.ts +2 -0
  163. package/src/utils/cancellable_sleep.ts +5 -14
  164. package/src/utils/create_cancellable_promise.ts +69 -0
  165. package/src/utils/reference.ts +6 -0
  166. package/src/utils/request/xhr.ts +1 -1
  167. package/src/utils/task_canceller.ts +63 -34
@@ -146,9 +146,10 @@ export default function StreamOrchestrator(content, playbackObserver, representa
146
146
  };
147
147
  });
148
148
  // Create automatically the right `PeriodStream` for every possible types
149
- segmentBuffersStore.getBufferTypes().map(function (bufferType) {
149
+ for (var _i = 0, _b = segmentBuffersStore.getBufferTypes(); _i < _b.length; _i++) {
150
+ var bufferType = _b[_i];
150
151
  manageEveryStreams(bufferType, initialPeriod);
151
- });
152
+ }
152
153
  /**
153
154
  * Manage creation and removal of Streams for every Periods for a given type.
154
155
  *
@@ -170,7 +171,8 @@ export default function StreamOrchestrator(content, playbackObserver, representa
170
171
  */
171
172
  var enableOutOfBoundsCheck = false;
172
173
  /** Cancels currently created `PeriodStream`s. */
173
- var currentCanceller = new TaskCanceller({ cancelOn: orchestratorCancelSignal });
174
+ var currentCanceller = new TaskCanceller();
175
+ currentCanceller.linkToSignal(orchestratorCancelSignal);
174
176
  // Restart the current Stream when the wanted time is in another period
175
177
  // than the ones already considered
176
178
  playbackObserver.listen(function (_a) {
@@ -188,7 +190,8 @@ export default function StreamOrchestrator(content, playbackObserver, representa
188
190
  callbacks.periodStreamCleared({ type: bufferType, period: period });
189
191
  }
190
192
  currentCanceller.cancel();
191
- currentCanceller = new TaskCanceller({ cancelOn: orchestratorCancelSignal });
193
+ currentCanceller = new TaskCanceller();
194
+ currentCanceller.linkToSignal(orchestratorCancelSignal);
192
195
  var nextPeriod = (_c = manifest.getPeriodForTime(time)) !== null && _c !== void 0 ? _c : manifest.getNextPeriod(time);
193
196
  if (nextPeriod === undefined) {
194
197
  log.warn("Stream: The wanted position is not found in the Manifest.");
@@ -264,8 +267,15 @@ export default function StreamOrchestrator(content, playbackObserver, representa
264
267
  segmentBufferStatus = segmentBuffersStore.getStatus(bufferType);
265
268
  ofCurrentType = updates
266
269
  .filter(function (update) { return update.adaptation.type === bufferType; });
267
- if (ofCurrentType.length === 0 || segmentBufferStatus.type !== "initialized") {
268
- return [2 /*return*/]; // no need to stop the current Streams.
270
+ if (
271
+ // No update concerns the current type of data
272
+ ofCurrentType.length === 0 ||
273
+ segmentBufferStatus.type !== "initialized" ||
274
+ // The update only notifies of now-decipherable streams
275
+ ofCurrentType.every(function (x) { return x.representation.decipherable === true; })) {
276
+ // Data won't have to be removed from the buffers, no need to stop the
277
+ // current Streams.
278
+ return [2 /*return*/];
269
279
  }
270
280
  segmentBuffer = segmentBufferStatus.value;
271
281
  resettedContent = ofCurrentType.filter(function (update) {
@@ -286,7 +296,8 @@ export default function StreamOrchestrator(content, playbackObserver, representa
286
296
  callbacks.periodStreamCleared({ type: bufferType, period: period });
287
297
  }
288
298
  currentCanceller.cancel();
289
- currentCanceller = new TaskCanceller({ cancelOn: orchestratorCancelSignal });
299
+ currentCanceller = new TaskCanceller();
300
+ currentCanceller.linkToSignal(orchestratorCancelSignal);
290
301
  _i = 0, _a = __spreadArray(__spreadArray([], undecipherableRanges, true), rangesToRemove, true);
291
302
  _c.label = 1;
292
303
  case 1:
@@ -306,7 +317,7 @@ export default function StreamOrchestrator(content, playbackObserver, representa
306
317
  // was going to be emitted synchronously.
307
318
  nextTick(function () {
308
319
  var _a, _b;
309
- if (orchestratorCancelSignal.isCancelled) {
320
+ if (orchestratorCancelSignal.isCancelled()) {
310
321
  return;
311
322
  }
312
323
  var observation = playbackObserver.getReference().getValue();
@@ -315,13 +326,13 @@ export default function StreamOrchestrator(content, playbackObserver, representa
315
326
  callbacks.needsDecipherabilityFlush({ position: observation.position.last,
316
327
  autoPlay: shouldAutoPlay,
317
328
  duration: observation.duration });
318
- if (orchestratorCancelSignal.isCancelled) {
329
+ if (orchestratorCancelSignal.isCancelled()) {
319
330
  return;
320
331
  }
321
332
  }
322
333
  else if (needsFlushingAfterClean(observation, rangesToRemove)) {
323
334
  callbacks.needsBufferFlush();
324
- if (orchestratorCancelSignal.isCancelled) {
335
+ if (orchestratorCancelSignal.isCancelled()) {
325
336
  return;
326
337
  }
327
338
  }
@@ -378,7 +389,8 @@ export default function StreamOrchestrator(content, playbackObserver, representa
378
389
  */
379
390
  var nextStreamInfo = null;
380
391
  /** Emits when the `PeriodStream` linked to `basePeriod` should be destroyed. */
381
- var currentStreamCanceller = new TaskCanceller({ cancelOn: cancelSignal });
392
+ var currentStreamCanceller = new TaskCanceller();
393
+ currentStreamCanceller.linkToSignal(cancelSignal);
382
394
  // Stop current PeriodStream when the current position goes over the end of
383
395
  // that Period.
384
396
  playbackObserver.listen(function (_a, stopListeningObservations) {
@@ -431,7 +443,9 @@ export default function StreamOrchestrator(content, playbackObserver, representa
431
443
  period: nextStreamInfo.period });
432
444
  nextStreamInfo.canceller.cancel();
433
445
  }
434
- nextStreamInfo = { canceller: new TaskCanceller({ cancelOn: cancelSignal }),
446
+ var nextStreamCanceller = new TaskCanceller();
447
+ nextStreamCanceller.linkToSignal(cancelSignal);
448
+ nextStreamInfo = { canceller: nextStreamCanceller,
435
449
  period: nextPeriod };
436
450
  manageConsecutivePeriodStreams(bufferType, nextPeriod, consecutivePeriodStreamCb, nextStreamInfo.canceller.signal);
437
451
  }
@@ -113,7 +113,7 @@ export default function PeriodStream(_a, callbacks, parentCancelSignal) {
113
113
  */
114
114
  var adaptationRef = createSharedReference(undefined, parentCancelSignal);
115
115
  callbacks.periodStreamReady({ type: bufferType, period: period, adaptationRef: adaptationRef });
116
- if (parentCancelSignal.isCancelled) {
116
+ if (parentCancelSignal.isCancelled()) {
117
117
  return;
118
118
  }
119
119
  var currentStreamCanceller;
@@ -129,7 +129,8 @@ export default function PeriodStream(_a, callbacks, parentCancelSignal) {
129
129
  if (adaptation === undefined) {
130
130
  return [2 /*return*/];
131
131
  }
132
- streamCanceller = new TaskCanceller({ cancelOn: parentCancelSignal });
132
+ streamCanceller = new TaskCanceller();
133
+ streamCanceller.linkToSignal(parentCancelSignal);
133
134
  currentStreamCanceller === null || currentStreamCanceller === void 0 ? void 0 : currentStreamCanceller.cancel(); // Cancel oreviously created stream if one
134
135
  currentStreamCanceller = streamCanceller;
135
136
  if (!(adaptation === null)) return [3 /*break*/, 7];
@@ -147,7 +148,7 @@ export default function PeriodStream(_a, callbacks, parentCancelSignal) {
147
148
  case 2: return [4 /*yield*/, segmentBufferStatus.value.removeBuffer(period.start, periodEnd, streamCanceller.signal)];
148
149
  case 3:
149
150
  _d.sent();
150
- if (streamCanceller.isUsed) {
151
+ if (streamCanceller.isUsed()) {
151
152
  return [2 /*return*/]; // The stream has been cancelled
152
153
  }
153
154
  _d.label = 4;
@@ -155,14 +156,14 @@ export default function PeriodStream(_a, callbacks, parentCancelSignal) {
155
156
  case 5:
156
157
  if (segmentBufferStatus.type === "uninitialized") {
157
158
  segmentBuffersStore.disableSegmentBuffer(bufferType);
158
- if (streamCanceller.isUsed) {
159
+ if (streamCanceller.isUsed()) {
159
160
  return [2 /*return*/]; // The stream has been cancelled
160
161
  }
161
162
  }
162
163
  _d.label = 6;
163
164
  case 6:
164
165
  callbacks.adaptationChange({ type: bufferType, adaptation: null, period: period });
165
- if (streamCanceller.isUsed) {
166
+ if (streamCanceller.isUsed()) {
166
167
  return [2 /*return*/]; // Previous call has provoken Stream cancellation by side-effect
167
168
  }
168
169
  return [2 /*return*/, createEmptyAdaptationStream(playbackObserver, wantedBufferAhead, bufferType, { period: period }, callbacks, streamCanceller.signal)];
@@ -179,7 +180,7 @@ export default function PeriodStream(_a, callbacks, parentCancelSignal) {
179
180
  }
180
181
  log.info("Stream: Updating ".concat(bufferType, " adaptation"), "A: ".concat(adaptation.id), "P: ".concat(period.start));
181
182
  callbacks.adaptationChange({ type: bufferType, adaptation: adaptation, period: period });
182
- if (streamCanceller.isUsed) {
183
+ if (streamCanceller.isUsed()) {
183
184
  return [2 /*return*/]; // Previous call has provoken cancellation by side-effect
184
185
  }
185
186
  readyState = playbackObserver.getReadyState();
@@ -192,7 +193,7 @@ export default function PeriodStream(_a, callbacks, parentCancelSignal) {
192
193
  return [4 /*yield*/, segmentBuffersStore.waitForUsableBuffers(streamCanceller.signal)];
193
194
  case 8:
194
195
  _d.sent();
195
- if (streamCanceller.isUsed) {
196
+ if (streamCanceller.isUsed()) {
196
197
  return [2 /*return*/]; // The Stream has since been cancelled
197
198
  }
198
199
  if (!(strategy.type === "flush-buffer" || strategy.type === "clean-buffer")) return [3 /*break*/, 13];
@@ -204,7 +205,7 @@ export default function PeriodStream(_a, callbacks, parentCancelSignal) {
204
205
  return [4 /*yield*/, segmentBuffer.removeBuffer(start, end, streamCanceller.signal)];
205
206
  case 10:
206
207
  _d.sent();
207
- if (streamCanceller.isUsed) {
208
+ if (streamCanceller.isUsed()) {
208
209
  return [2 /*return*/]; // The Stream has since been cancelled
209
210
  }
210
211
  _d.label = 11;
@@ -214,7 +215,7 @@ export default function PeriodStream(_a, callbacks, parentCancelSignal) {
214
215
  case 12:
215
216
  if (strategy.type === "flush-buffer") {
216
217
  callbacks.needsBufferFlush();
217
- if (streamCanceller.isUsed) {
218
+ if (streamCanceller.isUsed()) {
218
219
  return [2 /*return*/]; // Previous callback cancelled the Stream by side-effect
219
220
  }
220
221
  }
@@ -254,7 +255,7 @@ export default function PeriodStream(_a, callbacks, parentCancelSignal) {
254
255
  defaultReason: "Unknown `AdaptationStream` error",
255
256
  });
256
257
  callbacks.warning(formattedError);
257
- if (cancelSignal.isCancelled) {
258
+ if (cancelSignal.isCancelled()) {
258
259
  return; // Previous callback cancelled the Stream by side-effect
259
260
  }
260
261
  return createEmptyAdaptationStream(playbackObserver, wantedBufferAhead, bufferType, { period: period }, callbacks, cancelSignal);
@@ -72,15 +72,15 @@ export default function RepresentationStream(_a, callbacks, parentCancelSignal)
72
72
  var bufferGoal = options.bufferGoal, maxBufferSize = options.maxBufferSize, drmSystemId = options.drmSystemId, fastSwitchThreshold = options.fastSwitchThreshold;
73
73
  var bufferType = adaptation.type;
74
74
  /** `TaskCanceller` stopping ALL operations performed by the `RepresentationStream` */
75
- var globalCanceller = new TaskCanceller({ cancelOn: parentCancelSignal });
75
+ var globalCanceller = new TaskCanceller();
76
+ globalCanceller.linkToSignal(parentCancelSignal);
76
77
  /**
77
78
  * `TaskCanceller` allowing to only stop segment loading and checking operations.
78
79
  * This allows to stop only tasks linked to network resource usage, which is
79
80
  * often a limited resource, while still letting buffer operations to finish.
80
81
  */
81
- var segmentsLoadingCanceller = new TaskCanceller({
82
- cancelOn: globalCanceller.signal,
83
- });
82
+ var segmentsLoadingCanceller = new TaskCanceller();
83
+ segmentsLoadingCanceller.linkToSignal(globalCanceller.signal);
84
84
  /** Saved initialization segment state for this representation. */
85
85
  var initSegmentState = {
86
86
  segment: representation.index.getInitSegment(),
@@ -114,7 +114,7 @@ export default function RepresentationStream(_a, callbacks, parentCancelSignal)
114
114
  if (encryptionData.length > 0 && encryptionData.every(function (e) { return e.keyIds !== undefined; })) {
115
115
  hasSentEncryptionData = true;
116
116
  callbacks.encryptionDataEncountered(encryptionData.map(function (d) { return objectAssign({ content: content }, d); }));
117
- if (globalCanceller.isUsed) {
117
+ if (globalCanceller.isUsed()) {
118
118
  return; // previous callback has stopped everything by side-effect
119
119
  }
120
120
  }
@@ -122,7 +122,7 @@ export default function RepresentationStream(_a, callbacks, parentCancelSignal)
122
122
  /** Will load every segments in `lastSegmentQueue` */
123
123
  var downloadingQueue = new DownloadingQueue(content, lastSegmentQueue, segmentFetcher, hasInitSegment);
124
124
  downloadingQueue.addEventListener("error", function (err) {
125
- if (segmentsLoadingCanceller.signal.isCancelled) {
125
+ if (segmentsLoadingCanceller.signal.isCancelled()) {
126
126
  return; // ignore post requests-cancellation loading-related errors,
127
127
  }
128
128
  globalCanceller.cancel(); // Stop every operations
@@ -133,7 +133,7 @@ export default function RepresentationStream(_a, callbacks, parentCancelSignal)
133
133
  downloadingQueue.addEventListener("emptyQueue", checkStatus);
134
134
  downloadingQueue.addEventListener("requestRetry", function (payload) {
135
135
  callbacks.warning(payload.error);
136
- if (segmentsLoadingCanceller.signal.isCancelled) {
136
+ if (segmentsLoadingCanceller.signal.isCancelled()) {
137
137
  return; // If the previous callback led to loading operations being stopped, skip
138
138
  }
139
139
  var retriedSegment = payload.segment;
@@ -179,7 +179,7 @@ export default function RepresentationStream(_a, callbacks, parentCancelSignal)
179
179
  */
180
180
  function checkStatus() {
181
181
  var _a, _b;
182
- if (segmentsLoadingCanceller.isUsed) {
182
+ if (segmentsLoadingCanceller.isUsed()) {
183
183
  return; // Stop all buffer status checking if load operations are stopped
184
184
  }
185
185
  var observation = playbackObserver.getReference().getValue();
@@ -251,14 +251,14 @@ export default function RepresentationStream(_a, callbacks, parentCancelSignal)
251
251
  isEmptyStream: false,
252
252
  hasFinishedLoading: status.hasFinishedLoading,
253
253
  neededSegments: status.neededSegments });
254
- if (segmentsLoadingCanceller.signal.isCancelled) {
254
+ if (segmentsLoadingCanceller.signal.isCancelled()) {
255
255
  return; // previous callback has stopped loading operations by side-effect
256
256
  }
257
257
  var UPTO_CURRENT_POSITION_CLEANUP = config.getCurrent().UPTO_CURRENT_POSITION_CLEANUP;
258
258
  if (status.isBufferFull) {
259
259
  var gcedPosition = Math.max(0, initialWantedTime - UPTO_CURRENT_POSITION_CLEANUP);
260
260
  if (gcedPosition > 0) {
261
- segmentBuffer.removeBuffer(0, gcedPosition, segmentsLoadingCanceller.signal)
261
+ segmentBuffer.removeBuffer(0, gcedPosition, globalCanceller.signal)
262
262
  .catch(onFatalBufferError);
263
263
  }
264
264
  }
@@ -272,7 +272,7 @@ export default function RepresentationStream(_a, callbacks, parentCancelSignal)
272
272
  * @param {Object} evt
273
273
  */
274
274
  function onParsedChunk(evt) {
275
- if (globalCanceller.isUsed) {
275
+ if (globalCanceller.isUsed()) {
276
276
  // We should not do anything with segments if the `RepresentationStream`
277
277
  // is not running anymore.
278
278
  return;
@@ -309,20 +309,20 @@ export default function RepresentationStream(_a, callbacks, parentCancelSignal)
309
309
  var allEncryptionData = representation.getAllEncryptionData();
310
310
  if (allEncryptionData.length > 0) {
311
311
  callbacks.encryptionDataEncountered(allEncryptionData.map(function (p) { return objectAssign({ content: content }, p); }));
312
- if (globalCanceller.isUsed) {
312
+ if (globalCanceller.isUsed()) {
313
313
  return; // previous callback has stopped everything by side-effect
314
314
  }
315
315
  }
316
316
  }
317
317
  if (needsManifestRefresh === true) {
318
318
  callbacks.needsManifestRefresh();
319
- if (globalCanceller.isUsed) {
319
+ if (globalCanceller.isUsed()) {
320
320
  return; // previous callback has stopped everything by side-effect
321
321
  }
322
322
  }
323
323
  if (inbandEvents !== undefined && inbandEvents.length > 0) {
324
324
  callbacks.inbandEvent(inbandEvents);
325
- if (globalCanceller.isUsed) {
325
+ if (globalCanceller.isUsed()) {
326
326
  return; // previous callback has stopped everything by side-effect
327
327
  }
328
328
  }
@@ -344,7 +344,7 @@ export default function RepresentationStream(_a, callbacks, parentCancelSignal)
344
344
  * @param {*} err
345
345
  */
346
346
  function onFatalBufferError(err) {
347
- if (globalCanceller.isUsed && err instanceof CancellationError) {
347
+ if (globalCanceller.isUsed() && err instanceof CancellationError) {
348
348
  // The error is linked to cancellation AND we explicitely cancelled buffer
349
349
  // operations.
350
350
  // We can thus ignore it, it is very unlikely to lead to true buffer issues.
@@ -79,7 +79,7 @@ export default function appendSegmentToBuffer(playbackObserver, segmentBuffer, d
79
79
  return [3 /*break*/, 8];
80
80
  case 2:
81
81
  appendError_1 = _b.sent();
82
- if (cancellationSignal.isCancelled && appendError_1 instanceof CancellationError) {
82
+ if (cancellationSignal.isCancelled() && appendError_1 instanceof CancellationError) {
83
83
  throw appendError_1;
84
84
  }
85
85
  else if (!(appendError_1 instanceof Error) ||
@@ -31,6 +31,7 @@ var __extends = (this && this.__extends) || (function () {
31
31
  import log from "../../../../log";
32
32
  import assert from "../../../../utils/assert";
33
33
  import EventEmitter from "../../../../utils/event_emitter";
34
+ import noop from "../../../../utils/noop";
34
35
  import objectAssign from "../../../../utils/object_assign";
35
36
  import createSharedReference from "../../../../utils/reference";
36
37
  import TaskCanceller from "../../../../utils/task_canceller";
@@ -171,6 +172,7 @@ var DownloadingQueue = /** @class */ (function (_super) {
171
172
  DownloadingQueue.prototype.stop = function () {
172
173
  var _a;
173
174
  (_a = this._currentCanceller) === null || _a === void 0 ? void 0 : _a.cancel();
175
+ this._currentCanceller = null;
174
176
  };
175
177
  /**
176
178
  * Internal logic performing media segment requests.
@@ -183,8 +185,7 @@ var DownloadingQueue = /** @class */ (function (_super) {
183
185
  var segmentQueue = this._downloadQueue.getValue().segmentQueue;
184
186
  var currentNeededSegment = segmentQueue[0];
185
187
  var recursivelyRequestSegments = function (startingSegment) {
186
- var _a;
187
- if (_this._currentCanceller !== null && _this._currentCanceller.isUsed) {
188
+ if (_this._currentCanceller !== null && _this._currentCanceller.isUsed()) {
188
189
  _this._mediaSegmentRequest = null;
189
190
  return;
190
191
  }
@@ -193,7 +194,10 @@ var DownloadingQueue = /** @class */ (function (_super) {
193
194
  _this.trigger("emptyQueue", null);
194
195
  return;
195
196
  }
196
- var canceller = new TaskCanceller({ cancelOn: (_a = _this._currentCanceller) === null || _a === void 0 ? void 0 : _a.signal });
197
+ var canceller = new TaskCanceller();
198
+ var unlinkCanceller = _this._currentCanceller === null ?
199
+ noop :
200
+ canceller.linkToSignal(_this._currentCanceller.signal);
197
201
  var segment = startingSegment.segment, priority = startingSegment.priority;
198
202
  var context = objectAssign({ segment: segment }, _this._content);
199
203
  /**
@@ -289,6 +293,7 @@ var DownloadingQueue = /** @class */ (function (_super) {
289
293
  * requests are scheduled. It is used to schedule the next segment.
290
294
  */
291
295
  beforeEnded: function () {
296
+ unlinkCanceller();
292
297
  _this._mediaSegmentRequest = null;
293
298
  if (isWaitingOnInitSegment) {
294
299
  _this._initSegmentInfoRef.waitUntilDefined(continueToNextSegment, { clearSignal: canceller.signal });
@@ -299,6 +304,7 @@ var DownloadingQueue = /** @class */ (function (_super) {
299
304
  },
300
305
  }, canceller.signal);
301
306
  request.catch(function (error) {
307
+ unlinkCanceller();
302
308
  if (!isComplete) {
303
309
  isComplete = true;
304
310
  _this.stop();
@@ -315,8 +321,7 @@ var DownloadingQueue = /** @class */ (function (_super) {
315
321
  */
316
322
  DownloadingQueue.prototype._restartInitSegmentDownloadingQueue = function (queuedInitSegment) {
317
323
  var _this = this;
318
- var _a;
319
- if (this._currentCanceller !== null && this._currentCanceller.isUsed) {
324
+ if (this._currentCanceller !== null && this._currentCanceller.isUsed()) {
320
325
  return;
321
326
  }
322
327
  if (this._initSegmentRequest !== null) {
@@ -325,7 +330,10 @@ var DownloadingQueue = /** @class */ (function (_super) {
325
330
  if (queuedInitSegment === null) {
326
331
  return;
327
332
  }
328
- var canceller = new TaskCanceller({ cancelOn: (_a = this._currentCanceller) === null || _a === void 0 ? void 0 : _a.signal });
333
+ var canceller = new TaskCanceller();
334
+ var unlinkCanceller = this._currentCanceller === null ?
335
+ noop :
336
+ canceller.linkToSignal(this._currentCanceller.signal);
329
337
  var segment = queuedInitSegment.segment, priority = queuedInitSegment.priority;
330
338
  var context = objectAssign({ segment: segment }, this._content);
331
339
  /**
@@ -341,6 +349,7 @@ var DownloadingQueue = /** @class */ (function (_super) {
341
349
  log.info("Stream: init segment request interrupted temporarly.", segment.id);
342
350
  },
343
351
  beforeEnded: function () {
352
+ unlinkCanceller();
344
353
  _this._initSegmentRequest = null;
345
354
  isComplete = true;
346
355
  },
@@ -358,6 +367,7 @@ var DownloadingQueue = /** @class */ (function (_super) {
358
367
  },
359
368
  }, canceller.signal);
360
369
  request.catch(function (error) {
370
+ unlinkCanceller();
361
371
  if (!isComplete) {
362
372
  isComplete = true;
363
373
  _this.stop();
@@ -0,0 +1,8 @@
1
+ import { IFeaturesObject } from "../../features/types";
2
+ /**
3
+ * Add ability to parse SAMI text tracks in an HTML textrack mode.
4
+ * @param {Object} features
5
+ */
6
+ declare function addDebugElementFeature(features: IFeaturesObject): void;
7
+ export { addDebugElementFeature as DEBUG_ELEMENT };
8
+ export default addDebugElementFeature;
@@ -0,0 +1,10 @@
1
+ import createDebugElement from "../../core/api/debug";
2
+ /**
3
+ * Add ability to parse SAMI text tracks in an HTML textrack mode.
4
+ * @param {Object} features
5
+ */
6
+ function addDebugElementFeature(features) {
7
+ features.createDebugElement = createDebugElement;
8
+ }
9
+ export { addDebugElementFeature as DEBUG_ELEMENT };
10
+ export default addDebugElementFeature;
@@ -14,5 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export { DASH_WASM } from "./dash_wasm";
17
+ export { DEBUG_ELEMENT } from "./debug_element";
17
18
  export { LOCAL_MANIFEST } from "./local";
18
19
  export { METAPLAYLIST } from "./metaplaylist";
@@ -14,5 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export { DASH_WASM } from "./dash_wasm";
17
+ export { DEBUG_ELEMENT } from "./debug_element";
17
18
  export { LOCAL_MANIFEST } from "./local";
18
19
  export { METAPLAYLIST } from "./metaplaylist";
@@ -17,6 +17,7 @@ import { MediaSource_ } from "../../../compat";
17
17
  import { resetMediaSource } from "../../../core/init/utils/create_media_source";
18
18
  import { AudioVideoSegmentBuffer } from "../../../core/segment_buffers/implementations";
19
19
  import log from "../../../log";
20
+ import createCancellablePromise from "../../../utils/create_cancellable_promise";
20
21
  import isNonEmptyString from "../../../utils/is_non_empty_string";
21
22
  /**
22
23
  * Open the media source and create the `AudioVideoSegmentBuffer`.
@@ -26,7 +27,7 @@ import isNonEmptyString from "../../../utils/is_non_empty_string";
26
27
  * @returns {Promise.<Object>}
27
28
  */
28
29
  export default function prepareSourceBuffer(videoElement, codec, cleanUpSignal) {
29
- return new Promise(function (resolve, reject) {
30
+ return createCancellablePromise(cleanUpSignal, function (resolve, reject) {
30
31
  if (MediaSource_ == null) {
31
32
  throw new Error("No MediaSource Object was found in the current browser.");
32
33
  }
@@ -39,13 +40,15 @@ export default function prepareSourceBuffer(videoElement, codec, cleanUpSignal)
39
40
  var objectURL = URL.createObjectURL(mediaSource);
40
41
  log.info("Init: Attaching MediaSource URL to the media element", objectURL);
41
42
  videoElement.src = objectURL;
43
+ cleanUpSignal.register(function () {
44
+ resetMediaSource(videoElement, mediaSource, objectURL);
45
+ });
42
46
  mediaSource.addEventListener("sourceopen", onSourceOpen);
43
47
  mediaSource.addEventListener("webkitsourceopen", onSourceOpen);
44
- cleanUpSignal.register(function () {
48
+ return function () {
45
49
  mediaSource.removeEventListener("sourceopen", onSourceOpen);
46
50
  mediaSource.removeEventListener("webkitsourceopen", onSourceOpen);
47
- resetMediaSource(videoElement, mediaSource, objectURL);
48
- });
51
+ };
49
52
  function onSourceOpen() {
50
53
  try {
51
54
  mediaSource.removeEventListener("sourceopen", onSourceOpen);
@@ -229,11 +229,12 @@ var VideoThumbnailLoader = /** @class */ (function () {
229
229
  promises.push(pending_1.promise);
230
230
  }
231
231
  else {
232
- var requestCanceller = new TaskCanceller({
233
- cancelOn: lastRepInfo.cleaner.signal,
234
- });
232
+ var requestCanceller = new TaskCanceller();
233
+ var unlinkSignal = requestCanceller
234
+ .linkToSignal(lastRepInfo.cleaner.signal);
235
235
  var segmentInfo = objectAssign({ segment: segment }, content);
236
- var prom = loadAndPushSegment(segmentInfo, segmentBuffer, lastRepInfo.segmentFetcher, requestCanceller.signal);
236
+ var prom = loadAndPushSegment(segmentInfo, segmentBuffer, lastRepInfo.segmentFetcher, requestCanceller.signal)
237
+ .finally(unlinkSignal);
237
238
  var newReq_1 = {
238
239
  segmentId: segment.id,
239
240
  canceller: requestCanceller,
@@ -19,6 +19,7 @@
19
19
  */
20
20
  var features = { dashParsers: { wasm: null,
21
21
  js: null },
22
+ createDebugElement: null,
22
23
  directfile: null,
23
24
  ContentDecryptor: null,
24
25
  htmlTextTracksBuffer: null,
@@ -32,10 +32,10 @@ export default function initializeFeaturesObject() {
32
32
  features.imageParser = require("../parsers/images/bif.ts").default;
33
33
  }
34
34
  // Feature switching the Native TextTrack implementation
35
- var HAS_NATIVE_MODE = 0 /* __FEATURES__.NATIVE_VTT */ ||
36
- 0 /* __FEATURES__.NATIVE_SAMI */ ||
37
- 0 /* __FEATURES__.NATIVE_TTML */ ||
38
- 0 /* __FEATURES__.NATIVE_SRT */;
35
+ var HAS_NATIVE_MODE = 0 /* __FEATURES__.NATIVE_VTT */ === 1 /* __FEATURES__.IS_ENABLED */ ||
36
+ 0 /* __FEATURES__.NATIVE_SAMI */ === 1 /* __FEATURES__.IS_ENABLED */ ||
37
+ 0 /* __FEATURES__.NATIVE_TTML */ === 1 /* __FEATURES__.IS_ENABLED */ ||
38
+ 0 /* __FEATURES__.NATIVE_SRT */ === 1 /* __FEATURES__.IS_ENABLED */;
39
39
  if (0 /* __FEATURES__.SMOOTH */ === 1 /* __FEATURES__.IS_ENABLED */) {
40
40
  features.transports.smooth = require("../transports/smooth/index.ts").default;
41
41
  }
@@ -51,7 +51,10 @@ export default function initializeFeaturesObject() {
51
51
  features.transports.metaplaylist =
52
52
  require("../transports/metaplaylist/index.ts").default;
53
53
  }
54
- if (HAS_NATIVE_MODE === 1 /* __FEATURES__.IS_ENABLED */) {
54
+ if (0 /* __FEATURES__.DEBUG_ELEMENT */ === 1 /* __FEATURES__.IS_ENABLED */) {
55
+ features.createDebugElement = require("../core/api/debug/index.ts").default;
56
+ }
57
+ if (HAS_NATIVE_MODE) {
55
58
  features.nativeTextTracksBuffer =
56
59
  require("../core/segment_buffers/implementations/text/native/index.ts").default;
57
60
  if (0 /* __FEATURES__.NATIVE_VTT */ === 1 /* __FEATURES__.IS_ENABLED */) {
@@ -72,11 +75,11 @@ export default function initializeFeaturesObject() {
72
75
  }
73
76
  }
74
77
  // Feature switching the HTML TextTrack implementation
75
- var HAS_HTML_MODE = 0 /* __FEATURES__.HTML_VTT */ ||
76
- 0 /* __FEATURES__.HTML_SAMI */ ||
77
- 0 /* __FEATURES__.HTML_TTML */ ||
78
- 0 /* __FEATURES__.HTML_SRT */;
79
- if (HAS_HTML_MODE === 1 /* __FEATURES__.IS_ENABLED */) {
78
+ var HAS_HTML_MODE = 0 /* __FEATURES__.HTML_VTT */ === 1 /* __FEATURES__.IS_ENABLED */ ||
79
+ 0 /* __FEATURES__.HTML_SAMI */ === 1 /* __FEATURES__.IS_ENABLED */ ||
80
+ 0 /* __FEATURES__.HTML_TTML */ === 1 /* __FEATURES__.IS_ENABLED */ ||
81
+ 0 /* __FEATURES__.HTML_SRT */ === 1 /* __FEATURES__.IS_ENABLED */;
82
+ if (HAS_HTML_MODE) {
80
83
  features.htmlTextTracksBuffer =
81
84
  require("../core/segment_buffers/implementations/text/html/index.ts").default;
82
85
  if (0 /* __FEATURES__.HTML_SAMI */ === 1 /* __FEATURES__.IS_ENABLED */) {
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import RxPlayer from "../core/api";
16
17
  import MediaElementTrackChoiceManager from "../core/api/tracks_management/media_element_track_choice_manager";
17
18
  import type ContentDecryptor from "../core/decrypt";
18
19
  import DirectFileContentInitializer from "../core/init/directfile_content_initializer";
@@ -21,6 +22,7 @@ import { IDashParserResponse, IMPDParserArguments } from "../parsers/manifest/da
21
22
  import DashWasmParser from "../parsers/manifest/dash/wasm-parser";
22
23
  import { IHTMLTextTracksParserFn, INativeTextTracksParserFn } from "../parsers/texttracks";
23
24
  import { ITransportFunction } from "../transports";
25
+ import { CancellationSignal } from "../utils/task_canceller";
24
26
  export type IDirectFileInit = typeof DirectFileContentInitializer;
25
27
  export type IContentDecryptorClass = typeof ContentDecryptor;
26
28
  export type IHTMLTextTracksBuffer = new (mediaElement: HTMLMediaElement, textTrackElement: HTMLElement) => SegmentBuffer;
@@ -53,6 +55,7 @@ export interface IFeaturesObject {
53
55
  mediaElementTrackChoiceManager: IMediaElementTrackChoiceManager;
54
56
  } | null;
55
57
  ContentDecryptor: IContentDecryptorClass | null;
58
+ createDebugElement: ((parentElt: HTMLElement, instance: RxPlayer, cancelSignal: CancellationSignal) => void) | null;
56
59
  htmlTextTracksBuffer: IHTMLTextTracksBuffer | null;
57
60
  htmlTextTracksParsers: Partial<Record<string, IHTMLTextTracksParserFn>>;
58
61
  imageBuffer: IImageBuffer | null;
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import log from "../log";
16
17
  import arrayFind from "../utils/array_find";
17
18
  import isNullOrUndefined from "../utils/is_null_or_undefined";
18
19
  import normalizeLanguage from "../utils/languages";
@@ -91,6 +92,9 @@ var Adaptation = /** @class */ (function () {
91
92
  isSupported = true;
92
93
  }
93
94
  }
95
+ else {
96
+ log.debug("Filtering Representation due to representationFilter", this.type, "Adaptation: ".concat(this.id), "Representation: ".concat(representation.id), "(".concat(representation.bitrate, ")"));
97
+ }
94
98
  }
95
99
  representations.sort(function (a, b) { return a.bitrate - b.bitrate; });
96
100
  this.representations = representations;
@@ -29,6 +29,7 @@ var __extends = (this && this.__extends) || (function () {
29
29
  };
30
30
  })();
31
31
  import { MediaError } from "../errors";
32
+ import log from "../log";
32
33
  import arrayFind from "../utils/array_find";
33
34
  import EventEmitter from "../utils/event_emitter";
34
35
  import idGenerator from "../utils/id_generator";
@@ -477,6 +478,7 @@ function updateDeciperability(manifest, isDecipherable) {
477
478
  var result = isDecipherable(representation);
478
479
  if (result !== representation.decipherable) {
479
480
  updates.push({ manifest: manifest, period: period, adaptation: adaptation, representation: representation });
481
+ log.debug("Decipherability changed for \"".concat(representation.id, "\""), "(".concat(representation.bitrate, ")"), String(representation.decipherable));
480
482
  representation.decipherable = result;
481
483
  }
482
484
  }
@@ -48,10 +48,17 @@ var Representation = /** @class */ (function () {
48
48
  }
49
49
  this.cdnMetadata = args.cdnMetadata;
50
50
  this.index = args.index;
51
- this.isSupported = opts.type === "audio" ||
52
- opts.type === "video" ?
53
- isCodecSupported(this.getMimeTypeString()) :
54
- true; // TODO for other types
51
+ if (opts.type === "audio" || opts.type === "video") {
52
+ var mimeTypeStr = this.getMimeTypeString();
53
+ var isSupported = isCodecSupported(mimeTypeStr);
54
+ if (!isSupported) {
55
+ log.info("Unsupported Representation", mimeTypeStr, this.id, this.bitrate);
56
+ }
57
+ this.isSupported = isSupported;
58
+ }
59
+ else {
60
+ this.isSupported = true; // TODO for other types
61
+ }
55
62
  }
56
63
  /**
57
64
  * Returns "mime-type string" which includes both the mime-type and the codec,