rx-player 4.2.0-dev.2024092400 → 4.2.0-dev.2024101500

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 (105) hide show
  1. package/.vscode/settings.json +9 -0
  2. package/CHANGELOG.md +22 -3
  3. package/VERSION +1 -1
  4. package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
  5. package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
  6. package/dist/commonjs/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
  7. package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
  8. package/dist/commonjs/core/main/worker/worker_main.d.ts.map +1 -1
  9. package/dist/commonjs/core/main/worker/worker_main.js +3 -0
  10. package/dist/commonjs/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
  11. package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
  12. package/dist/commonjs/core/stream/adaptation/adaptation_stream.js +15 -0
  13. package/dist/commonjs/core/stream/representation/representation_stream.d.ts.map +1 -1
  14. package/dist/commonjs/core/stream/representation/representation_stream.js +2 -0
  15. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.d.ts.map +1 -1
  16. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.js +85 -8
  17. package/dist/commonjs/main_thread/api/debug/modules/general_info.js +1 -1
  18. package/dist/commonjs/main_thread/api/public_api.js +2 -2
  19. package/dist/commonjs/main_thread/decrypt/find_key_system.d.ts.map +1 -1
  20. package/dist/commonjs/main_thread/decrypt/find_key_system.js +3 -0
  21. package/dist/commonjs/main_thread/init/directfile_content_initializer.d.ts.map +1 -1
  22. package/dist/commonjs/main_thread/init/directfile_content_initializer.js +14 -6
  23. package/dist/commonjs/main_thread/init/media_source_content_initializer.d.ts +11 -1
  24. package/dist/commonjs/main_thread/init/media_source_content_initializer.d.ts.map +1 -1
  25. package/dist/commonjs/main_thread/init/media_source_content_initializer.js +23 -11
  26. package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts +15 -1
  27. package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
  28. package/dist/commonjs/main_thread/init/multi_thread_content_initializer.js +103 -50
  29. package/dist/commonjs/main_thread/init/utils/initial_seek_and_play.d.ts +1 -1
  30. package/dist/commonjs/main_thread/init/utils/initial_seek_and_play.d.ts.map +1 -1
  31. package/dist/commonjs/main_thread/init/utils/initial_seek_and_play.js +21 -5
  32. package/dist/commonjs/main_thread/text_displayer/native/native_text_displayer.d.ts +1 -0
  33. package/dist/commonjs/main_thread/text_displayer/native/native_text_displayer.d.ts.map +1 -1
  34. package/dist/commonjs/main_thread/text_displayer/native/native_text_displayer.js +19 -16
  35. package/dist/commonjs/mse/main_media_source_interface.d.ts.map +1 -1
  36. package/dist/commonjs/mse/main_media_source_interface.js +21 -2
  37. package/dist/commonjs/transports/smooth/pipelines.d.ts.map +1 -1
  38. package/dist/commonjs/transports/smooth/pipelines.js +1 -0
  39. package/dist/commonjs/transports/utils/parse_text_track.d.ts.map +1 -1
  40. package/dist/commonjs/transports/utils/parse_text_track.js +1 -0
  41. package/dist/commonjs/utils/sync_or_async.d.ts.map +1 -1
  42. package/dist/commonjs/utils/sync_or_async.js +3 -1
  43. package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
  44. package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
  45. package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
  46. package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
  47. package/dist/es2017/core/main/worker/worker_main.d.ts.map +1 -1
  48. package/dist/es2017/core/main/worker/worker_main.js +3 -0
  49. package/dist/es2017/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
  50. package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
  51. package/dist/es2017/core/stream/adaptation/adaptation_stream.js +15 -0
  52. package/dist/es2017/core/stream/representation/representation_stream.d.ts.map +1 -1
  53. package/dist/es2017/core/stream/representation/representation_stream.js +2 -0
  54. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.d.ts.map +1 -1
  55. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.js +36 -7
  56. package/dist/es2017/main_thread/api/debug/modules/general_info.js +1 -1
  57. package/dist/es2017/main_thread/api/public_api.js +2 -2
  58. package/dist/es2017/main_thread/decrypt/find_key_system.d.ts.map +1 -1
  59. package/dist/es2017/main_thread/decrypt/find_key_system.js +3 -0
  60. package/dist/es2017/main_thread/init/directfile_content_initializer.d.ts.map +1 -1
  61. package/dist/es2017/main_thread/init/directfile_content_initializer.js +14 -6
  62. package/dist/es2017/main_thread/init/media_source_content_initializer.d.ts +11 -1
  63. package/dist/es2017/main_thread/init/media_source_content_initializer.d.ts.map +1 -1
  64. package/dist/es2017/main_thread/init/media_source_content_initializer.js +23 -11
  65. package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts +15 -1
  66. package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
  67. package/dist/es2017/main_thread/init/multi_thread_content_initializer.js +87 -46
  68. package/dist/es2017/main_thread/init/utils/initial_seek_and_play.d.ts +1 -1
  69. package/dist/es2017/main_thread/init/utils/initial_seek_and_play.d.ts.map +1 -1
  70. package/dist/es2017/main_thread/init/utils/initial_seek_and_play.js +19 -3
  71. package/dist/es2017/main_thread/text_displayer/native/native_text_displayer.d.ts +1 -0
  72. package/dist/es2017/main_thread/text_displayer/native/native_text_displayer.d.ts.map +1 -1
  73. package/dist/es2017/main_thread/text_displayer/native/native_text_displayer.js +19 -16
  74. package/dist/es2017/mse/main_media_source_interface.d.ts.map +1 -1
  75. package/dist/es2017/mse/main_media_source_interface.js +19 -0
  76. package/dist/es2017/transports/smooth/pipelines.d.ts.map +1 -1
  77. package/dist/es2017/transports/smooth/pipelines.js +1 -0
  78. package/dist/es2017/transports/utils/parse_text_track.d.ts.map +1 -1
  79. package/dist/es2017/transports/utils/parse_text_track.js +1 -0
  80. package/dist/es2017/utils/sync_or_async.d.ts.map +1 -1
  81. package/dist/es2017/utils/sync_or_async.js +3 -1
  82. package/dist/mpd-parser.wasm +0 -0
  83. package/dist/rx-player.js +104 -41
  84. package/dist/rx-player.min.js +17 -17
  85. package/dist/worker.js +5 -5
  86. package/package.json +19 -7
  87. package/src/__GENERATED_CODE/embedded_dash_wasm.ts +1 -1
  88. package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
  89. package/src/core/main/worker/worker_main.ts +3 -0
  90. package/src/core/segment_sinks/segment_buffers_store.ts +6 -2
  91. package/src/core/stream/adaptation/adaptation_stream.ts +23 -1
  92. package/src/core/stream/representation/representation_stream.ts +11 -0
  93. package/src/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.ts +39 -7
  94. package/src/main_thread/api/debug/modules/general_info.ts +1 -1
  95. package/src/main_thread/api/public_api.ts +2 -2
  96. package/src/main_thread/decrypt/find_key_system.ts +3 -0
  97. package/src/main_thread/init/directfile_content_initializer.ts +20 -10
  98. package/src/main_thread/init/media_source_content_initializer.ts +50 -17
  99. package/src/main_thread/init/multi_thread_content_initializer.ts +109 -50
  100. package/src/main_thread/init/utils/initial_seek_and_play.ts +24 -5
  101. package/src/main_thread/text_displayer/native/native_text_displayer.ts +22 -18
  102. package/src/mse/main_media_source_interface.ts +20 -0
  103. package/src/transports/smooth/pipelines.ts +1 -0
  104. package/src/transports/utils/parse_text_track.ts +1 -0
  105. package/src/utils/sync_or_async.ts +5 -3
