rx-player 3.30.1-dev.2023032800 → 3.31.0-dev.2023052200

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 (96) hide show
  1. package/CHANGELOG.md +14 -2
  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/has_issues_with_high_media_source_duration.d.ts +21 -0
  8. package/dist/_esm5.processed/compat/has_issues_with_high_media_source_duration.js +26 -0
  9. package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.js +1 -2
  10. package/dist/_esm5.processed/core/adaptive/buffer_based_chooser.d.ts +18 -1
  11. package/dist/_esm5.processed/core/adaptive/buffer_based_chooser.js +105 -24
  12. package/dist/_esm5.processed/core/adaptive/guess_based_chooser.js +6 -6
  13. package/dist/_esm5.processed/core/adaptive/utils/representation_score_calculator.d.ts +19 -1
  14. package/dist/_esm5.processed/core/adaptive/utils/representation_score_calculator.js +1 -1
  15. package/dist/_esm5.processed/core/api/debug/render.js +1 -1
  16. package/dist/_esm5.processed/core/api/public_api.js +2 -2
  17. package/dist/_esm5.processed/core/api/tracks_management/media_element_track_choice_manager.js +10 -1
  18. package/dist/_esm5.processed/core/api/tracks_management/track_choice_manager.js +20 -117
  19. package/dist/_esm5.processed/core/init/media_source_content_initializer.js +28 -3
  20. package/dist/_esm5.processed/core/init/utils/media_source_duration_updater.d.ts +2 -2
  21. package/dist/_esm5.processed/core/init/utils/media_source_duration_updater.js +29 -18
  22. package/dist/_esm5.processed/core/segment_buffers/index.d.ts +2 -2
  23. package/dist/_esm5.processed/core/stream/adaptation/utils/create_representation_estimator.js +1 -1
  24. package/dist/_esm5.processed/core/stream/period/period_stream.js +1 -1
  25. package/dist/_esm5.processed/core/stream/representation/utils/append_segment_to_buffer.d.ts +4 -2
  26. package/dist/_esm5.processed/core/stream/representation/utils/append_segment_to_buffer.js +2 -2
  27. package/dist/_esm5.processed/core/stream/representation/utils/push_init_segment.js +6 -2
  28. package/dist/_esm5.processed/errors/index.d.ts +2 -2
  29. package/dist/_esm5.processed/errors/media_error.d.ts +23 -1
  30. package/dist/_esm5.processed/errors/media_error.js +18 -5
  31. package/dist/_esm5.processed/manifest/adaptation.d.ts +17 -2
  32. package/dist/_esm5.processed/manifest/adaptation.js +67 -1
  33. package/dist/_esm5.processed/manifest/manifest.d.ts +1 -1
  34. package/dist/_esm5.processed/manifest/manifest.js +3 -3
  35. package/dist/_esm5.processed/manifest/period.js +1 -1
  36. package/dist/_esm5.processed/manifest/representation.d.ts +11 -1
  37. package/dist/_esm5.processed/manifest/representation.js +16 -0
  38. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/parse_from_document.d.ts +1 -1
  39. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/parse_from_document.js +1 -1
  40. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +1 -0
  41. package/dist/_esm5.processed/public_types.d.ts +6 -5
  42. package/dist/_esm5.processed/transports/smooth/isobmff/create_boxes.d.ts +4 -6
  43. package/dist/_esm5.processed/transports/smooth/isobmff/create_boxes.js +4 -6
  44. package/dist/rx-player.js +3086 -3024
  45. package/dist/rx-player.min.js +1 -1
  46. package/package.json +25 -26
  47. package/sonar-project.properties +1 -1
  48. package/src/compat/browser_detection.ts +7 -1
  49. package/src/compat/has_issues_with_high_media_source_duration.ts +27 -0
  50. package/src/core/adaptive/__tests__/buffer_based_chooser.test.ts +147 -48
  51. package/src/core/adaptive/adaptive_representation_selector.ts +1 -2
  52. package/src/core/adaptive/buffer_based_chooser.ts +143 -25
  53. package/src/core/adaptive/guess_based_chooser.ts +9 -8
  54. package/src/core/adaptive/utils/representation_score_calculator.ts +22 -2
  55. package/src/core/api/debug/render.ts +1 -1
  56. package/src/core/api/public_api.ts +2 -2
  57. package/src/core/api/tracks_management/media_element_track_choice_manager.ts +17 -8
  58. package/src/core/api/tracks_management/track_choice_manager.ts +20 -132
  59. package/src/core/init/media_source_content_initializer.ts +32 -4
  60. package/src/core/init/utils/media_source_duration_updater.ts +31 -19
  61. package/src/core/segment_buffers/index.ts +2 -0
  62. package/src/core/stream/adaptation/utils/create_representation_estimator.ts +2 -1
  63. package/src/core/stream/period/period_stream.ts +2 -1
  64. package/src/core/stream/representation/utils/append_segment_to_buffer.ts +8 -3
  65. package/src/core/stream/representation/utils/push_init_segment.ts +7 -1
  66. package/src/errors/__tests__/media_error.test.ts +6 -6
  67. package/src/errors/index.ts +4 -1
  68. package/src/errors/media_error.ts +67 -1
  69. package/src/manifest/__tests__/period.test.ts +90 -45
  70. package/src/manifest/adaptation.ts +77 -2
  71. package/src/manifest/manifest.ts +5 -3
  72. package/src/manifest/period.ts +2 -1
  73. package/src/manifest/representation.ts +23 -1
  74. package/src/parsers/manifest/dash/js-parser/parse_from_document.ts +1 -1
  75. package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +1 -0
  76. package/src/parsers/texttracks/ttml/parse_ttml.ts +1 -1
  77. package/src/public_types.ts +8 -3
  78. package/src/transports/smooth/isobmff/create_boxes.ts +4 -6
  79. package/src/typings/globals.d.ts +21 -21
  80. package/scripts/doc-generator/construct_table_of_contents.js +0 -76
  81. package/scripts/doc-generator/convert_MD_to_HMTL.js +0 -26
  82. package/scripts/doc-generator/create_documentation.js +0 -331
  83. package/scripts/doc-generator/create_documentation_page.js +0 -209
  84. package/scripts/doc-generator/create_page.js +0 -210
  85. package/scripts/doc-generator/generate_header_html.js +0 -147
  86. package/scripts/doc-generator/generate_page_html.js +0 -115
  87. package/scripts/doc-generator/generate_page_list_html.js +0 -92
  88. package/scripts/doc-generator/generate_sidebar_html.js +0 -85
  89. package/scripts/doc-generator/get_search_data_for_content.js +0 -137
  90. package/scripts/doc-generator/index.js +0 -34
  91. package/scripts/doc-generator/parse_doc_configs.js +0 -327
  92. package/scripts/doc-generator/scripts/lunr.js +0 -10
  93. package/scripts/doc-generator/scripts/script.js +0 -451
  94. package/scripts/doc-generator/styles/code.css +0 -99
  95. package/scripts/doc-generator/styles/style.css +0 -835
  96. package/scripts/doc-generator/utils.js +0 -74
