rx-player 4.5.0-dev.2026021900 → 4.5.0-dev.2026031700

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 (100) hide show
  1. package/CHANGELOG.md +13 -3
  2. package/VERSION +1 -1
  3. package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
  4. package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
  5. package/dist/commonjs/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
  6. package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
  7. package/dist/commonjs/core/cmcd/cmcd_data_builder.js +2 -2
  8. package/dist/commonjs/core/entry/content_preparer.d.ts +1 -6
  9. package/dist/commonjs/core/entry/content_preparer.d.ts.map +1 -1
  10. package/dist/commonjs/core/entry/content_preparer.js +2 -125
  11. package/dist/commonjs/core/entry/core_entry.d.ts +1 -1
  12. package/dist/commonjs/core/entry/core_entry.d.ts.map +1 -1
  13. package/dist/commonjs/core/entry/core_entry.js +2 -7
  14. package/dist/commonjs/core/entry/core_text_displayer_interface.d.ts.map +1 -1
  15. package/dist/commonjs/core/entry/core_text_displayer_interface.js +3 -1
  16. package/dist/commonjs/core/entry/index.d.ts +1 -1
  17. package/dist/commonjs/core/entry/index.d.ts.map +1 -1
  18. package/dist/commonjs/core/entry/utils.d.ts +64 -0
  19. package/dist/commonjs/core/entry/utils.d.ts.map +1 -1
  20. package/dist/commonjs/core/entry/utils.js +165 -0
  21. package/dist/commonjs/core/fetchers/segment/segment_queue.d.ts +5 -6
  22. package/dist/commonjs/core/fetchers/segment/segment_queue.d.ts.map +1 -1
  23. package/dist/commonjs/core/fetchers/thumbnails/thumbnail_fetcher.d.ts.map +1 -1
  24. package/dist/commonjs/core/fetchers/thumbnails/thumbnail_fetcher.js +34 -30
  25. package/dist/commonjs/experimental/features/worker/index.d.ts +2 -1
  26. package/dist/commonjs/experimental/features/worker/index.d.ts.map +1 -1
  27. package/dist/commonjs/experimental/features/worker/index.js +4 -3
  28. package/dist/commonjs/main_thread/api/public_api.js +3 -3
  29. package/dist/commonjs/parsers/texttracks/ttml/html/apply_line_height.d.ts.map +1 -1
  30. package/dist/commonjs/parsers/texttracks/ttml/html/apply_line_height.js +16 -1
  31. package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
  32. package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
  33. package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
  34. package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
  35. package/dist/es2017/core/cmcd/cmcd_data_builder.js +2 -2
  36. package/dist/es2017/core/entry/content_preparer.d.ts +1 -6
  37. package/dist/es2017/core/entry/content_preparer.d.ts.map +1 -1
  38. package/dist/es2017/core/entry/content_preparer.js +1 -76
  39. package/dist/es2017/core/entry/core_entry.d.ts +1 -1
  40. package/dist/es2017/core/entry/core_entry.d.ts.map +1 -1
  41. package/dist/es2017/core/entry/core_entry.js +2 -7
  42. package/dist/es2017/core/entry/core_text_displayer_interface.d.ts.map +1 -1
  43. package/dist/es2017/core/entry/core_text_displayer_interface.js +3 -1
  44. package/dist/es2017/core/entry/index.d.ts +1 -1
  45. package/dist/es2017/core/entry/index.d.ts.map +1 -1
  46. package/dist/es2017/core/entry/utils.d.ts +64 -0
  47. package/dist/es2017/core/entry/utils.d.ts.map +1 -1
  48. package/dist/es2017/core/entry/utils.js +98 -0
  49. package/dist/es2017/core/fetchers/segment/segment_queue.d.ts +5 -6
  50. package/dist/es2017/core/fetchers/segment/segment_queue.d.ts.map +1 -1
  51. package/dist/es2017/core/fetchers/thumbnails/thumbnail_fetcher.d.ts.map +1 -1
  52. package/dist/es2017/core/fetchers/thumbnails/thumbnail_fetcher.js +21 -16
  53. package/dist/es2017/experimental/features/worker/index.d.ts +2 -1
  54. package/dist/es2017/experimental/features/worker/index.d.ts.map +1 -1
  55. package/dist/es2017/experimental/features/worker/index.js +2 -3
  56. package/dist/es2017/main_thread/api/public_api.js +3 -3
  57. package/dist/es2017/parsers/texttracks/ttml/html/apply_line_height.d.ts.map +1 -1
  58. package/dist/es2017/parsers/texttracks/ttml/html/apply_line_height.js +16 -1
  59. package/dist/mpd-parser.wasm +0 -0
  60. package/dist/worker.js +8 -8
  61. package/package.json +19 -22
  62. package/src/__GENERATED_CODE/embedded_dash_wasm.ts +1 -1
  63. package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
  64. package/src/core/adaptive/__tests__/adaptive_representation_selector.test.ts +734 -0
  65. package/src/core/adaptive/__tests__/guess_based_chooser.test.ts +5 -2
  66. package/src/core/adaptive/utils/__tests__/bandwidth_estimator.test.ts +117 -0
  67. package/src/core/adaptive/utils/__tests__/last_estimate_storage.test.ts +76 -0
  68. package/src/core/adaptive/utils/__tests__/pending_requests_store.test.ts +5 -2
  69. package/src/core/adaptive/utils/__tests__/representation_score_calculator.test.ts +4 -2
  70. package/src/core/cmcd/__tests__/cmcd_data_builder.test.ts +464 -0
  71. package/src/core/cmcd/cmcd_data_builder.ts +2 -2
  72. package/src/core/entry/__tests__/FreezeResolver.test.ts +1 -1
  73. package/src/core/entry/__tests__/content_time_boundaries_observer.test.ts +1 -2
  74. package/src/core/entry/__tests__/core_text_displayer_interface.test.ts +205 -0
  75. package/src/core/entry/__tests__/get_buffered_data_per_media_buffer.test.ts +95 -0
  76. package/src/core/entry/__tests__/track_choice_setter.test.ts +288 -0
  77. package/src/core/entry/__tests__/utils.test.ts +309 -0
  78. package/src/core/entry/content_preparer.ts +7 -118
  79. package/src/core/entry/core_entry.ts +7 -14
  80. package/src/core/entry/core_text_displayer_interface.ts +3 -1
  81. package/src/core/entry/index.ts +1 -1
  82. package/src/core/entry/utils.ts +151 -0
  83. package/src/core/fetchers/__tests__/cdn_prioritizer.test.ts +166 -0
  84. package/src/core/fetchers/manifest/__tests__/manifest_fetcher.test.ts +803 -0
  85. package/src/core/fetchers/segment/__tests__/segment_fetcher.test.ts +872 -0
  86. package/src/core/fetchers/segment/__tests__/segment_queue.test.ts +557 -0
  87. package/src/core/fetchers/segment/segment_queue.ts +5 -6
  88. package/src/core/fetchers/thumbnails/__tests__/thumbnail_fetcher.test.ts +435 -0
  89. package/src/core/fetchers/thumbnails/thumbnail_fetcher.ts +28 -20
  90. package/src/core/fetchers/utils/__tests__/schedule_request.test.ts +331 -0
  91. package/src/core/stream/adaptation/__tests__/get_representations_switch_strategy.test.ts +4 -3
  92. package/src/core/stream/representation/utils/__tests__/append_segment_to_buffer.test.ts +1 -1
  93. package/src/core/stream/representation/utils/__tests__/get_segment_priority.test.ts +1 -1
  94. package/src/core/stream/representation/utils/__tests__/push_init_segment.test.ts +1 -1
  95. package/src/core/stream/representation/utils/__tests__/push_media_segment.test.ts +1 -1
  96. package/src/experimental/features/worker/index.ts +2 -4
  97. package/src/main_thread/api/public_api.ts +3 -3
  98. package/src/mse/__tests__/main_media_source_interface.test.ts +846 -0
  99. package/src/parsers/texttracks/ttml/html/apply_line_height.ts +16 -1
  100. package/src/utils/__tests__/base64.test.ts +159 -191
