rx-player 4.0.0-dev.2024022600 → 4.0.0-dev.2024030500
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.
- package/VERSION +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/commonjs/compat/browser_detection.d.ts +3 -1
- package/dist/commonjs/compat/browser_detection.js +8 -2
- package/dist/commonjs/compat/has_worker_api.d.ts +9 -0
- package/dist/commonjs/compat/has_worker_api.js +17 -0
- package/dist/commonjs/core/main/common/create_content_time_boundaries_observer.d.ts +1 -1
- package/dist/commonjs/core/main/common/create_content_time_boundaries_observer.js +1 -1
- package/dist/commonjs/core/main/worker/worker_main.js +8 -9
- package/dist/commonjs/core/segment_sinks/implementations/audio_video/audio_video_segment_buffer.d.ts +1 -1
- package/dist/commonjs/core/segment_sinks/implementations/audio_video/audio_video_segment_buffer.js +1 -1
- package/dist/commonjs/core/segment_sinks/segment_buffers_store.d.ts +1 -1
- package/dist/commonjs/core/segment_sinks/segment_buffers_store.js +1 -1
- package/dist/commonjs/features/features_object.js +1 -1
- package/dist/commonjs/features/list/dash.js +2 -2
- package/dist/commonjs/features/types.d.ts +8 -3
- package/dist/commonjs/main_thread/api/public_api.js +4 -8
- package/dist/commonjs/main_thread/init/utils/get_loaded_reference.js +5 -0
- package/dist/commonjs/multithread_types.d.ts +1 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.d.ts +4 -3
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.js +11 -4
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.d.ts +2 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.js +12 -3
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.d.ts +3 -2
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.js +22 -11
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts +11 -2
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +74 -3
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +2 -1
- package/dist/commonjs/parsers/manifest/dash/common/parse_periods.js +3 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/index.d.ts +17 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/index.js +19 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts +24 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +400 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.d.ts +24 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.js +33 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.d.ts +23 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.js +70 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.d.ts +22 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.js +118 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.d.ts +23 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.js +154 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.d.ts +22 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.js +70 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts +23 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +221 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts +23 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +179 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts +22 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +256 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.d.ts +23 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.js +152 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.d.ts +22 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.js +60 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.d.ts +24 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.js +125 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.d.ts +22 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.js +36 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.d.ts +24 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.js +82 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/utils.d.ts +176 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/utils.js +382 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.d.ts +24 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.js +142 -0
- package/dist/commonjs/parsers/manifest/dash/node_parser_types.d.ts +5 -3
- package/dist/commonjs/public_types.d.ts +1 -1
- package/dist/commonjs/transports/dash/manifest_parser.js +33 -4
- package/dist/commonjs/utils/xml-parser.d.ts +70 -0
- package/dist/commonjs/utils/xml-parser.js +357 -0
- package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/es2017/compat/browser_detection.d.ts +3 -1
- package/dist/es2017/compat/browser_detection.js +7 -2
- package/dist/es2017/compat/has_worker_api.d.ts +9 -0
- package/dist/es2017/compat/has_worker_api.js +14 -0
- package/dist/es2017/core/main/common/create_content_time_boundaries_observer.d.ts +1 -1
- package/dist/es2017/core/main/common/create_content_time_boundaries_observer.js +1 -1
- package/dist/es2017/core/main/worker/worker_main.js +8 -9
- package/dist/es2017/core/segment_sinks/implementations/audio_video/audio_video_segment_buffer.d.ts +1 -1
- package/dist/es2017/core/segment_sinks/implementations/audio_video/audio_video_segment_buffer.js +1 -1
- package/dist/es2017/core/segment_sinks/segment_buffers_store.d.ts +1 -1
- package/dist/es2017/core/segment_sinks/segment_buffers_store.js +1 -1
- package/dist/es2017/features/features_object.js +1 -1
- package/dist/es2017/features/list/dash.js +2 -2
- package/dist/es2017/features/types.d.ts +8 -3
- package/dist/es2017/main_thread/api/public_api.js +4 -8
- package/dist/es2017/main_thread/init/utils/get_loaded_reference.js +5 -0
- package/dist/es2017/multithread_types.d.ts +1 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.d.ts +4 -3
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.js +12 -5
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.d.ts +2 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.js +13 -4
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.d.ts +3 -2
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.js +22 -11
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts +11 -2
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +49 -2
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +2 -1
- package/dist/es2017/parsers/manifest/dash/common/parse_periods.js +3 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/index.d.ts +17 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/index.js +17 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts +24 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +358 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.d.ts +24 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.js +30 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.d.ts +23 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.js +45 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.d.ts +22 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.js +77 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.d.ts +23 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.js +101 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.d.ts +22 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.js +45 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts +23 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +179 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts +23 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +137 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts +22 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +214 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.d.ts +23 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.js +111 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.d.ts +22 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.js +41 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.d.ts +24 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.js +84 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.d.ts +22 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.js +33 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.d.ts +24 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.js +57 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/utils.d.ts +176 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/utils.js +310 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.d.ts +24 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.js +114 -0
- package/dist/es2017/parsers/manifest/dash/node_parser_types.d.ts +5 -3
- package/dist/es2017/public_types.d.ts +1 -1
- package/dist/es2017/transports/dash/manifest_parser.js +33 -4
- package/dist/es2017/utils/xml-parser.d.ts +70 -0
- package/dist/es2017/utils/xml-parser.js +322 -0
- package/dist/mpd-parser.wasm +0 -0
- package/dist/rx-player.js +166 -67
- package/dist/rx-player.min.js +1 -1
- package/dist/worker.js +8 -3
- package/package.json +1 -1
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/index.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/index.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/AdaptationSet.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/AdaptationSet.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/BaseURL.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/BaseURL.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentComponent.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentComponent.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentProtection.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentProtection.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/EventStream.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/EventStream.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Initialization.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Initialization.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/MPD.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/MPD.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Period.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Period.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Representation.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Representation.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentBase.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentBase.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentList.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentList.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTemplate.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTemplate.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTimeline.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTimeline.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentURL.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentURL.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/utils.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/utils.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/parse_from_document.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/parse_from_document.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/index.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/index.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/AdaptationSet.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/AdaptationSet.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/BaseURL.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/BaseURL.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentComponent.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentComponent.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentProtection.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentProtection.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/EventStream.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/EventStream.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Initialization.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Initialization.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/MPD.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/MPD.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Period.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Period.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Representation.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Representation.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentBase.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentBase.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentList.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentList.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTemplate.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTemplate.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTimeline.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTimeline.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentURL.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentURL.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/utils.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/utils.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/parse_from_document.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/parse_from_document.js +0 -0
|
@@ -37,8 +37,10 @@ declare let isWebOs2021: boolean;
|
|
|
37
37
|
declare let isWebOs2022: boolean;
|
|
38
38
|
/** `true` for Panasonic devices. */
|
|
39
39
|
declare let isPanasonic: boolean;
|
|
40
|
+
/** `true` for the PlayStation 4 game console. */
|
|
41
|
+
declare let isPlayStation4: boolean;
|
|
40
42
|
/** `true` for the PlayStation 5 game console. */
|
|
41
43
|
declare let isPlayStation5: boolean;
|
|
42
44
|
/** `true` for the Xbox game consoles. */
|
|
43
45
|
declare let isXbox: boolean;
|
|
44
|
-
export { isEdgeChromium, isIE11, isIEOrEdge, isFirefox, isPanasonic, isPlayStation5, isXbox, isSafariDesktop, isSafariMobile, isSamsungBrowser, isTizen, isWebOs, isWebOs2021, isWebOs2022, };
|
|
46
|
+
export { isEdgeChromium, isIE11, isIEOrEdge, isFirefox, isPanasonic, isPlayStation4, isPlayStation5, isXbox, isSafariDesktop, isSafariMobile, isSamsungBrowser, isTizen, isWebOs, isWebOs2021, isWebOs2022, };
|
|
@@ -39,6 +39,8 @@ let isWebOs2021 = false;
|
|
|
39
39
|
let isWebOs2022 = false;
|
|
40
40
|
/** `true` for Panasonic devices. */
|
|
41
41
|
let isPanasonic = false;
|
|
42
|
+
/** `true` for the PlayStation 4 game console. */
|
|
43
|
+
let isPlayStation4 = false;
|
|
42
44
|
/** `true` for the PlayStation 5 game console. */
|
|
43
45
|
let isPlayStation5 = false;
|
|
44
46
|
/** `true` for the Xbox game consoles. */
|
|
@@ -92,7 +94,10 @@ let isXbox = false;
|
|
|
92
94
|
if (/SamsungBrowser/.test(navigator.userAgent)) {
|
|
93
95
|
isSamsungBrowser = true;
|
|
94
96
|
}
|
|
95
|
-
if (navigator.userAgent.indexOf("PlayStation
|
|
97
|
+
if (navigator.userAgent.indexOf("PlayStation 4") !== -1) {
|
|
98
|
+
isPlayStation4 = true;
|
|
99
|
+
}
|
|
100
|
+
else if (navigator.userAgent.indexOf("PlayStation 5") !== -1) {
|
|
96
101
|
isPlayStation5 = true;
|
|
97
102
|
}
|
|
98
103
|
else if (/Tizen/.test(navigator.userAgent)) {
|
|
@@ -119,4 +124,4 @@ let isXbox = false;
|
|
|
119
124
|
isXbox = true;
|
|
120
125
|
}
|
|
121
126
|
})();
|
|
122
|
-
export { isEdgeChromium, isIE11, isIEOrEdge, isFirefox, isPanasonic, isPlayStation5, isXbox, isSafariDesktop, isSafariMobile, isSamsungBrowser, isTizen, isWebOs, isWebOs2021, isWebOs2022, };
|
|
127
|
+
export { isEdgeChromium, isIE11, isIEOrEdge, isFirefox, isPanasonic, isPlayStation4, isPlayStation5, isXbox, isSafariDesktop, isSafariMobile, isSamsungBrowser, isTizen, isWebOs, isWebOs2021, isWebOs2022, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return `true` if the current device is compatible with the Worker API.
|
|
3
|
+
*
|
|
4
|
+
* Some old webkit devices, such as the PlayStation 4, returns weird results
|
|
5
|
+
* when doing the most straightforward check. We have to check if other Webkit
|
|
6
|
+
* devices have the same issue.
|
|
7
|
+
* @returns {boolean}
|
|
8
|
+
*/
|
|
9
|
+
export default function hasWorkerApi(): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { isPlayStation4 } from "./browser_detection";
|
|
2
|
+
/**
|
|
3
|
+
* Return `true` if the current device is compatible with the Worker API.
|
|
4
|
+
*
|
|
5
|
+
* Some old webkit devices, such as the PlayStation 4, returns weird results
|
|
6
|
+
* when doing the most straightforward check. We have to check if other Webkit
|
|
7
|
+
* devices have the same issue.
|
|
8
|
+
* @returns {boolean}
|
|
9
|
+
*/
|
|
10
|
+
export default function hasWorkerApi() {
|
|
11
|
+
return isPlayStation4 ?
|
|
12
|
+
typeof Worker === "object" || typeof Worker === "function" :
|
|
13
|
+
typeof Worker === "function";
|
|
14
|
+
}
|
|
@@ -18,7 +18,7 @@ export interface IContentTimeBoundariesObserverCallbacks {
|
|
|
18
18
|
* Various methods from that class need then to be called at various events
|
|
19
19
|
* (see `ContentTimeBoundariesObserver`).
|
|
20
20
|
* @param {Object} manifest
|
|
21
|
-
* @param {
|
|
21
|
+
* @param {Object} mediaSource
|
|
22
22
|
* @param {Object} streamObserver
|
|
23
23
|
* @param {Object} segmentSinksStore
|
|
24
24
|
* @param {Object} cancelSignal
|
|
@@ -9,7 +9,7 @@ import ContentTimeBoundariesObserver from "./content_time_boundaries_observer";
|
|
|
9
9
|
* Various methods from that class need then to be called at various events
|
|
10
10
|
* (see `ContentTimeBoundariesObserver`).
|
|
11
11
|
* @param {Object} manifest
|
|
12
|
-
* @param {
|
|
12
|
+
* @param {Object} mediaSource
|
|
13
13
|
* @param {Object} streamObserver
|
|
14
14
|
* @param {Object} segmentSinksStore
|
|
15
15
|
* @param {Object} cancelSignal
|
|
@@ -5,6 +5,7 @@ import log from "../../../log";
|
|
|
5
5
|
import Manifest, { Adaptation, Period, Representation } from "../../../manifest/classes";
|
|
6
6
|
import MainCodecSupportProber from "../../../mse/main_codec_support_prober";
|
|
7
7
|
import WorkerCodecSupportProber from "../../../mse/worker_codec_support_prober";
|
|
8
|
+
import DashFastJsParser from "../../../parsers/manifest/dash/fast-js-parser";
|
|
8
9
|
import DashWasmParser from "../../../parsers/manifest/dash/wasm-parser";
|
|
9
10
|
import { ObservationPosition } from "../../../playback_observer";
|
|
10
11
|
import WorkerPlaybackObserver from "../../../playback_observer/worker_playback_observer";
|
|
@@ -46,6 +47,7 @@ export default function initializeWorkerMain() {
|
|
|
46
47
|
// TODO allow worker-side feature-switching? Not sure how
|
|
47
48
|
const dashWasmParser = new DashWasmParser();
|
|
48
49
|
features.dashParsers.wasm = dashWasmParser;
|
|
50
|
+
features.dashParsers.fastJs = DashFastJsParser;
|
|
49
51
|
features.transports.dash = createDashPipelines;
|
|
50
52
|
/**
|
|
51
53
|
* When set, emit playback observation made on the main thread.
|
|
@@ -64,16 +66,12 @@ export default function initializeWorkerMain() {
|
|
|
64
66
|
const diffWorker = Date.now() - performance.now();
|
|
65
67
|
mainThreadTimestampDiff.setValueIfChanged(diffWorker - diffMain);
|
|
66
68
|
updateLoggerLevel(msg.value.logLevel, msg.value.sendBackLogs);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
log.error("Worker: Could not initialize DASH_WASM parser", error);
|
|
72
|
-
sendMessage({
|
|
73
|
-
type: "init-error" /* WorkerMessageType.InitError */,
|
|
74
|
-
value: { errorMessage: error, kind: "dashWasmInitialization" },
|
|
69
|
+
if (msg.value.dashWasmUrl !== undefined && dashWasmParser.isCompatible()) {
|
|
70
|
+
dashWasmParser.initialize({ wasmUrl: msg.value.dashWasmUrl }).catch((err) => {
|
|
71
|
+
const error = err instanceof Error ? err.toString() : "Unknown Error";
|
|
72
|
+
log.error("Worker: Could not initialize DASH_WASM parser", error);
|
|
75
73
|
});
|
|
76
|
-
}
|
|
74
|
+
}
|
|
77
75
|
if (!msg.value.hasVideo || msg.value.hasMseInWorker) {
|
|
78
76
|
contentPreparer.disposeCurrentContent();
|
|
79
77
|
contentPreparer = new ContentPreparer({
|
|
@@ -84,6 +82,7 @@ export default function initializeWorkerMain() {
|
|
|
84
82
|
features.codecSupportProber = msg.value.hasMseInWorker
|
|
85
83
|
? MainCodecSupportProber
|
|
86
84
|
: WorkerCodecSupportProber;
|
|
85
|
+
sendMessage({ type: "init-success" /* WorkerMessageType.InitSuccess */, value: null });
|
|
87
86
|
break;
|
|
88
87
|
case "log-level-update" /* MainThreadMessageType.LogLevelUpdate */:
|
|
89
88
|
updateLoggerLevel(msg.value.logLevel, msg.value.sendBackLogs);
|
package/dist/es2017/core/segment_sinks/implementations/audio_video/audio_video_segment_buffer.d.ts
CHANGED
|
@@ -60,7 +60,7 @@ export default class AudioVideoSegmentSink extends SegmentSink {
|
|
|
60
60
|
* @constructor
|
|
61
61
|
* @param {string} bufferType
|
|
62
62
|
* @param {string} codec
|
|
63
|
-
* @param {
|
|
63
|
+
* @param {Object} mediaSource
|
|
64
64
|
*/
|
|
65
65
|
constructor(bufferType: SourceBufferType, codec: string, mediaSource: IMediaSourceInterface);
|
|
66
66
|
/** @see SegmentSink */
|
package/dist/es2017/core/segment_sinks/implementations/audio_video/audio_video_segment_buffer.js
CHANGED
|
@@ -31,7 +31,7 @@ export default class AudioVideoSegmentSink extends SegmentSink {
|
|
|
31
31
|
* @constructor
|
|
32
32
|
* @param {string} bufferType
|
|
33
33
|
* @param {string} codec
|
|
34
|
-
* @param {
|
|
34
|
+
* @param {Object} mediaSource
|
|
35
35
|
*/
|
|
36
36
|
constructor(bufferType, codec, mediaSource) {
|
|
37
37
|
super();
|
|
@@ -69,7 +69,7 @@ export default class SegmentSinksStore {
|
|
|
69
69
|
private _textInterface;
|
|
70
70
|
private _hasVideo;
|
|
71
71
|
/**
|
|
72
|
-
* @param {
|
|
72
|
+
* @param {Object} mediaSource
|
|
73
73
|
* @constructor
|
|
74
74
|
*/
|
|
75
75
|
constructor(mediaSource: IMediaSourceInterface, hasVideo: boolean, textDisplayerInterface: ITextDisplayerInterface | null);
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import MediaSourceContentInitializer from "../../main_thread/init/media_source_content_initializer";
|
|
17
17
|
import mainCodecSupportProber from "../../mse/main_codec_support_prober";
|
|
18
|
-
import dashJsParser from "../../parsers/manifest/dash/
|
|
18
|
+
import dashJsParser from "../../parsers/manifest/dash/native-parser";
|
|
19
19
|
import dash from "../../transports/dash";
|
|
20
20
|
/**
|
|
21
21
|
* Add ability to play DASH contents.
|
|
@@ -25,7 +25,7 @@ function addDASHFeature(features) {
|
|
|
25
25
|
if (features.transports.dash === undefined) {
|
|
26
26
|
features.transports.dash = dash;
|
|
27
27
|
}
|
|
28
|
-
features.dashParsers.
|
|
28
|
+
features.dashParsers.native = dashJsParser;
|
|
29
29
|
features.mainThreadMediaSourceInit = MediaSourceContentInitializer;
|
|
30
30
|
features.codecSupportProber = mainCodecSupportProber;
|
|
31
31
|
}
|
|
@@ -48,7 +48,8 @@ export type IHTMLTextTracksBuffer = new (mediaElement: HTMLMediaElement, textTra
|
|
|
48
48
|
* @returns {Object} - `SegmentSink` implementation.
|
|
49
49
|
*/
|
|
50
50
|
export type INativeTextTracksBuffer = new (mediaElement: HTMLMediaElement) => SegmentSink;
|
|
51
|
-
export type
|
|
51
|
+
export type IDashNativeParser = (dom: Document, args: IMPDParserArguments) => IDashParserResponse<string>;
|
|
52
|
+
export type IDashFastJsParser = (xml: string, args: IMPDParserArguments) => IDashParserResponse<string>;
|
|
52
53
|
/**
|
|
53
54
|
* Function implementing the optional RxPlayer debug UI element.
|
|
54
55
|
* @param {HTMLElement} parentElt - `HTMLElement` in which the debug UI
|
|
@@ -121,9 +122,13 @@ export interface IFeaturesObject {
|
|
|
121
122
|
*/
|
|
122
123
|
wasm: DashWasmParser | null;
|
|
123
124
|
/**
|
|
124
|
-
* JavaScript-based Manifest DASH parser.
|
|
125
|
+
* Entirely JavaScript-based Manifest DASH parser.
|
|
125
126
|
*/
|
|
126
|
-
|
|
127
|
+
fastJs: IDashFastJsParser | null;
|
|
128
|
+
/**
|
|
129
|
+
* JavaScript+Browser's DOMParser-based Manifest DASH parser.
|
|
130
|
+
*/
|
|
131
|
+
native: IDashNativeParser | null;
|
|
127
132
|
};
|
|
128
133
|
/** Implement text track rendering through `<track>` HTML elements. */
|
|
129
134
|
nativeTextDisplayer: typeof NativeTextDisplayer | null;
|
|
@@ -21,7 +21,7 @@ import canRelyOnVideoVisibilityAndSize from "../../compat/can_rely_on_video_visi
|
|
|
21
21
|
import { getPictureOnPictureStateRef, getVideoVisibilityRef, getElementResolutionRef, getScreenResolutionRef, } from "../../compat/event_listeners";
|
|
22
22
|
import getStartDate from "../../compat/get_start_date";
|
|
23
23
|
import hasMseInWorker from "../../compat/has_mse_in_worker";
|
|
24
|
-
import
|
|
24
|
+
import hasWorkerApi from "../../compat/has_worker_api";
|
|
25
25
|
import isDebugModeEnabled from "../../compat/is_debug_mode_enabled";
|
|
26
26
|
import { ErrorCodes, ErrorTypes, formatError, MediaError } from "../../errors";
|
|
27
27
|
import WorkerInitializationError from "../../errors/worker_initialization_error";
|
|
@@ -103,7 +103,7 @@ class Player extends EventEmitter {
|
|
|
103
103
|
// Workaround to support Firefox autoplay on FF 42.
|
|
104
104
|
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
|
|
105
105
|
videoElement.preload = "auto";
|
|
106
|
-
this.version = /* PLAYER_VERSION */ "4.0.0-dev.
|
|
106
|
+
this.version = /* PLAYER_VERSION */ "4.0.0-dev.2024030500";
|
|
107
107
|
this.log = log;
|
|
108
108
|
this.state = "STOPPED";
|
|
109
109
|
this.videoElement = videoElement;
|
|
@@ -148,14 +148,10 @@ class Player extends EventEmitter {
|
|
|
148
148
|
attachWorker(workerSettings) {
|
|
149
149
|
return new Promise((res, rej) => {
|
|
150
150
|
var _a;
|
|
151
|
-
if (
|
|
151
|
+
if (!hasWorkerApi()) {
|
|
152
152
|
log.warn("API: Cannot rely on a WebWorker: Worker API unavailable");
|
|
153
153
|
return rej(new WorkerInitializationError("INCOMPATIBLE_ERROR", "Worker unavailable"));
|
|
154
154
|
}
|
|
155
|
-
if (!hasWebassembly) {
|
|
156
|
-
log.warn("API: Cannot rely on a WebWorker: WebAssembly unavailable");
|
|
157
|
-
return rej(new WorkerInitializationError("INCOMPATIBLE_ERROR", "WebAssembly unavailable"));
|
|
158
|
-
}
|
|
159
155
|
if (typeof workerSettings.workerUrl === "string") {
|
|
160
156
|
this._priv_worker = new Worker(workerSettings.workerUrl);
|
|
161
157
|
}
|
|
@@ -2348,5 +2344,5 @@ class Player extends EventEmitter {
|
|
|
2348
2344
|
}
|
|
2349
2345
|
}
|
|
2350
2346
|
}
|
|
2351
|
-
Player.version = /* PLAYER_VERSION */ "4.0.0-dev.
|
|
2347
|
+
Player.version = /* PLAYER_VERSION */ "4.0.0-dev.2024030500";
|
|
2352
2348
|
export default Player;
|
|
@@ -38,6 +38,11 @@ export default function getLoadedReference(playbackObserver, mediaElement, isDir
|
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
40
|
if (!shouldWaitForDataBeforeLoaded(isDirectfile, mediaElement.hasAttribute("playsinline"))) {
|
|
41
|
+
// The duration is NaN if no media data is available,
|
|
42
|
+
// which means media is not loaded yet.
|
|
43
|
+
if (isNaN(mediaElement.duration)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
41
46
|
if (mediaElement.duration > 0) {
|
|
42
47
|
isLoaded.setValue(true);
|
|
43
48
|
listenCanceller.cancel();
|
|
@@ -25,7 +25,7 @@ export interface IInitMessage {
|
|
|
25
25
|
type: MainThreadMessageType.Init;
|
|
26
26
|
value: {
|
|
27
27
|
/** Link to the DASH_WASM's feature WebAssembly file to parse DASH MPDs. */
|
|
28
|
-
dashWasmUrl: string;
|
|
28
|
+
dashWasmUrl: string | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* If `true` the final element on the current page displaying the content
|
|
31
31
|
* can display video content.
|
|
@@ -13,14 +13,15 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { ITNode } from "../../../../../../utils/xml-parser";
|
|
16
17
|
import type { IIndexSegment } from "../../../../utils/index_helpers";
|
|
17
18
|
/**
|
|
18
19
|
* Allows to generate the "timeline" for the "Timeline" RepresentationIndex.
|
|
19
20
|
* Call this function when the timeline is unknown.
|
|
20
21
|
* This function was added to only perform that task lazily, i.e. only when
|
|
21
22
|
* first needed.
|
|
22
|
-
* @param {HTMLCollection} elements - All S nodes constituting
|
|
23
|
-
* SegmentTimeline node.
|
|
23
|
+
* @param {Array.<Object>|HTMLCollection} elements - All S nodes constituting
|
|
24
|
+
* the corresponding SegmentTimeline node.
|
|
24
25
|
* @returns {Array.<Object>}
|
|
25
26
|
*/
|
|
26
|
-
export default function constructTimelineFromElements(elements: HTMLCollection): IIndexSegment[];
|
|
27
|
+
export default function constructTimelineFromElements(elements: ITNode[] | HTMLCollection): IIndexSegment[];
|
|
@@ -14,20 +14,27 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import convertElementsToIndexSegment from "./convert_element_to_index_segment";
|
|
17
|
-
import
|
|
17
|
+
import { parseSElementNode, parseSHTMLElement } from "./parse_s_element";
|
|
18
18
|
/**
|
|
19
19
|
* Allows to generate the "timeline" for the "Timeline" RepresentationIndex.
|
|
20
20
|
* Call this function when the timeline is unknown.
|
|
21
21
|
* This function was added to only perform that task lazily, i.e. only when
|
|
22
22
|
* first needed.
|
|
23
|
-
* @param {HTMLCollection} elements - All S nodes constituting
|
|
24
|
-
* SegmentTimeline node.
|
|
23
|
+
* @param {Array.<Object>|HTMLCollection} elements - All S nodes constituting
|
|
24
|
+
* the corresponding SegmentTimeline node.
|
|
25
25
|
* @returns {Array.<Object>}
|
|
26
26
|
*/
|
|
27
27
|
export default function constructTimelineFromElements(elements) {
|
|
28
28
|
const initialTimeline = [];
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
if (Array.isArray(elements)) {
|
|
30
|
+
for (let i = 0; i < elements.length; i++) {
|
|
31
|
+
initialTimeline.push(parseSElementNode(elements[i]));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
for (let i = 0; i < elements.length; i++) {
|
|
36
|
+
initialTimeline.push(parseSHTMLElement(elements[i]));
|
|
37
|
+
}
|
|
31
38
|
}
|
|
32
39
|
const timeline = [];
|
|
33
40
|
for (let i = 0; i < initialTimeline.length; i++) {
|
|
@@ -13,5 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { ITNode } from "../../../../../../utils/xml-parser";
|
|
16
17
|
import type { IIndexSegment } from "../../../../utils/index_helpers";
|
|
17
|
-
export default function constructTimelineFromPreviousTimeline(newElements: HTMLCollection, prevTimeline: IIndexSegment[]): IIndexSegment[];
|
|
18
|
+
export default function constructTimelineFromPreviousTimeline(newElements: ITNode[] | HTMLCollection, prevTimeline: IIndexSegment[]): IIndexSegment[];
|
|
@@ -17,7 +17,7 @@ import log from "../../../../../../log";
|
|
|
17
17
|
import constructTimelineFromElements from "./construct_timeline_from_elements";
|
|
18
18
|
import convertElementToIndexSegment from "./convert_element_to_index_segment";
|
|
19
19
|
import findFirstCommonStartTime from "./find_first_common_start_time";
|
|
20
|
-
import
|
|
20
|
+
import { parseSElementNode, parseSHTMLElement } from "./parse_s_element";
|
|
21
21
|
export default function constructTimelineFromPreviousTimeline(newElements, prevTimeline) {
|
|
22
22
|
var _a;
|
|
23
23
|
// Find first index in both timeline where a common segment is found.
|
|
@@ -47,7 +47,9 @@ export default function constructTimelineFromPreviousTimeline(newElements, prevT
|
|
|
47
47
|
return constructTimelineFromElements(newElements);
|
|
48
48
|
}
|
|
49
49
|
const prevLastElement = newTimeline[newTimeline.length - 1];
|
|
50
|
-
const newCommonElt =
|
|
50
|
+
const newCommonElt = Array.isArray(newElements)
|
|
51
|
+
? parseSElementNode(newElements[lastCommonEltNewEltsIdx])
|
|
52
|
+
: parseSHTMLElement(newElements[lastCommonEltNewEltsIdx]);
|
|
51
53
|
const newRepeatCountOffseted = ((_a = newCommonElt.repeatCount) !== null && _a !== void 0 ? _a : 0) - repeatNumberInNewElements;
|
|
52
54
|
if (newCommonElt.duration !== prevLastElement.duration ||
|
|
53
55
|
prevLastElement.repeatCount > newRepeatCountOffseted) {
|
|
@@ -61,8 +63,15 @@ export default function constructTimelineFromPreviousTimeline(newElements, prevT
|
|
|
61
63
|
}
|
|
62
64
|
const newEltsToPush = [];
|
|
63
65
|
const items = [];
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
if (Array.isArray(newElements)) {
|
|
67
|
+
for (let i = lastCommonEltNewEltsIdx + 1; i < newElements.length; i++) {
|
|
68
|
+
items.push(parseSElementNode(newElements[i]));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
for (let i = lastCommonEltNewEltsIdx + 1; i < newElements.length; i++) {
|
|
73
|
+
items.push(parseSHTMLElement(newElements[i]));
|
|
74
|
+
}
|
|
66
75
|
}
|
|
67
76
|
for (let i = 0; i < items.length; i++) {
|
|
68
77
|
const item = items[i];
|
package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.d.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { ITNode } from "../../../../../../utils/xml-parser";
|
|
16
17
|
import type { IIndexSegment } from "../../../../utils/index_helpers";
|
|
17
18
|
/**
|
|
18
19
|
* By comparing two timelines for the same content at different points in time,
|
|
@@ -20,10 +21,10 @@ import type { IIndexSegment } from "../../../../utils/index_helpers";
|
|
|
20
21
|
* starting time.
|
|
21
22
|
* Returns `null` if not found.
|
|
22
23
|
* @param {Array.<Object>} prevTimeline
|
|
23
|
-
* @param {
|
|
24
|
+
* @param {Array.<Object>} newElements
|
|
24
25
|
* @returns {Object|null}
|
|
25
26
|
*/
|
|
26
|
-
export default function findFirstCommonStartTime(prevTimeline: IIndexSegment[], newElements: HTMLCollection): {
|
|
27
|
+
export default function findFirstCommonStartTime(prevTimeline: IIndexSegment[], newElements: ITNode[] | HTMLCollection): {
|
|
27
28
|
/** Index in `prevSegments` where the first common segment start is found. */
|
|
28
29
|
prevSegmentsIdx: number;
|
|
29
30
|
/** Index in `newElements` where the first common segment start is found. */
|
package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.js
CHANGED
|
@@ -13,13 +13,14 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import isNullOrUndefined from "../../../../../../utils/is_null_or_undefined";
|
|
16
17
|
/**
|
|
17
18
|
* By comparing two timelines for the same content at different points in time,
|
|
18
19
|
* retrieve the index in both timelines of the first segment having the same
|
|
19
20
|
* starting time.
|
|
20
21
|
* Returns `null` if not found.
|
|
21
22
|
* @param {Array.<Object>} prevTimeline
|
|
22
|
-
* @param {
|
|
23
|
+
* @param {Array.<Object>} newElements
|
|
23
24
|
* @returns {Object|null}
|
|
24
25
|
*/
|
|
25
26
|
export default function findFirstCommonStartTime(prevTimeline, newElements) {
|
|
@@ -27,8 +28,12 @@ export default function findFirstCommonStartTime(prevTimeline, newElements) {
|
|
|
27
28
|
return null;
|
|
28
29
|
}
|
|
29
30
|
const prevInitialStart = prevTimeline[0].start;
|
|
30
|
-
const newFirstTAttr =
|
|
31
|
-
|
|
31
|
+
const newFirstTAttr = Array.isArray(newElements)
|
|
32
|
+
? newElements[0].attributes.t
|
|
33
|
+
: newElements[0].getAttribute("t");
|
|
34
|
+
const newInitialStart = isNullOrUndefined(newFirstTAttr)
|
|
35
|
+
? null
|
|
36
|
+
: parseInt(newFirstTAttr, 10);
|
|
32
37
|
if (newInitialStart === null || Number.isNaN(newInitialStart)) {
|
|
33
38
|
return null;
|
|
34
39
|
}
|
|
@@ -77,16 +82,17 @@ export default function findFirstCommonStartTime(prevTimeline, newElements) {
|
|
|
77
82
|
}
|
|
78
83
|
else {
|
|
79
84
|
let newElementsIdx = 0;
|
|
80
|
-
let
|
|
85
|
+
let newNodeElt = Array.isArray(newElements) ? newElements[0] : null;
|
|
86
|
+
let newDomElt = Array.isArray(newElements) ? null : newElements[0];
|
|
81
87
|
let currentTimeOffset = newInitialStart;
|
|
82
88
|
while (true) {
|
|
83
|
-
const dAttr =
|
|
84
|
-
const duration = dAttr
|
|
89
|
+
const dAttr = newNodeElt !== null ? newNodeElt.attributes.d : newDomElt === null || newDomElt === void 0 ? void 0 : newDomElt.getAttribute("d");
|
|
90
|
+
const duration = isNullOrUndefined(dAttr) ? null : parseInt(dAttr, 10);
|
|
85
91
|
if (duration === null || Number.isNaN(duration)) {
|
|
86
92
|
return null;
|
|
87
93
|
}
|
|
88
|
-
const rAttr =
|
|
89
|
-
const repeatCount = rAttr
|
|
94
|
+
const rAttr = newNodeElt !== null ? newNodeElt.attributes.r : newDomElt === null || newDomElt === void 0 ? void 0 : newDomElt.getAttribute("r");
|
|
95
|
+
const repeatCount = isNullOrUndefined(rAttr) ? null : parseInt(rAttr, 10);
|
|
90
96
|
if (repeatCount !== null) {
|
|
91
97
|
if (Number.isNaN(repeatCount) || repeatCount < 0) {
|
|
92
98
|
return null;
|
|
@@ -112,9 +118,14 @@ export default function findFirstCommonStartTime(prevTimeline, newElements) {
|
|
|
112
118
|
if (newElementsIdx >= newElements.length) {
|
|
113
119
|
return null;
|
|
114
120
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
121
|
+
if (Array.isArray(newElements)) {
|
|
122
|
+
newNodeElt = newElements[newElementsIdx];
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
newDomElt = newElements[newElementsIdx];
|
|
126
|
+
}
|
|
127
|
+
const tAttr = newNodeElt !== null ? newNodeElt.attributes.t : newDomElt === null || newDomElt === void 0 ? void 0 : newDomElt.getAttribute("t");
|
|
128
|
+
const time = isNullOrUndefined(tAttr) ? null : parseInt(tAttr, 10);
|
|
118
129
|
if (time !== null) {
|
|
119
130
|
if (Number.isNaN(time)) {
|
|
120
131
|
return null;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { ITNode } from "../../../../../../utils/xml-parser";
|
|
16
17
|
/** SegmentTimeline `S` element once parsed. */
|
|
17
18
|
export interface IParsedS {
|
|
18
19
|
/** Start time in a previously-given timescaled unit. */
|
|
@@ -27,8 +28,16 @@ export interface IParsedS {
|
|
|
27
28
|
duration?: number;
|
|
28
29
|
}
|
|
29
30
|
/**
|
|
30
|
-
* Parse a given <S> element in the MPD into a JS
|
|
31
|
+
* Parse a given <S> element in the MPD under a parsed Node form into a JS
|
|
32
|
+
* Object.
|
|
33
|
+
* @param {Object} root
|
|
34
|
+
* @returns {Object}
|
|
35
|
+
*/
|
|
36
|
+
export declare function parseSElementNode(root: ITNode): IParsedS;
|
|
37
|
+
/**
|
|
38
|
+
* Parse a given <S> element in the MPD under an `Element` form into a JS
|
|
39
|
+
* Object.
|
|
31
40
|
* @param {Element} root
|
|
32
41
|
* @returns {Object}
|
|
33
42
|
*/
|
|
34
|
-
export
|
|
43
|
+
export declare function parseSHTMLElement(root: Element): IParsedS;
|
|
@@ -14,12 +14,59 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import log from "../../../../../../log";
|
|
17
|
+
import isNullOrUndefined from "../../../../../../utils/is_null_or_undefined";
|
|
17
18
|
/**
|
|
18
|
-
* Parse a given <S> element in the MPD into a JS
|
|
19
|
+
* Parse a given <S> element in the MPD under a parsed Node form into a JS
|
|
20
|
+
* Object.
|
|
21
|
+
* @param {Object} root
|
|
22
|
+
* @returns {Object}
|
|
23
|
+
*/
|
|
24
|
+
export function parseSElementNode(root) {
|
|
25
|
+
const parsedS = {};
|
|
26
|
+
for (const attributeName of Object.keys(root.attributes)) {
|
|
27
|
+
const attributeVal = root.attributes[attributeName];
|
|
28
|
+
if (isNullOrUndefined(attributeVal)) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
switch (attributeName) {
|
|
32
|
+
case "t":
|
|
33
|
+
const start = parseInt(attributeVal, 10);
|
|
34
|
+
if (isNaN(start)) {
|
|
35
|
+
log.warn(`DASH: invalid t ("${attributeVal}")`);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
parsedS.start = start;
|
|
39
|
+
}
|
|
40
|
+
break;
|
|
41
|
+
case "d":
|
|
42
|
+
const duration = parseInt(attributeVal, 10);
|
|
43
|
+
if (isNaN(duration)) {
|
|
44
|
+
log.warn(`DASH: invalid d ("${attributeVal}")`);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
parsedS.duration = duration;
|
|
48
|
+
}
|
|
49
|
+
break;
|
|
50
|
+
case "r":
|
|
51
|
+
const repeatCount = parseInt(attributeVal, 10);
|
|
52
|
+
if (isNaN(repeatCount)) {
|
|
53
|
+
log.warn(`DASH: invalid r ("${attributeVal}")`);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
parsedS.repeatCount = repeatCount;
|
|
57
|
+
}
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return parsedS;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Parse a given <S> element in the MPD under an `Element` form into a JS
|
|
65
|
+
* Object.
|
|
19
66
|
* @param {Element} root
|
|
20
67
|
* @returns {Object}
|
|
21
68
|
*/
|
|
22
|
-
export
|
|
69
|
+
export function parseSHTMLElement(root) {
|
|
23
70
|
const parsedS = {};
|
|
24
71
|
for (let j = 0; j < root.attributes.length; j++) {
|
|
25
72
|
const attribute = root.attributes[j];
|
package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { IRepresentationIndex, ISegment, IRepresentation } from "../../../../../../manifest";
|
|
17
17
|
import type { IPlayerError } from "../../../../../../public_types";
|
|
18
|
+
import type { ITNode } from "../../../../../../utils/xml-parser";
|
|
18
19
|
import type { IEMSG } from "../../../../../containers/isobmff";
|
|
19
20
|
import type { IIndexSegment } from "../../../../utils/index_helpers";
|
|
20
21
|
import type { ISegmentTimelineElement } from "../../../node_parser_types";
|
|
@@ -120,7 +121,7 @@ export interface ITimelineIndexIndexArgument {
|
|
|
120
121
|
* timescale (see timescale)
|
|
121
122
|
*/
|
|
122
123
|
presentationTimeOffset?: number | undefined;
|
|
123
|
-
timelineParser?: (() => HTMLCollection) | undefined;
|
|
124
|
+
timelineParser?: (() => ITNode[] | HTMLCollection) | undefined;
|
|
124
125
|
timeline?: ISegmentTimelineElement[] | undefined;
|
|
125
126
|
}
|
|
126
127
|
/** Aditional context needed by a SegmentTimeline RepresentationIndex. */
|
|
@@ -243,7 +243,9 @@ function generateStreamEvents(baseIr, periodStart, xmlNamespaces) {
|
|
|
243
243
|
try {
|
|
244
244
|
xmlData = {
|
|
245
245
|
namespaces: allNamespaces,
|
|
246
|
-
data:
|
|
246
|
+
data: typeof eventIr.eventStreamData === "string"
|
|
247
|
+
? eventIr.eventStreamData
|
|
248
|
+
: utf8ToStr(new Uint8Array(eventIr.eventStreamData)),
|
|
247
249
|
};
|
|
248
250
|
}
|
|
249
251
|
catch (err) {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2015 CANAL+ Group
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import parseFromString from "./parse_from_xml_string";
|
|
17
|
+
export default parseFromString;
|