@@ -158,24 +158,7 @@ export default class NativeTextDisplayer implements ITextDisplayer {
158
158
  public reset(): void {
159
159
  log.debug("NTD: Aborting NativeTextDisplayer");
160
160
  this._removeData(0, Infinity);
161
- const { _trackElement, _videoElement } = this;
162
-
163
- if (_trackElement !== undefined && _videoElement.hasChildNodes()) {
164
- try {
165
- _videoElement.removeChild(_trackElement);
166
- } catch (_e) {
167
- log.warn("NTD: Can't remove track element from the video");
168
- }
169
- }
170
-
171
- // Ugly trick to work-around browser bugs by refreshing its mode
172
- const oldMode = this._track.mode;
173
- this._track.mode = "disabled";
174
- this._track.mode = oldMode;
175
-
176
- if (this._trackElement !== undefined) {
177
- this._trackElement.innerHTML = "";
178
- }
161
+ this._clearTrackElement();
179
162
  }
180
163
 
181
164
  public stop(): void {
@@ -213,6 +196,27 @@ export default class NativeTextDisplayer implements ITextDisplayer {
213
196
  }
214
197
  this._buffered.remove(start, end);
215
198
  }
199
+
200
+ private _clearTrackElement(): void {
201
+ const { _trackElement, _videoElement } = this;
202
+
203
+ if (_trackElement !== undefined && _videoElement.hasChildNodes()) {
204
+ try {
205
+ _videoElement.removeChild(_trackElement);
206
+ } catch (_e) {
207
+ log.warn("NTD: Can't remove track element from the video");
208
+ }
209
+ }
210
+
211
+ // Ugly trick to work-around browser bugs by refreshing its mode
212
+ const oldMode = this._track.mode;
213
+ this._track.mode = "disabled";
214
+ this._track.mode = oldMode;
215
+
216
+ if (this._trackElement !== undefined) {
217
+ this._trackElement.innerHTML = "";
218
+ }
219
+ }
216
220
  }