@@ -271,14 +271,14 @@ export default class CmcdDataBuilder {
271
271
  const val = props[prop];
272
272
  if (val !== undefined) {
273
273
  const formatted = `"${val.replace("\\", "\\\\").replace('"', '\\"')}"`;
274
- const toAdd = `prop=${formatted},`;
274
+ const toAdd = `${prop}=${formatted},`;
275
275
  addPayload(toAdd, headerName);
276
276
  }
277
277
  };
278
278
  const addTokenProperty = (prop, headerName) => {
279
279
  const val = props[prop];
280
280
  if (val !== undefined) {
281
- const toAdd = `prop=${val},`;
281
+ const toAdd = `${prop}=${val},`;
282
282
  addPayload(toAdd, headerName);
283
283
  }
284
284
  };
@@ -1,7 +1,6 @@
1
1
  import type { IContentInitializationData } from "../../main_thread/types";
2
2
  import type { IManifest } from "../../manifest";
3
3
  import type { IMediaSourceInterface } from "../../mse";
4
- import type { IRepresentationFilter, ISegmentLoader, IManifestLoader } from "../../public_types";
5
4
  import type { IRepresentationEstimator } from "../adaptive";
6
5
  import type { IRepresentationEstimatorThrottlers } from "../adaptive/adaptive_representation_selector";
7
6
  import CmcdDataBuilder from "../cmcd";
@@ -13,6 +12,7 @@ import type { ICoreMessage } from "../types";
13
12
  import CoreTextDisplayerInterface from "./core_text_displayer_interface";
14
13
  import FreezeResolver from "./FreezeResolver";
15
14
  import TrackChoiceSetter from "./track_choice_setter";
15
+ import type { ICorePlugins } from "./utils";
16
16
  /**
17
17
  * Class facilitating the workflows behind loading a new content for the
18
18
  * RxPlayer Core:
@@ -186,9 +186,4 @@ export interface IPreparedContentData {
186
186
  */
187
187
  useMseInWorker: boolean;
188
188
  }
189
- export interface ICorePlugins {
190
- representationFilters: Map<string, IRepresentationFilter>;
191
- segmentLoaders: Map<string, ISegmentLoader>;
192
- manifestLoaders: Map<string, IManifestLoader>;
193
- }
194
189
  //# sourceMappingURL=content_preparer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"content_preparer.d.ts","sourceRoot":"","sources":["../../../../src/core/entry/content_preparer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAGvD,OAAO,KAAK,EAEV,qBAAqB,EACrB,cAAc,EACd,eAAe,EAChB,MAAM,oBAAoB,CAAC;AAK5B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,8CAA8C,CAAC;AACvG,OAAO,eAAe,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGnE,OAAO,KAAK,EAAE,iBAAiB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AM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,eAAe,EAAE,eAAe,GAAG,IAAI,CAAC;IACxC;;;;OAIG;IACH,6BAA6B,EAAE,OAAO,CAAC;IACvC;;;OAGG;IACH,WAAW,EAAE,qBAAqB,CAAC;IACnC,0DAA0D;IAC1D,eAAe,EAAE,eAAe,CAAC;IACjC;;;;OAIG;IACH,QAAQ,EAAE,SAAS,GAAG,IAAI,CAAC;IAC3B;;;OAGG;IACH,cAAc,EAAE,cAAc,CAAC;IAC/B;;;OAGG;IACH,uBAAuB,EAAE,wBAAwB,CAAC;IAClD;;;OAGG;IACH,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,kEAAkE;IAClE,cAAc,EAAE,0BAA0B,GAAG,IAAI,CAAC;IAClD;;;OAGG;IACH,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,uCAAuC;IACvC,kBAAkB,EAAE,iBAAiB,CAAC;IACtC;;;OAGG;IACH,iBAAiB,EAAE,iBAAiB,CAAC;IACrC;;;;OAIG;IACH,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,qBAAqB,EAAE,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAC1D,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC5C,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAC/C"}
