rx-player 4.0.0-beta.1 → 4.0.0-beta.2

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 (169) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/CONTRIBUTING.md +48 -168
  3. package/FILES.md +40 -92
  4. package/VERSION +1 -1
  5. package/dist/_esm5.processed/compat/browser_detection.d.ts +3 -1
  6. package/dist/_esm5.processed/compat/browser_detection.js +7 -2
  7. package/dist/_esm5.processed/compat/eme/load_session.js +1 -1
  8. package/dist/_esm5.processed/compat/has_issues_with_high_media_source_duration.d.ts +21 -0
  9. package/dist/_esm5.processed/compat/has_issues_with_high_media_source_duration.js +26 -0
  10. package/dist/_esm5.processed/config.d.ts +2 -0
  11. package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.js +5 -4
  12. package/dist/_esm5.processed/core/adaptive/buffer_based_chooser.d.ts +18 -1
  13. package/dist/_esm5.processed/core/adaptive/buffer_based_chooser.js +106 -25
  14. package/dist/_esm5.processed/core/adaptive/guess_based_chooser.js +6 -6
  15. package/dist/_esm5.processed/core/adaptive/network_analyzer.js +8 -5
  16. package/dist/_esm5.processed/core/adaptive/utils/representation_score_calculator.d.ts +19 -1
  17. package/dist/_esm5.processed/core/adaptive/utils/representation_score_calculator.js +1 -1
  18. package/dist/_esm5.processed/core/api/debug/render.js +1 -1
  19. package/dist/_esm5.processed/core/api/playback_observer.js +1 -0
  20. package/dist/_esm5.processed/core/api/public_api.d.ts +54 -1
  21. package/dist/_esm5.processed/core/api/public_api.js +232 -35
  22. package/dist/_esm5.processed/core/api/track_management/media_element_tracks_store.js +10 -1
  23. package/dist/_esm5.processed/core/api/track_management/track_dispatcher.d.ts +13 -1
  24. package/dist/_esm5.processed/core/api/track_management/track_dispatcher.js +30 -15
  25. package/dist/_esm5.processed/core/api/track_management/tracks_store.d.ts +3 -1
  26. package/dist/_esm5.processed/core/api/track_management/tracks_store.js +67 -152
  27. package/dist/_esm5.processed/core/api/utils.d.ts +10 -0
  28. package/dist/_esm5.processed/core/api/utils.js +20 -0
  29. package/dist/_esm5.processed/core/decrypt/session_events_listener.js +7 -1
  30. package/dist/_esm5.processed/core/decrypt/utils/clean_old_loaded_sessions.js +2 -0
  31. package/dist/_esm5.processed/core/decrypt/utils/loaded_sessions_store.js +5 -1
  32. package/dist/_esm5.processed/core/init/directfile_content_initializer.js +1 -1
  33. package/dist/_esm5.processed/core/init/media_source_content_initializer.js +47 -10
  34. package/dist/_esm5.processed/core/init/types.d.ts +9 -1
  35. package/dist/_esm5.processed/core/init/utils/content_time_boundaries_observer.d.ts +28 -1
  36. package/dist/_esm5.processed/core/init/utils/content_time_boundaries_observer.js +22 -9
  37. package/dist/_esm5.processed/core/init/utils/media_source_duration_updater.d.ts +58 -0
  38. package/dist/_esm5.processed/core/init/utils/{media_duration_updater.js → media_source_duration_updater.js} +84 -87
  39. package/dist/_esm5.processed/core/init/utils/rebuffering_controller.d.ts +36 -2
  40. package/dist/_esm5.processed/core/init/utils/rebuffering_controller.js +82 -2
  41. package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.d.ts +18 -7
  42. package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +31 -40
  43. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.d.ts +8 -0
  44. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +12 -0
  45. package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.d.ts +8 -0
  46. package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +12 -0
  47. package/dist/_esm5.processed/core/segment_buffers/implementations/types.d.ts +11 -4
  48. package/dist/_esm5.processed/core/segment_buffers/index.d.ts +2 -2
  49. package/dist/_esm5.processed/core/stream/adaptation/utils/create_representation_estimator.d.ts +47 -0
  50. package/dist/_esm5.processed/core/stream/adaptation/utils/create_representation_estimator.js +70 -0
  51. package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.js +15 -8
  52. package/dist/_esm5.processed/core/stream/period/period_stream.js +1 -1
  53. package/dist/_esm5.processed/core/stream/representation/representation_stream.js +22 -13
  54. package/dist/_esm5.processed/core/stream/representation/utils/append_segment_to_buffer.d.ts +4 -2
  55. package/dist/_esm5.processed/core/stream/representation/utils/append_segment_to_buffer.js +2 -2
  56. package/dist/_esm5.processed/core/stream/representation/utils/push_init_segment.d.ts +3 -2
  57. package/dist/_esm5.processed/core/stream/representation/utils/push_init_segment.js +8 -8
  58. package/dist/_esm5.processed/core/stream/representation/utils/push_media_segment.d.ts +2 -2
  59. package/dist/_esm5.processed/core/stream/representation/utils/push_media_segment.js +2 -3
  60. package/dist/_esm5.processed/default_config.d.ts +25 -0
  61. package/dist/_esm5.processed/default_config.js +27 -2
  62. package/dist/_esm5.processed/errors/index.d.ts +2 -2
  63. package/dist/_esm5.processed/errors/media_error.d.ts +23 -1
  64. package/dist/_esm5.processed/errors/media_error.js +18 -5
  65. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/load_and_push_segment.d.ts +1 -1
  66. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/load_and_push_segment.js +8 -7
  67. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +17 -9
  68. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/index.js +0 -2
  69. package/dist/_esm5.processed/manifest/adaptation.d.ts +21 -2
  70. package/dist/_esm5.processed/manifest/adaptation.js +76 -1
  71. package/dist/_esm5.processed/manifest/manifest.js +1 -1
  72. package/dist/_esm5.processed/manifest/period.js +2 -2
  73. package/dist/_esm5.processed/manifest/representation.d.ts +33 -2
  74. package/dist/_esm5.processed/manifest/representation.js +21 -0
  75. package/dist/_esm5.processed/manifest/utils.js +1 -3
  76. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/parse_from_document.d.ts +1 -1
  77. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/parse_from_document.js +1 -1
  78. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +1 -0
  79. package/dist/_esm5.processed/public_types.d.ts +13 -3
  80. package/dist/_esm5.processed/tools/TextTrackRenderer/text_track_renderer.js +1 -1
  81. package/dist/_esm5.processed/transports/smooth/isobmff/create_boxes.d.ts +4 -6
  82. package/dist/_esm5.processed/transports/smooth/isobmff/create_boxes.js +4 -6
  83. package/dist/_esm5.processed/utils/is_null_or_undefined.d.ts +1 -1
  84. package/dist/_esm5.processed/utils/is_null_or_undefined.js +1 -1
  85. package/dist/mpd-parser.wasm +0 -0
  86. package/dist/rx-player.js +4709 -4218
  87. package/dist/rx-player.min.js +1 -1
  88. package/package.json +42 -36
  89. package/scripts/build/generate_build.js +1 -1
  90. package/scripts/fast_demo_build.js +4 -3
  91. package/scripts/generate_full_demo.js +1 -1
  92. package/sonar-project.properties +1 -1
  93. package/src/compat/browser_detection.ts +7 -1
  94. package/src/compat/eme/load_session.ts +1 -1
  95. package/src/compat/has_issues_with_high_media_source_duration.ts +27 -0
  96. package/src/core/adaptive/__tests__/buffer_based_chooser.test.ts +147 -48
  97. package/src/core/adaptive/adaptive_representation_selector.ts +7 -4
  98. package/src/core/adaptive/buffer_based_chooser.ts +144 -26
  99. package/src/core/adaptive/guess_based_chooser.ts +9 -8
  100. package/src/core/adaptive/network_analyzer.ts +9 -4
  101. package/src/core/adaptive/utils/representation_score_calculator.ts +22 -2
  102. package/src/core/api/debug/render.ts +1 -1
  103. package/src/core/api/playback_observer.ts +1 -0
  104. package/src/core/api/public_api.ts +277 -44
  105. package/src/core/api/track_management/media_element_tracks_store.ts +17 -8
  106. package/src/core/api/track_management/track_dispatcher.ts +37 -14
  107. package/src/core/api/track_management/tracks_store.ts +77 -167
  108. package/src/core/api/utils.ts +26 -0
  109. package/src/core/decrypt/session_events_listener.ts +6 -1
  110. package/src/core/decrypt/utils/clean_old_loaded_sessions.ts +2 -1
  111. package/src/core/decrypt/utils/loaded_sessions_store.ts +8 -1
  112. package/src/core/init/directfile_content_initializer.ts +1 -0
  113. package/src/core/init/media_source_content_initializer.ts +52 -9
  114. package/src/core/init/types.ts +9 -1
  115. package/src/core/init/utils/content_time_boundaries_observer.ts +46 -10
  116. package/src/core/init/utils/{media_duration_updater.ts → media_source_duration_updater.ts} +100 -112
  117. package/src/core/init/utils/rebuffering_controller.ts +114 -3
  118. package/src/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.ts +56 -55
  119. package/src/core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts +16 -0
  120. package/src/core/segment_buffers/implementations/text/native/native_text_segment_buffer.ts +16 -0
  121. package/src/core/segment_buffers/implementations/types.ts +16 -4
  122. package/src/core/segment_buffers/index.ts +2 -0
  123. package/src/core/stream/adaptation/utils/create_representation_estimator.ts +114 -0
  124. package/src/core/stream/orchestrator/stream_orchestrator.ts +16 -8
  125. package/src/core/stream/period/period_stream.ts +2 -1
  126. package/src/core/stream/representation/representation_stream.ts +34 -22
  127. package/src/core/stream/representation/utils/append_segment_to_buffer.ts +8 -3
  128. package/src/core/stream/representation/utils/push_init_segment.ts +11 -6
  129. package/src/core/stream/representation/utils/push_media_segment.ts +3 -3
  130. package/src/default_config.ts +29 -2
  131. package/src/errors/__tests__/media_error.test.ts +6 -6
  132. package/src/errors/index.ts +4 -1
  133. package/src/errors/media_error.ts +67 -1
  134. package/src/experimental/tools/VideoThumbnailLoader/load_and_push_segment.ts +10 -7
  135. package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.ts +17 -6
  136. package/src/experimental/tools/mediaCapabilitiesProber/index.ts +0 -4
  137. package/src/manifest/__tests__/manifest.test.ts +7 -7
  138. package/src/manifest/__tests__/period.test.ts +90 -45
  139. package/src/manifest/adaptation.ts +89 -1
  140. package/src/manifest/manifest.ts +1 -1
  141. package/src/manifest/period.ts +4 -2
  142. package/src/manifest/representation.ts +67 -1
  143. package/src/manifest/utils.ts +1 -3
  144. package/src/parsers/manifest/dash/js-parser/parse_from_document.ts +1 -1
  145. package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +1 -0
  146. package/src/parsers/texttracks/ttml/parse_ttml.ts +1 -1
  147. package/src/public_types.ts +16 -1
  148. package/src/tools/TextTrackRenderer/text_track_renderer.ts +1 -1
  149. package/src/transports/smooth/isobmff/create_boxes.ts +4 -6
  150. package/src/typings/globals.d.ts +20 -20
  151. package/src/utils/is_null_or_undefined.ts +1 -1
  152. package/dist/_esm5.processed/core/init/utils/media_duration_updater.d.ts +0 -56
  153. package/scripts/doc-generator/construct_table_of_contents.js +0 -76
  154. package/scripts/doc-generator/convert_MD_to_HMTL.js +0 -26
  155. package/scripts/doc-generator/create_documentation.js +0 -331
  156. package/scripts/doc-generator/create_documentation_page.js +0 -209
  157. package/scripts/doc-generator/create_page.js +0 -210
  158. package/scripts/doc-generator/generate_header_html.js +0 -147
  159. package/scripts/doc-generator/generate_page_html.js +0 -115
  160. package/scripts/doc-generator/generate_page_list_html.js +0 -92
  161. package/scripts/doc-generator/generate_sidebar_html.js +0 -85
  162. package/scripts/doc-generator/get_search_data_for_content.js +0 -137
  163. package/scripts/doc-generator/index.js +0 -34
  164. package/scripts/doc-generator/parse_doc_configs.js +0 -327
  165. package/scripts/doc-generator/scripts/lunr.js +0 -10
  166. package/scripts/doc-generator/scripts/script.js +0 -451
  167. package/scripts/doc-generator/styles/code.css +0 -99
  168. package/scripts/doc-generator/styles/style.css +0 -835
  169. package/scripts/doc-generator/utils.js +0 -74