217
221
 
218
222
  /** Data of chunks that should be pushed to the NativeTextDisplayer. */
@@ -464,6 +464,20 @@ export class MainSourceBufferInterface implements ISourceBufferInterface {
464
464
  op.reject(error);
465
465
  });
466
466
  this._currentOperations = [];
467
+
468
+ // A synchronous error probably will not lead to updateend event, so we need to
469
+ // go to next queue element manually
470
+ //
471
+ // FIXME: This here is needed to ensure that we're not left with a
472
+ // dangling queue of operations.
473
+ // However it can potentially be counter-productive if e.g. the `appendBuffer`
474
+ // error was due to a full buffer and if there are pushing operations awaiting in
475
+ // the queue.
476
+ //
477
+ // A better solution might just be to reject all push operations right away here?
478
+ // Only for a `QuotaExceededError` (to check MSE)?
479
+ // However this is too disruptive for what is now a hotfix
480
+ this._performNextOperation();
467
481
  }
468
482
  } else {
469
483
  // TODO merge contiguous removes?
@@ -482,7 +496,13 @@ export class MainSourceBufferInterface implements ISourceBufferInterface {
482
496
  false,
483
497
  );
484
498
  nextElem.reject(error);
499
+ this._currentOperations.forEach((op) => {
500
+ op.reject(error);
501
+ });
485
502
  this._currentOperations = [];
503
+ // A synchronous error probably will not lead to updateend event, so we need to
504
+ // go to next queue element manually
505
+ this._performNextOperation();
486
506
  }
487
507
  }
488
508
  }
@@ -350,6 +350,7 @@ export default function (transportOptions: ITransportOptions): ITransportPipelin
350
350
  if (
351
351
  mimeType === "application/ttml+xml+mp4" ||
352
352
  lcCodec === "stpp" ||
353
+ lcCodec === "stpp.ttml" ||
353
354
  lcCodec === "stpp.ttml.im1t"
354
355
  ) {
355
356
  _sdType = "ttml";
@@ -42,6 +42,7 @@ export function getISOBMFFTextTrackFormat(codecs: string | undefined): "ttml" |
42
42
  }
43
43
  switch (codecs.toLowerCase()) {
44
44
  case "stpp": // stpp === TTML in MP4
45
+ case "stpp.ttml":
45
46
  case "stpp.ttml.im1t":
46
47
  return "ttml";
47
48
  case "wvtt": // wvtt === WebVTT in MP4
@@ -78,12 +78,14 @@ const SyncOrAsync = {
78
78
  * @returns {Object}
79
79
  */
80
80
  createAsync<T>(val: Promise<T>): ISyncOrAsyncValue<T> {
81
- let ret = null;
82
- val.then((resolved) => {
81
+ let ret: T | null = null;
82
+ val.then((resolved: T) => {
83
83
  ret = resolved;
84
84
  }, noop);
85
85
  return {
86
- syncValue: ret,
86
+ get syncValue(): T | null {
87
+ return ret;
88
+ },
87
89
  getValueAsAsync() {
88
90
  return val;
89
91
  },