1
+ {"version":3,"file":"content_preparer.d.ts","sourceRoot":"","sources":["../../../../src/core/entry/content_preparer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAOvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,M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vD;;;;;;OAMG;IACI,uBAAuB,CAAC,QAAQ,EAAE,wBAAwB,GAAG,IAAI;IAIxE;;;;;;;;OAQG;IACI,iBAAiB,CACtB,WAAW,EAAE,CAAC,GAAG,EAAE,YAAY,EAAE,aAAa,CAAC,EAAE,YAAY,EAAE,KAAK,IAAI,GACvE,OAAO,CAAC,IAAI,CAAC;IA4ChB;;;;;;OAMG;IACI,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS;CAIxD;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,eAAe,EAAE,eAAe,GAAG,IAAI,CAAC;IACxC;;;;OAIG;IACH,6BAA6B,EAAE,OAAO,CAAC;IACvC;;;OAGG;IACH,WAAW,EAAE,qBAAqB,CAAC;IACnC,0DAA0D;IAC1D,eAAe,EAAE,eAAe,CAAC;IACjC;;;;OAIG;IACH,QAAQ,EAAE,SAAS,GAAG,IAAI,CAAC;IAC3B;;;OAGG;IACH,cAAc,EAAE,cAAc,CAAC;IAC/B;;;OAGG;IACH,uBAAuB,EAAE,wBAAwB,CAAC;IAClD;;;OAGG;IACH,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,kEAAkE;IAClE,cAAc,EAAE,0BAA0B,GAAG,IAAI,CAAC;IAClD;;;OAGG;IACH,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,uCAAuC;IACvC,kBAAkB,EAAE,iBAAiB,CAAC;IACtC;;;OAGG;IACH,iBAAiB,EAAE,iBAAiB,CAAC;IACrC;;;;OAIG;IACH,cAAc,EAAE,OAAO,CAAC;CACzB"}
@@ -1,11 +1,8 @@
1
- import { MediaSource_ } from "../../compat/browser_compatibility_types";
2
1
  import features from "../../features";
3
2
  import log from "../../log";
4
- import { createRepresentationFilterFromFnString } from "../../manifest";
5
3
  import MainMediaSourceInterface from "../../mse/main_media_source_interface";
6
4
  import WorkerMediaSourceInterface from "../../mse/worker_media_source_interface";
7
5
  import idGenerator from "../../utils/id_generator";
8
- import isNullOrUndefined from "../../utils/is_null_or_undefined";
9
6
  import TaskCanceller from "../../utils/task_canceller";
10
7
  import createAdaptiveRepresentationSelector from "../adaptive";
11
8
  import CmcdDataBuilder from "../cmcd";
@@ -16,7 +13,7 @@ import SegmentSinksStore from "../segment_sinks";
16
13
  import CoreTextDisplayerInterface from "./core_text_displayer_interface";
17
14
  import FreezeResolver from "./FreezeResolver";
18
15
  import TrackChoiceSetter from "./track_choice_setter";
19
- import { formatErrorForSender } from "./utils";
16
+ import { extractExternalPlugins, formatErrorForSender, updateCodecSupportInWorkerMode, } from "./utils";
20
17
  /** Function allowing to associate a unique identifier to all created `MediaSource` */
21
18
  const generateMediaSourceId = idGenerator();
22
19
  /**
@@ -301,75 +298,3 @@ function createMediaSourceInterfaceAndSegmentSinksStore(sendMessage, contentId,
301
298
  });
302
299
  return [mediaSourceInterface, segmentSinksStore, textSender];
303
300
  }
304
- /**
305
- * Set Representation.isCodecSupportedInWebWorker to true or false
306
- * If the codec is supported in the current context.
307
- * If MSE in worker is not available, the attribute is not set.
308
- */
309
- function updateCodecSupportInWorkerMode(manifestToUpdate) {
310
- var _a, _b;
311
- if (isNullOrUndefined(MediaSource_)) {
312
- return;
313
- }
314
- const codecsMap = new Map();
315
- for (const period of manifestToUpdate.periods) {
316
- const checkedAdaptations = [
317
- ...((_a = period.adaptations.video) !== null && _a !== void 0 ? _a : []),
318
- ...((_b = period.adaptations.audio) !== null && _b !== void 0 ? _b : []),
319
- ];
320
- for (const adaptation of checkedAdaptations) {
321
- for (const representation of adaptation.representations) {
322
- const codec = `${representation.mimeType};codecs="${representation.codecs[0]}"`;
323
- if (codecsMap.has(codec)) {
324
- representation.isCodecSupportedInWebWorker = codecsMap.get(codec);
325
- }
326
- else {
327
- const supported = MediaSource_.isTypeSupported(codec);
328
- representation.isCodecSupportedInWebWorker = supported;
329
- codecsMap.set(codec, supported);
330
- }
331
- }
332
- }
333
- }
334
- }
335
- /**
336
- * Some functions may be defined by the API, we call those "plugins".
337
- * This function parses and extract the actual function from the different
338
- * ways an application can provide it to us.
339
- * @param {Object} input - The API input
340
- * @param {Object} corePlugins - Context on what identified functions are
341
- * defined right now.
342
- * @returns {Function}
343
- */
344
- function extractExternalPlugins(input, corePlugins) {
345
- var _a, _b, _c, _d, _e, _f, _g;
346
- let manifestLoader;
347
- let segmentLoader;
348
- let representationFilter;
349
- if (typeof ((_a = input.representationFilter) === null || _a === void 0 ? void 0 : _a.fn) === "function") {
350
- representationFilter = input.representationFilter.fn;
351
- }
352
- else if (typeof ((_b = input.representationFilter) === null || _b === void 0 ? void 0 : _b.eval) === "string") {
353
- representationFilter = createRepresentationFilterFromFnString(input.representationFilter.eval);
354
- }
355
- else if (typeof ((_c = input.representationFilter) === null || _c === void 0 ? void 0 : _c.workerId) === "string") {
356
- representationFilter = corePlugins.representationFilters.get(input.representationFilter.workerId);
357
- }
358
- if (typeof ((_d = input.manifestLoader) === null || _d === void 0 ? void 0 : _d.fn) === "function") {
359
- manifestLoader = input.manifestLoader.fn;
360
- }
361
- else if (typeof ((_e = input.manifestLoader) === null || _e === void 0 ? void 0 : _e.workerId) === "string") {
362
- manifestLoader = corePlugins.manifestLoaders.get(input.manifestLoader.workerId);
363
- }
364
- if (typeof ((_f = input.segmentLoader) === null || _f === void 0 ? void 0 : _f.fn) === "function") {
365
- segmentLoader = input.segmentLoader.fn;
366
- }
367
- else if (typeof ((_g = input.segmentLoader) === null || _g === void 0 ? void 0 : _g.workerId) === "string") {
368
- segmentLoader = corePlugins.segmentLoaders.get(input.segmentLoader.workerId);
369
- }
370
- return {
371
- manifestLoader,
372
- segmentLoader,
373
- representationFilter,
374
- };
375
- }
@@ -1,7 +1,7 @@
1
1
  import type { IMainThreadMessage } from "../../main_thread/types";
2
2
  import SharedReference from "../../utils/reference";
3
3
  import type { ICoreMessage, IResolutionInfo } from "../types";
4
- import type { ICorePlugins } from "./content_preparer";
4
+ import type { ICorePlugins } from "./utils";
5
5
  export type IMessageReceiverCallback = (evt: {
6
6
  data: IMainThreadMessage;
7
7
  }) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"core_entry.d.ts","sourceRoot":"","sources":["../../../../src/core/entry/core_entry.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,kBAAkB,EAGnB,MAAM,yBAAyB,CAAC;AAcjC,OAAO,eAAe,MAAM,uBAAuB,CAAC;AAQpD,OAAO,KAAK,EACV,YAAY,EAEZ,eAAe,EAChB,MAAM,UAAU,CAAC;AAGlB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAQvD,MAAM,MAAM,wBAAwB,GAAG,CAAC,GAAG,EAAE;IAAE,IAAI,EAAE,kBAAkB,CAAA;CAAE,KAAK,IAAI,CAAC;AAEnF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CACzC,kBAAkB,EAAE,CAAC,EAAE,EAAE,wBAAwB,KAAK,IAAI,EAC1D,WAAW,EAAE,CAAC,GAAG,EAAE,YAAY,EAAE,aAAa,CAAC,EAAE,YAAY,EAAE,KAAK,IAAI,EACxE,WAAW,EAAE,YAAY,GACxB,IAAI,CA2ZN;AAowBD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,oBAAoB,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;IACvD,iFAAiF;IACjF,cAAc,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IACxC,oFAAoF;IACpF,eAAe,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IACzC,oEAAoE;IACpE,kBAAkB,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC5C,oBAAoB,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC9C,+DAA+D;IAC/D,iBAAiB,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;CAC5C"}
1
+ {"version":3,"file":"core_entry.d.ts","sourceRoot":"","sources":["../../../../src/core/entry/core_entry.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,kBAAkB,EAGnB,MAAM,yBAAyB,CAAC;AAcjC,OAAO,eAAe,MAAM,uBAAuB,CAAC;AAQpD,OAAO,KAAK,EACV,YAAY,EAEZ,eAAe,EAChB,MAAM,UAAU,CAAC;AAOlB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,MAAM,MAAM,wBAAwB,GAAG,CAAC,GAAG,EAAE;IAAE,IAAI,EAAE,kBAAkB,CAAA;CAAE,KAAK,IAAI,CAAC;AAEnF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CACzC,kBAAkB,EAAE,CAAC,EAAE,EAAE,wBAAwB,KAAK,IAAI,EAC1D,WAAW,EAAE,CAAC,GAAG,EAAE,YAAY,EAAE,aAAa,CAAC,EAAE,YAAY,EAAE,KAAK,IAAI,EACxE,WAAW,EAAE,YAAY,GACxB,IAAI,CA2ZN;AA8vBD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,oBAAoB,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;IACvD,iFAAiF;IACjF,cAAc,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IACxC,oFAAoF;IACpF,eAAe,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IACzC,oEAAoE;IACpE,kBAAkB,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC5C,oBAAoB,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC9C,+DAA+D;IAC/D,iBAAiB,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;CAC5C"}
@@ -17,8 +17,7 @@ import ContentPreparer from "./content_preparer";
17
17
  import createContentTimeBoundariesObserver from "./create_content_time_boundaries_observer";
18
18
  import getBufferedDataPerMediaBuffer from "./get_buffered_data_per_media_buffer";
19
19
  import getThumbnailData from "./get_thumbnail_data";
20
- import synchronizeSegmentSinksOnObservation from "./synchronize_sinks_on_observation";
21
- import { formatErrorForSender } from "./utils";
20
+ import { formatErrorForSender, synchronizeSegmentSinksOnObservation } from "./utils";
22
21
  /**
23
22
  * Initialize a `CoreEntry`, which is the part of the RxPlayer acting as an
24
23
  * entry point to all its "core" code.
@@ -561,11 +560,6 @@ function loadPreparedContent(sendMessage, val, contentPreparer, playbackObservat
561
560
  },
562
561
  adaptationChange(value) {
563
562
  var _a, _b;
564
- contentTimeBoundariesObserver.onAdaptationChange(value.type, value.period, value.adaptation);
565
- if (currentLoadCanceller === null ||
566
- currentLoadCanceller.signal.isCancelled()) {
567
- return;
568
- }
569
563
  sendMessage({
570
564
  type: "adaptation-changed" /* CoreMessageType.AdaptationChanged */,
571
565
  contentId,
@@ -575,6 +569,7 @@ function loadPreparedContent(sendMessage, val, contentPreparer, playbackObservat
575
569
  type: value.type,
576
570
  },
577
571
  });