@@ -42,7 +42,7 @@ var Period = /** @class */ (function () {
42
42
  .map(function (adaptation) {
43
43
  var newAdaptation = new Adaptation(adaptation, { representationFilter: representationFilter });
44
44
  if (newAdaptation.representations.length > 0 && !newAdaptation.isSupported) {
45
- var error = new MediaError("MANIFEST_INCOMPATIBLE_CODECS_ERROR", "An Adaptation contains only incompatible codecs.");
45
+ var error = new MediaError("MANIFEST_INCOMPATIBLE_CODECS_ERROR", "An Adaptation contains only incompatible codecs.", { adaptation: newAdaptation });
46
46
  _this.contentWarnings.push(error);
47
47
  }
48
48
  return newAdaptation;
@@ -53,7 +53,7 @@ var Period = /** @class */ (function () {
53
53
  if (filteredAdaptations.every(function (adaptation) { return !adaptation.isSupported; }) &&
54
54
  adaptationsForType.length > 0 &&
55
55
  (type === "video" || type === "audio")) {
56
- throw new MediaError("MANIFEST_INCOMPATIBLE_CODECS_ERROR", "No supported " + type + " adaptations");
56
+ throw new MediaError("MANIFEST_INCOMPATIBLE_CODECS_ERROR", "No supported " + type + " adaptations", { adaptation: undefined });
57
57
  }
58
58
  if (filteredAdaptations.length > 0) {
59
59
  acc[type] = filteredAdaptations;
@@ -14,15 +14,36 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { ICdnMetadata, IContentProtections, IParsedRepresentation } from "../parsers/manifest";
17
- import { ITrackType, IHDRInformation } from "../public_types";
17
+ import { IAudioRepresentation, ITrackType, IHDRInformation, IVideoRepresentation } from "../public_types";
18
18
  import { IRepresentationIndex } from "./representation_index";
19
19
  /**
20
20
  * Normalized Representation structure.
21
21
  * @class Representation
22
22
  */
23
23
  declare class Representation {
24
- /** ID uniquely identifying the Representation in the Adaptation. */
24
+ /**
25
+ * ID uniquely identifying the `Representation` in its parent `Adaptation`.
26
+ *
27
+ * This identifier might be linked to an identifier present in the original
28
+ * Manifest file, it is thus the identifier to use to determine if a
29
+ * `Representation` from a refreshed `Manifest` is actually the same one than
30
+ * one in the previously loaded Manifest (as long as the `Adaptation` and
31
+ * `Period` are also the same).
32
+ *
33
+ * For a globally unique identifier regardless of the `Adaptation`, `Period`
34
+ * or even `Manifest`, you can rely on `uniqueId` instead.
35
+ */
25
36
  readonly id: string;
37
+ /**
38
+ * Globally unique identifier for this `Representation` object.
39
+ *
40
+ * This identifier is guaranteed to be unique for any `Representation`s of all
41
+ * `Manifest` objects created in the current JS Realm.
42
+ * As such, it can be used as an identifier for the JS object itself, whereas
43
+ * `id` is the identifier for the original Manifest's Representation in the
44
+ * scope of its parent `Adaptation`.
45
+ */
46
+ readonly uniqueId: string;
26
47
  /**
27
48
  * Interface allowing to get information about segments available for this
28
49
  * Representation.
@@ -165,6 +186,16 @@ declare class Representation {
165
186
  systemId: string;
166
187
  data: Uint8Array;
167
188
  }>): boolean;
189
+ /**
190
+ * Format Representation as an `IAudioRepresentation`.
191
+ * @returns {Object}
192
+ */
193
+ toAudioRepresentation(): IAudioRepresentation;
194
+ /**
195
+ * Format Representation as an `IVideoRepresentation`.
196
+ * @returns {Object}
197
+ */
198
+ toVideoRepresentation(): IVideoRepresentation;
168
199
  /**
169
200
  * Returns `true` if this Representation can be played (that is: not
170
201
  * undecipherable and with a supported codec).
@@ -16,6 +16,8 @@
16
16
  import { isCodecSupported } from "../compat";
17
17
  import log from "../log";
18
18
  import areArraysOfNumbersEqual from "../utils/are_arrays_of_numbers_equal";
19
+ import idGenerator from "../utils/id_generator";
20
+ var generateRepresentationUniqueId = idGenerator();
19
21
  /**
20
22
  * Normalized Representation structure.
21
23
  * @class Representation
@@ -26,6 +28,7 @@ var Representation = /** @class */ (function () {
26
28
  */
27
29
  function Representation(args, opts) {
28
30
  this.id = args.id;
31
+ this.uniqueId = generateRepresentationUniqueId();
29
32
  this.bitrate = args.bitrate;
30
33
  this.codec = args.codecs;
31
34
  if (args.height !== undefined) {
@@ -225,6 +228,24 @@ var Representation = /** @class */ (function () {
225
228
  values: data });
226
229
  return true;
227
230
  };
231
+ /**
232
+ * Format Representation as an `IAudioRepresentation`.
233
+ * @returns {Object}
234
+ */
235
+ Representation.prototype.toAudioRepresentation = function () {
236
+ var _a = this, id = _a.id, bitrate = _a.bitrate, codec = _a.codec, isSupported = _a.isSupported, decipherable = _a.decipherable;
237
+ return { id: id, bitrate: bitrate, codec: codec, isCodecSupported: isSupported,
238
+ seemsDecipherable: decipherable };
239
+ };
240
+ /**
241
+ * Format Representation as an `IVideoRepresentation`.
242
+ * @returns {Object}
243
+ */
244
+ Representation.prototype.toVideoRepresentation = function () {
245
+ var _a = this, id = _a.id, bitrate = _a.bitrate, frameRate = _a.frameRate, width = _a.width, height = _a.height, codec = _a.codec, hdrInfo = _a.hdrInfo, isSupported = _a.isSupported, decipherable = _a.decipherable;
246
+ return { id: id, bitrate: bitrate, frameRate: frameRate, width: width, height: height, codec: codec, hdrInfo: hdrInfo, isCodecSupported: isSupported,
247
+ seemsDecipherable: decipherable };
248
+ };
228
249
  /**
229
250
  * Returns `true` if this Representation can be played (that is: not
230
251
  * undecipherable and with a supported codec).
@@ -22,9 +22,7 @@ import isNullOrUndefined from "../utils/is_null_or_undefined";
22
22
  */
23
23
  export function areSameContent(content1, content2) {
24
24
  return (content1.segment.id === content2.segment.id &&
25
- content1.representation.id === content2.representation.id &&
26
- content1.adaptation.id === content2.adaptation.id &&
27
- content1.period.id === content2.period.id);
25
+ content1.representation.uniqueId === content2.representation.uniqueId);
28
26
  }
29
27
  /**
30
28
  * Get string describing a given ISegment, useful for log functions.
@@ -17,7 +17,7 @@ import { IMPDParserArguments } from "../common";
17
17
  import { IDashParserResponse } from "../parsers_types";
18
18
  /**
19
19
  * Parse MPD through the JS parser, on a `Document` instance.
20
- * @param {Document} manifest - Original manifest as returned by the server
20
+ * @param {Document} document - Original manifest as returned by the server
21
21
  * @param {Object} args - Various parsing options and information.
22
22
  * @returns {Object} - Response returned by the DASH-JS parser.
23
23
  */
@@ -20,7 +20,7 @@ import { createMPDIntermediateRepresentation, } from "./node_parsers/MPD";
20
20
  import { createPeriodIntermediateRepresentation, } from "./node_parsers/Period";
21
21
  /**
22
22
  * Parse MPD through the JS parser, on a `Document` instance.
23
- * @param {Document} manifest - Original manifest as returned by the server
23
+ * @param {Document} document - Original manifest as returned by the server
24
24
  * @param {Object} args - Various parsing options and information.
25
25
  * @returns {Object} - Response returned by the DASH-JS parser.
26
26
  */
@@ -230,6 +230,7 @@ var DashWasmParser = /** @class */ (function () {
230
230
  "Unknown error";
231
231
  log.warn("DW: Could not create DASH-WASM parser:", message);
232
232
  _this.status = "failure";
233
+ throw err;
233
234
  });
234
235
  return [2 /*return*/, this._initProm];
235
236
  });
@@ -14,10 +14,11 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { IPersistentSessionInfoV0, IPersistentSessionInfoV1, IPersistentSessionInfoV2, IPersistentSessionInfoV3, IPersistentSessionInfoV4 } from "./core/decrypt";
17
- import { EncryptedMediaError, MediaError, NetworkError, OtherError } from "./errors";
17
+ import { IMediaErrorTrackContext, EncryptedMediaError, MediaError, NetworkError, OtherError } from "./errors";
18
18
  import Manifest from "./manifest";
19
19
  import { ILocalManifest } from "./parsers/manifest/local";
20
20
  import { IMetaPlaylist } from "./parsers/manifest/metaplaylist/metaplaylist_parser";
21
+ export { IMediaErrorTrackContext };
21
22
  /**
22
23
  * This file defines and exports types we want to expose to library users.
23
24
  * Those types are considered as part of the API.
@@ -584,6 +585,8 @@ export interface IAudioRepresentation {
584
585
  id: string | number;
585
586
  bitrate?: number | undefined;
586
587
  codec?: string | undefined;
588
+ isCodecSupported?: boolean | undefined;
589
+ seemsDecipherable?: boolean | undefined;
587
590
  }
588
591
  /** Audio track returned by the RxPlayer. */
589
592
  export interface IAudioTrack {
@@ -609,7 +612,7 @@ export interface ITextTrack {
609
612
  * Kept equal to `language` if the attempt failed.
610
613
  */
611
614
  normalized: string;
612
- forced?: boolean | undefined;
615
+ forced: boolean | undefined;
613
616
  closedCaption: boolean;
614
617
  label?: string | undefined;
615
618
  id: number | string;
@@ -626,6 +629,8 @@ export interface IVideoRepresentation {
626
629
  codec?: string | undefined;
627
630
  frameRate?: number | undefined;
628
631
  hdrInfo?: IHDRInformation | undefined;
632
+ isCodecSupported?: boolean | undefined;
633
+ seemsDecipherable?: boolean | undefined;
629
634
  }
630
635
  /** Video track returned by the RxPlayer. */
631
636
  export interface IVideoTrack {
@@ -786,8 +791,14 @@ export interface ITrackUpdateEventPayload {
786
791
  "manual" | // Manually and explicitely updated
787
792
  "trickmode-enabled" | // Video trickmode tracks being enabled
788
793
  "trickmode-disabled" | // Video trickmode tracks being disabled
794
+ "no-playable-representation" | // Previous track had no playable Representation
789
795
  string;
790
796
  }
797
+ export interface IRepresentationListUpdateContext {
798
+ period: IPeriod;
799
+ trackType: ITrackType;
800
+ reason: "decipherability-update" | string;
801
+ }
791
802
  export interface ILockedVideoRepresentationsSettings {
792
803
  representations: string[];
793
804
  periodId?: string | undefined;
@@ -814,4 +825,3 @@ export interface ITextTrackSetting {
814
825
  trackId: string;
815
826
  periodId?: string | undefined;
816
827
  }
817
- export {};
@@ -52,7 +52,7 @@ var TextTrackRenderer = /** @class */ (function () {
52
52
  args.timeOffset :
53
53
  0;
54
54
  this._segmentBuffer.pushChunkSync({ inventoryInfos: null,
55
- data: { initSegment: null,
55
+ data: { initSegmentUniqueId: null,
56
56
  codec: args.type, timestampOffset: timestampOffset, appendWindow: [0, Infinity],
57
57
  chunk: { start: 0,
58
58
  end: Number.MAX_VALUE,
@@ -18,7 +18,7 @@
18
18
  * @param {Number} height
19
19
  * @param {Number} hRes - horizontal resolution, eg 72
20
20
  * @param {Number} vRes - vertical resolution, eg 72
21
- * @param {string} encDepth
21
+ * @param {string} encName
22
22
  * @param {Number} colorDepth - eg 24
23
23
  * @param {Uint8Array} avcc - Uint8Array representing the avcC atom
24
24
  * @returns {Uint8Array}
@@ -29,7 +29,7 @@ declare function createAVC1Box(width: number, height: number, hRes: number, vRes
29
29
  * @param {Number} height
30
30
  * @param {Number} hRes - horizontal resolution, eg 72
31
31
  * @param {Number} vRes - vertical resolution, eg 72
32
- * @param {string} encDepth
32
+ * @param {string} encName
33
33
  * @param {Number} colorDepth - eg 24
34
34
  * @param {Uint8Array} avcc - Uint8Array representing the avcC atom
35
35
  * @param {Uint8Array} sinf - Uint8Array representing the sinf atom
@@ -43,8 +43,6 @@ declare function createENCVBox(width: number, height: number, hRes: number, vRes
43
43
  * @param {Number} packetSize
44
44
  * @param {Number} sampleRate
45
45
  * @param {Uint8Array} esds - Uint8Array representing the esds atom
46
- * @param {Uint8Array} [sinf] - Uint8Array representing the sinf atom,
47
- * only if name == "enca"
48
46
  * @returns {Uint8Array}
49
47
  */
50
48
  declare function createMP4ABox(drefIdx: number, channelsCount: number, sampleSize: number, packetSize: number, sampleRate: number, esds: Uint8Array): Uint8Array;
@@ -61,7 +59,7 @@ declare function createMP4ABox(drefIdx: number, channelsCount: number, sampleSiz
61
59
  */
62
60
  declare function createENCABox(drefIdx: number, channelsCount: number, sampleSize: number, packetSize: number, sampleRate: number, esds: Uint8Array, sinf: Uint8Array): Uint8Array;
63
61
  /**
64
- * @param {url} Uint8Array
62
+ * @param {Uint8Array} url
65
63
  * @returns {Uint8Array}
66
64
  */
67
65
  declare function createDREFBox(url: Uint8Array): Uint8Array;
@@ -151,7 +149,7 @@ declare function createSAIZBox(sencContent: Uint8Array): Uint8Array;
151
149
  */
152
150
  declare function createSMHDBox(): Uint8Array;
153
151
  /**
154
- * @param {Array.<Uint8Array>} representations - arrays of Uint8Array,
152
+ * @param {Array.<Uint8Array>} reps - arrays of Uint8Array,
155
153
  * typically [avc1] or [encv, avc1]
156
154
  * @returns {Uint8Array}
157
155
  */
@@ -21,7 +21,7 @@ import { hexToBytes, strToUtf8, } from "../../../utils/string_parsing";
21
21
  * @param {Number} height
22
22
  * @param {Number} hRes - horizontal resolution, eg 72
23
23
  * @param {Number} vRes - vertical resolution, eg 72
24
- * @param {string} encDepth
24
+ * @param {string} encName
25
25
  * @param {Number} colorDepth - eg 24
26
26
  * @param {Uint8Array} avcc - Uint8Array representing the avcC atom
27
27
  * @returns {Uint8Array}
@@ -46,7 +46,7 @@ function createAVC1Box(width, height, hRes, vRes, encName, colorDepth, avcc) {
46
46
  * @param {Number} height
47
47
  * @param {Number} hRes - horizontal resolution, eg 72
48
48
  * @param {Number} vRes - vertical resolution, eg 72
49
- * @param {string} encDepth
49
+ * @param {string} encName
50
50
  * @param {Number} colorDepth - eg 24
51
51
  * @param {Uint8Array} avcc - Uint8Array representing the avcC atom
52
52
  * @param {Uint8Array} sinf - Uint8Array representing the sinf atom
@@ -74,8 +74,6 @@ function createENCVBox(width, height, hRes, vRes, encName, colorDepth, avcc, sin
74
74
  * @param {Number} packetSize
75
75
  * @param {Number} sampleRate
76
76
  * @param {Uint8Array} esds - Uint8Array representing the esds atom
77
- * @param {Uint8Array} [sinf] - Uint8Array representing the sinf atom,
78
- * only if name == "enca"
79
77
  * @returns {Uint8Array}
80
78
  */
81
79
  function createMP4ABox(drefIdx, channelsCount, sampleSize, packetSize, sampleRate, esds) {
@@ -96,7 +94,7 @@ function createENCABox(drefIdx, channelsCount, sampleSize, packetSize, sampleRat
96
94
  return createBox("enca", concat(6, itobe2(drefIdx), 8, itobe2(channelsCount), itobe2(sampleSize), 2, itobe2(packetSize), itobe2(sampleRate), 2, esds, sinf));
97
95
  }
98
96
  /**
99
- * @param {url} Uint8Array
97
+ * @param {Uint8Array} url
100
98
  * @returns {Uint8Array}
101
99
  */
102
100
  function createDREFBox(url) {
@@ -291,7 +289,7 @@ function createSMHDBox() {
291
289
  return createBox("smhd", new Uint8Array(8));
292
290
  }
293
291
  /**
294
- * @param {Array.<Uint8Array>} representations - arrays of Uint8Array,
292
+ * @param {Array.<Uint8Array>} reps - arrays of Uint8Array,
295
293
  * typically [avc1] or [encv, avc1]
296
294
  * @returns {Uint8Array}
297
295
  */
@@ -19,6 +19,6 @@
19
19
  * not always understood by newcomers to the code, and which can be overused when
20
20
  * only one of the possibility can arise.
21
21
  * @param {*} x
22
- * @returns {*}
22
+ * @returns {boolean}
23
23
  */
24
24
  export default function isNullOrUndefined(x: unknown): x is null | undefined | void;
@@ -19,7 +19,7 @@
19
19
  * not always understood by newcomers to the code, and which can be overused when
20
20
  * only one of the possibility can arise.
21
21
  * @param {*} x
22
- * @returns {*}
22
+ * @returns {boolean}
23
23
  */
24
24
  export default function isNullOrUndefined(x) {
25
25
  return x === null || x === undefined;
Binary file