@@ -16,10 +16,11 @@
16
16
  import { ICustomMediaKeySession } from "./compat";
17
17
  import { IPersistentSessionInfoV0, IPersistentSessionInfoV1, IPersistentSessionInfoV2, IPersistentSessionInfoV3, IPersistentSessionInfoV4 } from "./core/decrypt";
18
18
  import { IBufferType } from "./core/segment_buffers";
19
- import { EncryptedMediaError, MediaError, NetworkError, OtherError } from "./errors";
19
+ import { IMediaErrorTrackContext, EncryptedMediaError, MediaError, NetworkError, OtherError } from "./errors";
20
20
  import Manifest from "./manifest";
21
21
  import { ILocalManifest } from "./parsers/manifest/local";
22
22
  import { IMetaPlaylist } from "./parsers/manifest/metaplaylist/metaplaylist_parser";
23
+ export { IMediaErrorTrackContext };
23
24
  /**
24
25
  * This file defines and exports types we want to expose to library users.
25
26
  * Those types are considered as part of the API.
@@ -197,11 +198,12 @@ export interface IPeriod {
197
198
  image?: IAdaptation[];
198
199
  };
199
200
  }
201
+ export type IAdaptationType = "video" | "audio" | "text" | "image";
200
202
  /** Adaptation (represents a track), as documented in the API documentation. */
201
203
  export interface IAdaptation {
202
204
  /** String identifying the Adaptation, unique per Period. */
203
205
  id: string;
204
- type: "video" | "audio" | "text" | "image";
206
+ type: IAdaptationType;
205
207
  language?: string | undefined;
206
208
  normalizedLanguage?: string | undefined;
207
209
  isAudioDescription?: boolean | undefined;
@@ -674,8 +676,8 @@ export interface ITextTrack {
674
676
  language: string;
675
677
  normalized: string;
676
678
  closedCaption: boolean;
677
- forced?: boolean | undefined;
678
- label?: string | undefined;
679
+ forced: boolean | undefined;
680
+ label: string | undefined;
679
681
  id: number | string;
680
682
  }
681
683
  /**
@@ -729,4 +731,3 @@ export interface IEncryptedMediaErrorKeyStatusObject {
729
731
  /** Problematic MediaKeyStatus encountered. */
730
732
  keyStatus: MediaKeyStatus;
731
733
  }
732
- export {};
@@ -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
  */