572
+ contentTimeBoundariesObserver.onAdaptationChange(value.type, value.period, value.adaptation);
578
573
  },
579
574
  representationChange(value) {
580
575
  var _a, _b;
@@ -1 +1 @@
1
- {"version":3,"file":"core_text_displayer_interface.d.ts","sourceRoot":"","sources":["../../../../src/core/entry/core_text_displayer_interface.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC1B,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,UAAU,CAAC;AAGlB;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,0BAA2B,YAAW,uBAAuB;IAChF,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,cAAc,CAAoD;IACnE,OAAO,EAAE;QACd,YAAY,EAAE,KAAK,CAAC;YAClB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;YACpC,MAAM,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;SAChC,CAAC,CAAC;QACH,MAAM,EAAE,KAAK,CAAC;YACZ,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;YACpC,MAAM,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;SAChC,CAAC,CAAC;KACJ,CAAC;IAEF;;;OAGG;gBAED,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,CAAC,GAAG,EAAE,kCAAkC,KAAK,IAAI;IAOlE;;OAEG;IACI,YAAY,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAWjE;;OAEG;IACI,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAW5D;;OAEG;IACI,KAAK,IAAI,IAAI;IASpB;;OAEG;IACI,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAS7C,OAAO,CAAC,kBAAkB;IAa1B;;OAEG;IACI,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI;IASnD;;OAEG;IACI,kBAAkB,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI;IAS3C;;OAEG;IACI,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI;IAS9C;;OAEG;IACI,aAAa,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI;CAQvC;AAED,KAAK,kCAAkC,GACnC,wBAAwB,GACxB,0BAA0B,GAC1B,6BAA6B,GAC7B,8BAA8B,CAAC"}
1
+ {"version":3,"file":"core_text_displayer_interface.d.ts","sourceRoot":"","sources":["../../../../src/core/entry/core_text_displayer_interface.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC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D;;OAEG;IACI,kBAAkB,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI;IAS3C;;OAEG;IACI,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI;IAS9C;;OAEG;IACI,aAAa,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI;CAQvC;AAED,KAAK,kCAAkC,GACnC,wBAAwB,GACxB,0BAA0B,GAC1B,6BAA6B,GAC7B,8BAA8B,CAAC"}
@@ -69,9 +69,11 @@ export default class CoreTextDisplayerInterface {
69
69
  this._queues.pushTextData.forEach((elt) => {
70
70
  elt.reject(error);
71
71
  });
72
+ this._queues.pushTextData.length = 0;
72
73
  this._queues.remove.forEach((elt) => {
73
74
  elt.reject(error);
74
75
  });
76
+ this._queues.remove.length = 0;
75
77
  }
76
78
  /**
77
79
  * @param {Array.<Object>} ranges
@@ -110,7 +112,7 @@ export default class CoreTextDisplayerInterface {
110
112
  * @param {unknown} err
111
113
  */
112
114
  onRemoveError(err) {
113
- const element = this._queues.pushTextData.shift();
115
+ const element = this._queues.remove.shift();
114
116
  if (element === undefined) {
115
117
  log.error("text", "pushTextData error for inexistant operation");
116
118
  return;
@@ -2,5 +2,5 @@ import type { IMessageReceiverCallback } from "./core_entry";
2
2
  import initializeCoreEntry from "./core_entry";
3
3
  export default initializeCoreEntry;
4
4
  export type { IMessageReceiverCallback };
5
- export type { ICorePlugins } from "./content_preparer";
5
+ export type { ICorePlugins } from "./utils";
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/entry/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,mBAAmB,MAAM,cAAc,CAAC;AAC/C,eAAe,mBAAmB,CAAC;AACnC,YAAY,EAAE,wBAAwB,EAAE,CAAC;AACzC,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/entry/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,mBAAmB,MAAM,cAAc,CAAC;AAC/C,eAAe,mBAAmB,CAAC;AACnC,YAAY,EAAE,wBAAwB,EAAE,CAAC;AACzC,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
@@ -1,3 +1,67 @@
1
+ import type { ICorePlaybackObservation } from "../../main_thread/init/utils/create_core_playback_observer";
2
+ import type Manifest from "../../manifest/classes";
3
+ import type { IManifestLoader, IRepresentationFilter, ISegmentLoader } from "../../public_types";
4
+ import type SegmentSinksStore from "../segment_sinks";
1
5
  import type { ISentError } from "../types";
6
+ /**
7
+ * "Plugins" are a specific kind of API where an application can define complex
8
+ * functions that the RxPlayer will call in some normally-core aspects of media
9
+ * playback: e.g. loading segments.
10
+ *
11
+ * This interface lists them.
12
+ */
13
+ export interface ICorePlugins {
14
+ representationFilters: Map<string, IRepresentationFilter>;
15
+ segmentLoaders: Map<string, ISegmentLoader>;
16
+ manifestLoaders: Map<string, IManifestLoader>;
17
+ }
18
+ /**
19
+ * Format an error, which may be of any form, into an Object than can easily be
20
+ * serialized - e.g. to be communicated through a postMessage-like API.
21
+ * @param {*} error - The error to serialized
22
+ * @returns {Object} - A serialization-safe error format
23
+ */
2
24
  export declare function formatErrorForSender(error: unknown): ISentError;
25
+ /**
26
+ * Synchronize SegmentSinks with what has been buffered.
27
+ * @param {Object} observation - The just-received playback observation,
28
+ * including what has been buffered on lower-level buffers
29
+ * @param {Object} segmentSinksStore - Interface allowing to interact
30
+ * with `SegmentSink`s, so their inventory can be updated accordingly.
31
+ */
32
+ export declare function synchronizeSegmentSinksOnObservation(observation: ICorePlaybackObservation, segmentSinksStore: SegmentSinksStore): void;
33
+ /**
34
+ * Set Representation.isCodecSupportedInWebWorker to true or false
35
+ * If the codec is supported in the current context.
36
+ * If MSE in worker is not available, the attribute is not set.
37
+ */
38
+ export declare function updateCodecSupportInWorkerMode(manifestToUpdate: Manifest): void;
39
+ /**
40
+ * Some functions may be defined by the API, we call those "plugins".
41
+ * This function parses and extract the actual function from the different
42
+ * ways an application can provide it to us.
43
+ * @param {Object} input - The API input
44
+ * @param {Object} corePlugins - Context on what identified functions are
45
+ * defined right now.
46
+ * @returns {Function}
47
+ */
48
+ export declare function extractExternalPlugins(input: {
49
+ manifestLoader: {
50
+ fn?: IManifestLoader | undefined;
51
+ workerId?: string | undefined;
52
+ } | undefined;
53
+ segmentLoader: {
54
+ fn?: ISegmentLoader | undefined;
55
+ workerId?: string | undefined;
56
+ } | undefined;
57
+ representationFilter: undefined | {
58
+ fn?: IRepresentationFilter | undefined;
59
+ eval?: string | undefined;
60
+ workerId?: string | undefined;
61
+ };
62
+ }, corePlugins: ICorePlugins): {
63
+ manifestLoader: IManifestLoader | undefined;
64
+ segmentLoader: ISegmentLoader | undefined;
65
+ representationFilter: IRepresentationFilter | undefined;
66
+ };
3
67
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/core/entry/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAO/D"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/core/entry/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4DAA4D,CAAC;AAE3G,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,EACV,eAAe,EACf,qBAAqB,EACrB,cAAc,EACf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,iBAAiB,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,E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 -1,4 +1,13 @@
1
+ import { MediaSource_ } from "../../compat/browser_compatibility_types";
1
2
  import { formatError } from "../../errors";
3
+ import { createRepresentationFilterFromFnString } from "../../manifest";
4
+ import isNullOrUndefined from "../../utils/is_null_or_undefined";
5
+ /**
6
+ * Format an error, which may be of any form, into an Object than can easily be
7
+ * serialized - e.g. to be communicated through a postMessage-like API.
8
+ * @param {*} error - The error to serialized
9
+ * @returns {Object} - A serialization-safe error format
10
+ */
2
11
  export function formatErrorForSender(error) {
3
12
  const formattedError = formatError(error, {
4
13
  defaultCode: "NONE",
@@ -6,3 +15,92 @@ export function formatErrorForSender(error) {
6
15
  });
7
16
  return formattedError.serialize();
8
17
  }
18
+ /**
19
+ * Synchronize SegmentSinks with what has been buffered.
20
+ * @param {Object} observation - The just-received playback observation,
21
+ * including what has been buffered on lower-level buffers
22
+ * @param {Object} segmentSinksStore - Interface allowing to interact
23
+ * with `SegmentSink`s, so their inventory can be updated accordingly.
24
+ */
25
+ export function synchronizeSegmentSinksOnObservation(observation, segmentSinksStore) {
26
+ // Synchronize SegmentSinks with what has been buffered.
27
+ ["video", "audio", "text"].forEach((tType) => {
28
+ var _a;
29
+ const segmentSinkStatus = segmentSinksStore.getStatus(tType);
30
+ if (segmentSinkStatus.type === "initialized") {
31
+ segmentSinkStatus.value.synchronizeInventory((_a = observation.buffered[tType]) !== null && _a !== void 0 ? _a : []);
32
+ }
33
+ });
34
+ }
35
+ /**
36
+ * Set Representation.isCodecSupportedInWebWorker to true or false
37
+ * If the codec is supported in the current context.
38
+ * If MSE in worker is not available, the attribute is not set.
39
+ */
40
+ export function updateCodecSupportInWorkerMode(manifestToUpdate) {
41
+ var _a, _b;
42
+ if (isNullOrUndefined(MediaSource_)) {
43
+ return;
44
+ }
45
+ const codecsMap = new Map();
46
+ for (const period of manifestToUpdate.periods) {
47
+ const checkedAdaptations = [
48
+ ...((_a = period.adaptations.video) !== null && _a !== void 0 ? _a : []),
49
+ ...((_b = period.adaptations.audio) !== null && _b !== void 0 ? _b : []),
50
+ ];
51
+ for (const adaptation of checkedAdaptations) {
52
+ for (const representation of adaptation.representations) {
53
+ const codec = `${representation.mimeType};codecs="${representation.codecs[0]}"`;
54
+ if (codecsMap.has(codec)) {
55
+ representation.isCodecSupportedInWebWorker = codecsMap.get(codec);
56
+ }
57
+ else {
58
+ const supported = MediaSource_.isTypeSupported(codec);
59
+ representation.isCodecSupportedInWebWorker = supported;
60
+ codecsMap.set(codec, supported);
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }
66
+ /**
67
+ * Some functions may be defined by the API, we call those "plugins".
68
+ * This function parses and extract the actual function from the different
69
+ * ways an application can provide it to us.
70
+ * @param {Object} input - The API input
71
+ * @param {Object} corePlugins - Context on what identified functions are
72
+ * defined right now.
73
+ * @returns {Function}
74
+ */
75
+ export function extractExternalPlugins(input, corePlugins) {
76
+ var _a, _b, _c, _d, _e, _f, _g;
77
+ let manifestLoader;
78
+ let segmentLoader;
79
+ let representationFilter;
80
+ if (typeof ((_a = input.representationFilter) === null || _a === void 0 ? void 0 : _a.fn) === "function") {
81
+ representationFilter = input.representationFilter.fn;
82
+ }
83
+ else if (typeof ((_b = input.representationFilter) === null || _b === void 0 ? void 0 : _b.eval) === "string") {
84
+ representationFilter = createRepresentationFilterFromFnString(input.representationFilter.eval);
85
+ }
86
+ else if (typeof ((_c = input.representationFilter) === null || _c === void 0 ? void 0 : _c.workerId) === "string") {
87
+ representationFilter = corePlugins.representationFilters.get(input.representationFilter.workerId);
88
+ }
89
+ if (typeof ((_d = input.manifestLoader) === null || _d === void 0 ? void 0 : _d.fn) === "function") {
90
+ manifestLoader = input.manifestLoader.fn;
91
+ }
92
+ else if (typeof ((_e = input.manifestLoader) === null || _e === void 0 ? void 0 : _e.workerId) === "string") {
93
+ manifestLoader = corePlugins.manifestLoaders.get(input.manifestLoader.workerId);
94
+ }
95
+ if (typeof ((_f = input.segmentLoader) === null || _f === void 0 ? void 0 : _f.fn) === "function") {
96
+ segmentLoader = input.segmentLoader.fn;
97
+ }
98
+ else if (typeof ((_g = input.segmentLoader) === null || _g === void 0 ? void 0 : _g.workerId) === "string") {
99
+ segmentLoader = corePlugins.segmentLoaders.get(input.segmentLoader.workerId);
100
+ }
101
+ return {
102
+ manifestLoader,
103
+ segmentLoader,
104
+ representationFilter,
105
+ };
106
+ }
@@ -141,8 +141,8 @@ export interface ISegmentQueueEvent<T> {
141
141
  * You can now push that segment to its corresponding buffer and use its parsed
142
142
  * metadata.
143
143
  *
144
- * Only sent if an initialization segment exists (when the `SegmentQueue`'s
145
- * `hasInitSegment` constructor option has been set to `true`).
144
+ * Only sent if an initialization segment exists (when the `hasInitSegment`
145
+ * option has been set to `true`).
146
146
  * In that case, an `IParsedInitSegmentEvent` will always be sent before any
147
147
  * `IParsedSegmentEvent` event is sent.
148
148
  */
@@ -151,10 +151,9 @@ export interface ISegmentQueueEvent<T> {
151
151
  * Notify that a media chunk (decodable sub-part of a media segment) has been
152
152
  * loaded and parsed.
153
153
  *
154
- * If an initialization segment exists (when the `SegmentQueue`'s
155
- * `hasInitSegment` constructor option has been set to `true`), an
156
- * `IParsedSegmentEvent` will always be sent AFTER the `IParsedInitSegmentEvent`
157
- * event.
154
+ * If an initialization segment exists (when the `hasInitSegment` option has
155
+ * been set to `true`), an `IParsedSegmentEvent` will always be sent AFTER
156
+ * the `IParsedInitSegmentEvent` event.
158
157
  *
159
158
  * It can now be pushed to its corresponding buffer. Note that there might be
160
159
  * multiple `IParsedSegmentEvent` for a single segment, if that segment is
@@ -1 +1 @@
1
- {"version":3,"file":"segment_queue.d.ts","sourceRoot":"","sources":["../../../../../src/core/fetchers/segment/segment_queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,QAAQ,EACR,OAAO,EACP,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,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,CAAC;IACnC;;;;;;;;;;OAUG;IACH,iBAAiB,EAAE,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAChD;;;;;;;;;;;;;;OAcG;IACH,kBAAkB,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAC7C,2EAA2E;IAC3E,kBAAkB,EAAE,QAAQ,CAAC;IAC7B;;;OAGG;IACH,YAAY,EAAE,oBAAoB,CAAC;IACnC;;;OAGG;IACH,UAAU,EAAE,IAAI,CAAC;IACjB;;;;;OAKG;IACH,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,+CAA+C;AAC/C,MAAM,MAAM,yBAAyB,CAAC,CAAC,IAAI,6BAA6B,CAAC,CAAC,CAAC,GAAG;IAC5E,OAAO,EAAE,QAAQ,CAAC;CACnB,CAAC;AACF,gDAAgD;AAChD,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,8BAA8B,CAAC,CAAC,CAAC,GAAG;IACzE,OAAO,EAAE,QAAQ,CAAC;CACnB,CAAC;AACF,0CAA0C;AAC1C,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,QAAQ,CAAC;IAClB,KAAK,EAAE,YAAY,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;OAUG;IACH,WAAW,EAAE,cAAc,GAAG,IAAI,CAAC;IAEnC;;;;;;;;;;;;OAYG;IACH,YAAY,EAAE,cAAc,EAAE,CAAC;CAChC;AAcD,gEAAgE;AAChE,MAAM,WAAW,oBAAoB;IACnC,0DAA0D;IAC1D,UAAU,EAAE,WAAW,CAAC;IACxB,wDAAwD;IACxD,QAAQ,EAAE,SAAS,CAAC;IACpB,sDAAsD;IACtD,MAAM,EAAE,OAAO,CAAC;IAChB,8DAA8D;IAC9D,cAAc,EAAE,eAAe,CAAC;CACjC"}
1
+ {"version":3,"file":"segment_queue.d.ts","sourceRoot":"","sources":["../../../../../src/core/fetchers/segment/segment_queue.ts"],"names":[],"mappings":"AAAA;;;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ACtD,MAAM,EAAE,OAAO,CAAC;IAChB,8DAA8D;IAC9D,cAAc,EAAE,eAAe,CAAC;CACjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"thumbnail_fetcher.d.ts","sourceRoot":"","sources":["../../../../../src/core/fetchers/thumbnails/thumbnail_fetcher.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAGV,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,KAAK,cAAc,MAAM,oBAAoB,CAAC;AAIrD;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB;AAC5C,gEAAgE;AAChE,QAAQ,EAAE,kBAAkB;AAC5B;;;;;;;GAOG;AACH,cAAc,EAAE,cAAc,GAAG,IAAI,GAEpC,iBAAiB,CAsNnB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GAAG;AAC9B,gDAAgD;AAChD,gBAAgB,EAAE;IAChB,2BAA2B;IAC3B,OAAO,EAAE,QAAQ,CAAC;IAClB,+CAA+C;IAC/C,KAAK,EAAE,eAAe,CAAC;IACvB,kEAAkE;IAClE,MAAM,EAAE,OAAO,CAAC;CACjB;AACD,yDAAyD;AACzD,kBAAkB,EAAE,kBAAkB,KACnC,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAEjC,8EAA8E;AAC9E,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC"}
1
+ {"version":3,"file":"thumbnail_fetcher.d.ts","sourceRoot":"","sources":["../../../../../src/core/fetchers/thumbnails/thumbnail_fetcher.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAIV,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,KAAK,cAAc,MAAM,oBAAoB,CAAC;AAIrD;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB;AAC5C,gEAAgE;AAChE,QAAQ,EAAE,kBAAkB;AAC5B;;;;;;;GAOG;AACH,cAAc,EAAE,cAAc,GAAG,IAAI,GAEpC,iBAAiB,CA6NnB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GAAG;AAC9B,gDAAgD;AAChD,gBAAgB,EAAE;IAChB,2BAA2B;IAC3B,OAAO,EAAE,QAAQ,CAAC;IAClB,+CAA+C;IAC/C,KAAK,EAAE,eAAe,CAAC;IACvB,kEAAkE;IAClE,MAAM,EAAE,OAAO,CAAC;CACjB;AACD,yDAAyD;AACzD,kBAAkB,EAAE,kBAAkB,KACnC,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAEjC,8EAA8E;AAC9E,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC"}
@@ -43,6 +43,7 @@ cdnPrioritizer) {
43
43
  */
44
44
  return async function fetchThumbnail(thumbnailContext, cancellationSignal) {
45
45
  cancellationSignal.register(onCancellation);
46
+ const { segment: thumbnail, track: thumbnailTrack } = thumbnailContext;
46
47
  let currRequestInfo;
47
48
  // First check if we're not requesting again the last thumbnail
48
49
  const pendingInfo = arrayFind(pendingRequestsInfo, ({ thumbnailContext: pCtxt }) => {
@@ -66,9 +67,11 @@ cdnPrioritizer) {
66
67
  throw err;
67
68
  }
68
69
  cancellationSignal.deregister(onCancellation);
69
- return response;
70
+ if (cancellationSignal.isCancelled()) {
71
+ throw cancellationSignal.cancellationError;
72
+ }
73
+ return parseThumbnailStep(response);
70
74
  }
71
- const { segment: thumbnail, track: thumbnailTrack } = thumbnailContext;
72
75
  // NOTE: For now, as multiple `fetchThumbnail` calls might rely on the
73
76
  // same request, it is difficult to let different request options
74
77
  // per call. So this is not enabled yet.
@@ -92,7 +95,7 @@ cdnPrioritizer) {
92
95
  * as several calls might share the same request.
93
96
  */
94
97
  const requestCanceller = new TaskCanceller("Thumbnail request");
95
- const fetchPromise = doFetch();
98
+ const fetchPromise = fetchThumbnailStep();
96
99
  currRequestInfo = {
97
100
  thumbnailContext,
98
101
  promise: fetchPromise,
@@ -105,30 +108,31 @@ cdnPrioritizer) {
105
108
  pendingRequestsInfo.splice(currRequestIdx, 1);
106
109
  }
107
110
  };
111
+ let fetchResult;
108
112
  try {
109
- const fetchResult = await fetchPromise;
110
- clearRequestInfo();
111
- return fetchResult;
113
+ fetchResult = await fetchPromise;
112
114
  }
113
115
  catch (err) {
114
116
  clearRequestInfo();
117
+ cancellationSignal.deregister(onCancellation);
115
118
  throw err;
116
119
  }
117
- async function doFetch() {
120
+ clearRequestInfo();
121
+ cancellationSignal.deregister(onCancellation);
122
+ if (cancellationSignal.isCancelled()) {
123
+ throw cancellationSignal.cancellationError;
124
+ }
125
+ return parseThumbnailStep(fetchResult);
126
+ async function fetchThumbnailStep() {
118
127
  log.debug("Thumbnails", "Beginning thumbnail request", { time: thumbnail.time });
119
- let res;
120
128
  try {
121
- res = await scheduleRequestWithCdns(thumbnailTrack.cdnMetadata, cdnPrioritizer, callLoaderWithUrl, objectAssign({ onRetry }, requestOptions), requestCanceller.signal);
122
- if (cancellationSignal.isCancelled()) {
123
- return Promise.reject(cancellationSignal.cancellationError);
124
- }
129
+ const res = await scheduleRequestWithCdns(thumbnailTrack.cdnMetadata, cdnPrioritizer, callLoaderWithUrl, objectAssign({ onRetry }, requestOptions), requestCanceller.signal);
125
130
  log.debug("Thumbnails", "Thumbnail request ended with success", {
126
131
  time: thumbnail.time,
127
132
  });
128
- cancellationSignal.deregister(onCancellation);
133
+ return res;
129
134
  }
130
135
  catch (err) {
131
- cancellationSignal.deregister(onCancellation);
132
136
  if (err instanceof CancellationError) {
133
137
  log.debug("Thumbnails", "Thumbnail request aborted", { time: thumbnail.time });
134
138
  throw err;
@@ -136,12 +140,13 @@ cdnPrioritizer) {
136
140
  log.debug("Thumbnails", "Thumbnail request failed", { time: thumbnail.time });
137
141
  throw errorSelector(err);
138
142
  }
143
+ }
144
+ function parseThumbnailStep(rawResponse) {
139
145
  try {
140
- const parsed = pipeline.parseThumbnail(res.responseData, {
146
+ return pipeline.parseThumbnail(rawResponse.responseData, {
141
147
  thumbnail,
142
148
  thumbnailTrack,
143
149
  });
144
- return parsed;
145
150
  }
146
151
  catch (error) {
147
152
  throw formatError(error, {
@@ -1,3 +1,4 @@
1
- export { DASH, DASH_WASM } from "../../../features/list";
1
+ export { DASH, DASH_WASM, SMOOTH } from "../../../features/list";
2
2
  export { LOCAL_MANIFEST } from "../local";
3
+ export { METAPLAYLIST } from "../metaplaylist";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/experimental/features/worker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/experimental/features/worker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,4 +1,3 @@
1
- export { DASH, DASH_WASM } from "../../../features/list";
1
+ export { DASH, DASH_WASM, SMOOTH } from "../../../features/list";
2
2
  export { LOCAL_MANIFEST } from "../local";
3
- // TODO: `SMOOTH` (has to be made worker-compatible)
4
- // TODO: `METAPLAYLIST` (once every transport is ported)
3
+ export { METAPLAYLIST } from "../metaplaylist";
@@ -162,7 +162,7 @@ class Player extends EventEmitter {
162
162
  // Workaround to support Firefox autoplay on FF 42.
163
163
  // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
164
164
  videoElement.preload = "auto";
165
- this.version = /* PLAYER_VERSION */ "4.5.0-dev.2026021900";
165
+ this.version = /* PLAYER_VERSION */ "4.5.0-dev.2026031700";
166
166
  this.log = log;
167
167
  this.state = "STOPPED";
168
168
  this.videoElement = videoElement;
@@ -2838,7 +2838,7 @@ class Player extends EventEmitter {
2838
2838
  // TODO: Make it work with multithread?
2839
2839
  return false;
2840
2840
  }
2841
- if (options.transport !== "dash" && options.transport !== "local") {
2841
+ if (options.transport === "directfile") {
2842
2842
  return false;
2843
2843
  }
2844
2844
  if (features.monothread === null ||
@@ -2872,5 +2872,5 @@ class Player extends EventEmitter {
2872
2872
  * Use of a WeakSet ensure the object is garbage collected if it's not used anymore.
2873
2873
  */
2874
2874
  Player._priv_currentlyUsedVideoElements = new WeakSet();
2875
- Player.version = /* PLAYER_VERSION */ "4.5.0-dev.2026021900";
2875
+ Player.version = /* PLAYER_VERSION */ "4.5.0-dev.2026031700";
2876
2876
  export default Player;
@@ -1 +1 @@
1
- {"version":3,"file":"apply_line_height.d.ts","sourceRoot":"","sources":["../../../../../../src/parsers/texttracks/ttml/html/apply_line_height.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAuBtF"}
1
+ {"version":3,"file":"apply_line_height.d.ts","sourceRoot":"","sources":["../../../../../../src/parsers/texttracks/ttml/html/apply_line_height.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAsCtF"}