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, };
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.isWebOs2022 = exports.isWebOs2021 = exports.isWebOs = exports.isTizen = exports.isSamsungBrowser = exports.isSafariMobile = exports.isSafariDesktop = exports.isXbox = exports.isPlayStation5 = exports.isPanasonic = exports.isFirefox = exports.isIEOrEdge = exports.isIE11 = exports.isEdgeChromium = void 0;
|
|
18
|
+
exports.isWebOs2022 = exports.isWebOs2021 = exports.isWebOs = exports.isTizen = exports.isSamsungBrowser = exports.isSafariMobile = exports.isSafariDesktop = exports.isXbox = exports.isPlayStation5 = exports.isPlayStation4 = exports.isPanasonic = exports.isFirefox = exports.isIEOrEdge = exports.isIE11 = exports.isEdgeChromium = void 0;
|
|
19
19
|
var global_scope_1 = require("../utils/global_scope");
|
|
20
20
|
var is_node_1 = require("../utils/is_node");
|
|
21
21
|
/** Edge Chromium, regardless of the device */
|
|
@@ -54,6 +54,9 @@ exports.isWebOs2022 = isWebOs2022;
|
|
|
54
54
|
/** `true` for Panasonic devices. */
|
|
55
55
|
var isPanasonic = false;
|
|
56
56
|
exports.isPanasonic = isPanasonic;
|
|
57
|
+
/** `true` for the PlayStation 4 game console. */
|
|
58
|
+
var isPlayStation4 = false;
|
|
59
|
+
exports.isPlayStation4 = isPlayStation4;
|
|
57
60
|
/** `true` for the PlayStation 5 game console. */
|
|
58
61
|
var isPlayStation5 = false;
|
|
59
62
|
exports.isPlayStation5 = isPlayStation5;
|
|
@@ -109,7 +112,10 @@ exports.isXbox = isXbox;
|
|
|
109
112
|
if (/SamsungBrowser/.test(navigator.userAgent)) {
|
|
110
113
|
exports.isSamsungBrowser = isSamsungBrowser = true;
|
|
111
114
|
}
|
|
112
|
-
if (navigator.userAgent.indexOf("PlayStation
|
|
115
|
+
if (navigator.userAgent.indexOf("PlayStation 4") !== -1) {
|
|
116
|
+
exports.isPlayStation4 = isPlayStation4 = true;
|
|
117
|
+
}
|
|
118
|
+
else if (navigator.userAgent.indexOf("PlayStation 5") !== -1) {
|
|
113
119
|
exports.isPlayStation5 = isPlayStation5 = true;
|
|
114
120
|
}
|
|
115
121
|
else if (/Tizen/.test(navigator.userAgent)) {
|
|
@@ -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,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var browser_detection_1 = require("./browser_detection");
|
|
4
|
+
/**
|
|
5
|
+
* Return `true` if the current device is compatible with the Worker API.
|
|
6
|
+
*
|
|
7
|
+
* Some old webkit devices, such as the PlayStation 4, returns weird results
|
|
8
|
+
* when doing the most straightforward check. We have to check if other Webkit
|
|
9
|
+
* devices have the same issue.
|
|
10
|
+
* @returns {boolean}
|
|
11
|
+
*/
|
|
12
|
+
function hasWorkerApi() {
|
|
13
|
+
return browser_detection_1.isPlayStation4 ?
|
|
14
|
+
typeof Worker === "object" || typeof Worker === "function" :
|
|
15
|
+
typeof Worker === "function";
|
|
16
|
+
}
|
|
17
|
+
exports.default = hasWorkerApi;
|
|
@@ -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
|
|
@@ -11,7 +11,7 @@ var content_time_boundaries_observer_1 = require("./content_time_boundaries_obse
|
|
|
11
11
|
* Various methods from that class need then to be called at various events
|
|
12
12
|
* (see `ContentTimeBoundariesObserver`).
|
|
13
13
|
* @param {Object} manifest
|
|
14
|
-
* @param {
|
|
14
|
+
* @param {Object} mediaSource
|
|
15
15
|
* @param {Object} streamObserver
|
|
16
16
|
* @param {Object} segmentSinksStore
|
|
17
17
|
* @param {Object} cancelSignal
|
|
@@ -54,6 +54,7 @@ var log_1 = require("../../../log");
|
|
|
54
54
|
var classes_1 = require("../../../manifest/classes");
|
|
55
55
|
var main_codec_support_prober_1 = require("../../../mse/main_codec_support_prober");
|
|
56
56
|
var worker_codec_support_prober_1 = require("../../../mse/worker_codec_support_prober");
|
|
57
|
+
var fast_js_parser_1 = require("../../../parsers/manifest/dash/fast-js-parser");
|
|
57
58
|
var wasm_parser_1 = require("../../../parsers/manifest/dash/wasm-parser");
|
|
58
59
|
var playback_observer_1 = require("../../../playback_observer");
|
|
59
60
|
var worker_playback_observer_1 = require("../../../playback_observer/worker_playback_observer");
|
|
@@ -95,6 +96,7 @@ function initializeWorkerMain() {
|
|
|
95
96
|
// TODO allow worker-side feature-switching? Not sure how
|
|
96
97
|
var dashWasmParser = new wasm_parser_1.default();
|
|
97
98
|
features_1.default.dashParsers.wasm = dashWasmParser;
|
|
99
|
+
features_1.default.dashParsers.fastJs = fast_js_parser_1.default;
|
|
98
100
|
features_1.default.transports.dash = dash_1.default;
|
|
99
101
|
/**
|
|
100
102
|
* When set, emit playback observation made on the main thread.
|
|
@@ -114,16 +116,12 @@ function initializeWorkerMain() {
|
|
|
114
116
|
var diffWorker = Date.now() - performance.now();
|
|
115
117
|
monotonic_timestamp_1.mainThreadTimestampDiff.setValueIfChanged(diffWorker - diffMain);
|
|
116
118
|
updateLoggerLevel(msg.value.logLevel, msg.value.sendBackLogs);
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
log_1.default.error("Worker: Could not initialize DASH_WASM parser", error);
|
|
122
|
-
(0, send_message_1.default)({
|
|
123
|
-
type: "init-error" /* WorkerMessageType.InitError */,
|
|
124
|
-
value: { errorMessage: error, kind: "dashWasmInitialization" },
|
|
119
|
+
if (msg.value.dashWasmUrl !== undefined && dashWasmParser.isCompatible()) {
|
|
120
|
+
dashWasmParser.initialize({ wasmUrl: msg.value.dashWasmUrl }).catch(function (err) {
|
|
121
|
+
var error = err instanceof Error ? err.toString() : "Unknown Error";
|
|
122
|
+
log_1.default.error("Worker: Could not initialize DASH_WASM parser", error);
|
|
125
123
|
});
|
|
126
|
-
}
|
|
124
|
+
}
|
|
127
125
|
if (!msg.value.hasVideo || msg.value.hasMseInWorker) {
|
|
128
126
|
contentPreparer.disposeCurrentContent();
|
|
129
127
|
contentPreparer = new content_preparer_1.default({
|
|
@@ -134,6 +132,7 @@ function initializeWorkerMain() {
|
|
|
134
132
|
features_1.default.codecSupportProber = msg.value.hasMseInWorker
|
|
135
133
|
? main_codec_support_prober_1.default
|
|
136
134
|
: worker_codec_support_prober_1.default;
|
|
135
|
+
(0, send_message_1.default)({ type: "init-success" /* WorkerMessageType.InitSuccess */, value: null });
|
|
137
136
|
break;
|
|
138
137
|
case "log-level-update" /* MainThreadMessageType.LogLevelUpdate */:
|
|
139
138
|
updateLoggerLevel(msg.value.logLevel, msg.value.sendBackLogs);
|
package/dist/commonjs/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/commonjs/core/segment_sinks/implementations/audio_video/audio_video_segment_buffer.js
CHANGED
|
@@ -85,7 +85,7 @@ var AudioVideoSegmentSink = /** @class */ (function (_super) {
|
|
|
85
85
|
* @constructor
|
|
86
86
|
* @param {string} bufferType
|
|
87
87
|
* @param {string} codec
|
|
88
|
-
* @param {
|
|
88
|
+
* @param {Object} mediaSource
|
|
89
89
|
*/
|
|
90
90
|
function AudioVideoSegmentSink(bufferType, codec, mediaSource) {
|
|
91
91
|
var _this = _super.call(this) || this;
|
|
@@ -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);
|
|
@@ -45,7 +45,7 @@ var POSSIBLE_BUFFER_TYPES = ["audio", "video", "text"];
|
|
|
45
45
|
*/
|
|
46
46
|
var SegmentSinksStore = /** @class */ (function () {
|
|
47
47
|
/**
|
|
48
|
-
* @param {
|
|
48
|
+
* @param {Object} mediaSource
|
|
49
49
|
* @constructor
|
|
50
50
|
*/
|
|
51
51
|
function SegmentSinksStore(mediaSource, hasVideo, textDisplayerInterface) {
|
|
@@ -20,7 +20,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
20
20
|
* @type {Object}
|
|
21
21
|
*/
|
|
22
22
|
var features = {
|
|
23
|
-
dashParsers: { wasm: null,
|
|
23
|
+
dashParsers: { wasm: null, native: null, fastJs: null },
|
|
24
24
|
codecSupportProber: null,
|
|
25
25
|
createDebugElement: null,
|
|
26
26
|
directfile: null,
|
|
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.DASH = void 0;
|
|
19
19
|
var media_source_content_initializer_1 = require("../../main_thread/init/media_source_content_initializer");
|
|
20
20
|
var main_codec_support_prober_1 = require("../../mse/main_codec_support_prober");
|
|
21
|
-
var
|
|
21
|
+
var native_parser_1 = require("../../parsers/manifest/dash/native-parser");
|
|
22
22
|
var dash_1 = require("../../transports/dash");
|
|
23
23
|
/**
|
|
24
24
|
* Add ability to play DASH contents.
|
|
@@ -28,7 +28,7 @@ function addDASHFeature(features) {
|
|
|
28
28
|
if (features.transports.dash === undefined) {
|
|
29
29
|
features.transports.dash = dash_1.default;
|
|
30
30
|
}
|
|
31
|
-
features.dashParsers.
|
|
31
|
+
features.dashParsers.native = native_parser_1.default;
|
|
32
32
|
features.mainThreadMediaSourceInit = media_source_content_initializer_1.default;
|
|
33
33
|
features.codecSupportProber = main_codec_support_prober_1.default;
|
|
34
34
|
}
|
|
@@ -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;
|
|
@@ -76,7 +76,7 @@ var can_rely_on_video_visibility_and_size_1 = require("../../compat/can_rely_on_
|
|
|
76
76
|
var event_listeners_1 = require("../../compat/event_listeners");
|
|
77
77
|
var get_start_date_1 = require("../../compat/get_start_date");
|
|
78
78
|
var has_mse_in_worker_1 = require("../../compat/has_mse_in_worker");
|
|
79
|
-
var
|
|
79
|
+
var has_worker_api_1 = require("../../compat/has_worker_api");
|
|
80
80
|
var is_debug_mode_enabled_1 = require("../../compat/is_debug_mode_enabled");
|
|
81
81
|
var errors_1 = require("../../errors");
|
|
82
82
|
var worker_initialization_error_1 = require("../../errors/worker_initialization_error");
|
|
@@ -128,7 +128,7 @@ var Player = /** @class */ (function (_super) {
|
|
|
128
128
|
// Workaround to support Firefox autoplay on FF 42.
|
|
129
129
|
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
|
|
130
130
|
videoElement.preload = "auto";
|
|
131
|
-
_this.version = /* PLAYER_VERSION */ "4.0.0-dev.
|
|
131
|
+
_this.version = /* PLAYER_VERSION */ "4.0.0-dev.2024030500";
|
|
132
132
|
_this.log = log_1.default;
|
|
133
133
|
_this.state = "STOPPED";
|
|
134
134
|
_this.videoElement = videoElement;
|
|
@@ -219,14 +219,10 @@ var Player = /** @class */ (function (_super) {
|
|
|
219
219
|
var _this = this;
|
|
220
220
|
return new Promise(function (res, rej) {
|
|
221
221
|
var _a;
|
|
222
|
-
if (
|
|
222
|
+
if (!(0, has_worker_api_1.default)()) {
|
|
223
223
|
log_1.default.warn("API: Cannot rely on a WebWorker: Worker API unavailable");
|
|
224
224
|
return rej(new worker_initialization_error_1.default("INCOMPATIBLE_ERROR", "Worker unavailable"));
|
|
225
225
|
}
|
|
226
|
-
if (!has_webassembly_1.default) {
|
|
227
|
-
log_1.default.warn("API: Cannot rely on a WebWorker: WebAssembly unavailable");
|
|
228
|
-
return rej(new worker_initialization_error_1.default("INCOMPATIBLE_ERROR", "WebAssembly unavailable"));
|
|
229
|
-
}
|
|
230
226
|
if (typeof workerSettings.workerUrl === "string") {
|
|
231
227
|
_this._priv_worker = new Worker(workerSettings.workerUrl);
|
|
232
228
|
}
|
|
@@ -2519,5 +2515,5 @@ var Player = /** @class */ (function (_super) {
|
|
|
2519
2515
|
};
|
|
2520
2516
|
return Player;
|
|
2521
2517
|
}(event_emitter_1.default));
|
|
2522
|
-
Player.version = /* PLAYER_VERSION */ "4.0.0-dev.
|
|
2518
|
+
Player.version = /* PLAYER_VERSION */ "4.0.0-dev.2024030500";
|
|
2523
2519
|
exports.default = Player;
|
|
@@ -40,6 +40,11 @@ function getLoadedReference(playbackObserver, mediaElement, isDirectfile, cancel
|
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
42
|
if (!(0, should_wait_for_data_before_loaded_1.default)(isDirectfile, mediaElement.hasAttribute("playsinline"))) {
|
|
43
|
+
// The duration is NaN if no media data is available,
|
|
44
|
+
// which means media is not loaded yet.
|
|
45
|
+
if (isNaN(mediaElement.duration)) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
43
48
|
if (mediaElement.duration > 0) {
|
|
44
49
|
isLoaded.setValue(true);
|
|
45
50
|
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[];
|
|
@@ -22,14 +22,21 @@ var parse_s_element_1 = require("./parse_s_element");
|
|
|
22
22
|
* Call this function when the timeline is unknown.
|
|
23
23
|
* This function was added to only perform that task lazily, i.e. only when
|
|
24
24
|
* first needed.
|
|
25
|
-
* @param {HTMLCollection} elements - All S nodes constituting
|
|
26
|
-
* SegmentTimeline node.
|
|
25
|
+
* @param {Array.<Object>|HTMLCollection} elements - All S nodes constituting
|
|
26
|
+
* the corresponding SegmentTimeline node.
|
|
27
27
|
* @returns {Array.<Object>}
|
|
28
28
|
*/
|
|
29
29
|
function constructTimelineFromElements(elements) {
|
|
30
30
|
var initialTimeline = [];
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
if (Array.isArray(elements)) {
|
|
32
|
+
for (var i = 0; i < elements.length; i++) {
|
|
33
|
+
initialTimeline.push((0, parse_s_element_1.parseSElementNode)(elements[i]));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
for (var i = 0; i < elements.length; i++) {
|
|
38
|
+
initialTimeline.push((0, parse_s_element_1.parseSHTMLElement)(elements[i]));
|
|
39
|
+
}
|
|
33
40
|
}
|
|
34
41
|
var timeline = [];
|
|
35
42
|
for (var 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[];
|
|
@@ -49,7 +49,9 @@ function constructTimelineFromPreviousTimeline(newElements, prevTimeline) {
|
|
|
49
49
|
return (0, construct_timeline_from_elements_1.default)(newElements);
|
|
50
50
|
}
|
|
51
51
|
var prevLastElement = newTimeline[newTimeline.length - 1];
|
|
52
|
-
var newCommonElt =
|
|
52
|
+
var newCommonElt = Array.isArray(newElements)
|
|
53
|
+
? (0, parse_s_element_1.parseSElementNode)(newElements[lastCommonEltNewEltsIdx])
|
|
54
|
+
: (0, parse_s_element_1.parseSHTMLElement)(newElements[lastCommonEltNewEltsIdx]);
|
|
53
55
|
var newRepeatCountOffseted = ((_a = newCommonElt.repeatCount) !== null && _a !== void 0 ? _a : 0) - repeatNumberInNewElements;
|
|
54
56
|
if (newCommonElt.duration !== prevLastElement.duration ||
|
|
55
57
|
prevLastElement.repeatCount > newRepeatCountOffseted) {
|
|
@@ -63,8 +65,15 @@ function constructTimelineFromPreviousTimeline(newElements, prevTimeline) {
|
|
|
63
65
|
}
|
|
64
66
|
var newEltsToPush = [];
|
|
65
67
|
var items = [];
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
if (Array.isArray(newElements)) {
|
|
69
|
+
for (var i = lastCommonEltNewEltsIdx + 1; i < newElements.length; i++) {
|
|
70
|
+
items.push((0, parse_s_element_1.parseSElementNode)(newElements[i]));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
for (var i = lastCommonEltNewEltsIdx + 1; i < newElements.length; i++) {
|
|
75
|
+
items.push((0, parse_s_element_1.parseSHTMLElement)(newElements[i]));
|
|
76
|
+
}
|
|
68
77
|
}
|
|
69
78
|
for (var i = 0; i < items.length; i++) {
|
|
70
79
|
var item = items[i];
|
|
@@ -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/commonjs/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.js
CHANGED
|
@@ -15,13 +15,14 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
var is_null_or_undefined_1 = require("../../../../../../utils/is_null_or_undefined");
|
|
18
19
|
/**
|
|
19
20
|
* By comparing two timelines for the same content at different points in time,
|
|
20
21
|
* retrieve the index in both timelines of the first segment having the same
|
|
21
22
|
* starting time.
|
|
22
23
|
* Returns `null` if not found.
|
|
23
24
|
* @param {Array.<Object>} prevTimeline
|
|
24
|
-
* @param {
|
|
25
|
+
* @param {Array.<Object>} newElements
|
|
25
26
|
* @returns {Object|null}
|
|
26
27
|
*/
|
|
27
28
|
function findFirstCommonStartTime(prevTimeline, newElements) {
|
|
@@ -29,8 +30,12 @@ function findFirstCommonStartTime(prevTimeline, newElements) {
|
|
|
29
30
|
return null;
|
|
30
31
|
}
|
|
31
32
|
var prevInitialStart = prevTimeline[0].start;
|
|
32
|
-
var newFirstTAttr =
|
|
33
|
-
|
|
33
|
+
var newFirstTAttr = Array.isArray(newElements)
|
|
34
|
+
? newElements[0].attributes.t
|
|
35
|
+
: newElements[0].getAttribute("t");
|
|
36
|
+
var newInitialStart = (0, is_null_or_undefined_1.default)(newFirstTAttr)
|
|
37
|
+
? null
|
|
38
|
+
: parseInt(newFirstTAttr, 10);
|
|
34
39
|
if (newInitialStart === null || Number.isNaN(newInitialStart)) {
|
|
35
40
|
return null;
|
|
36
41
|
}
|
|
@@ -79,16 +84,17 @@ function findFirstCommonStartTime(prevTimeline, newElements) {
|
|
|
79
84
|
}
|
|
80
85
|
else {
|
|
81
86
|
var newElementsIdx = 0;
|
|
82
|
-
var
|
|
87
|
+
var newNodeElt = Array.isArray(newElements) ? newElements[0] : null;
|
|
88
|
+
var newDomElt = Array.isArray(newElements) ? null : newElements[0];
|
|
83
89
|
var currentTimeOffset = newInitialStart;
|
|
84
90
|
while (true) {
|
|
85
|
-
var dAttr =
|
|
86
|
-
var duration = dAttr
|
|
91
|
+
var dAttr = newNodeElt !== null ? newNodeElt.attributes.d : newDomElt === null || newDomElt === void 0 ? void 0 : newDomElt.getAttribute("d");
|
|
92
|
+
var duration = (0, is_null_or_undefined_1.default)(dAttr) ? null : parseInt(dAttr, 10);
|
|
87
93
|
if (duration === null || Number.isNaN(duration)) {
|
|
88
94
|
return null;
|
|
89
95
|
}
|
|
90
|
-
var rAttr =
|
|
91
|
-
var repeatCount = rAttr
|
|
96
|
+
var rAttr = newNodeElt !== null ? newNodeElt.attributes.r : newDomElt === null || newDomElt === void 0 ? void 0 : newDomElt.getAttribute("r");
|
|
97
|
+
var repeatCount = (0, is_null_or_undefined_1.default)(rAttr) ? null : parseInt(rAttr, 10);
|
|
92
98
|
if (repeatCount !== null) {
|
|
93
99
|
if (Number.isNaN(repeatCount) || repeatCount < 0) {
|
|
94
100
|
return null;
|
|
@@ -114,9 +120,14 @@ function findFirstCommonStartTime(prevTimeline, newElements) {
|
|
|
114
120
|
if (newElementsIdx >= newElements.length) {
|
|
115
121
|
return null;
|
|
116
122
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
123
|
+
if (Array.isArray(newElements)) {
|
|
124
|
+
newNodeElt = newElements[newElementsIdx];
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
newDomElt = newElements[newElementsIdx];
|
|
128
|
+
}
|
|
129
|
+
var tAttr = newNodeElt !== null ? newNodeElt.attributes.t : newDomElt === null || newDomElt === void 0 ? void 0 : newDomElt.getAttribute("t");
|
|
130
|
+
var time = (0, is_null_or_undefined_1.default)(tAttr) ? null : parseInt(tAttr, 10);
|
|
120
131
|
if (time !== null) {
|
|
121
132
|
if (Number.isNaN(time)) {
|
|
122
133
|
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,14 +14,85 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
var __values = (this && this.__values) || function(o) {
|
|
18
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
19
|
+
if (m) return m.call(o);
|
|
20
|
+
if (o && typeof o.length === "number") return {
|
|
21
|
+
next: function () {
|
|
22
|
+
if (o && i >= o.length) o = void 0;
|
|
23
|
+
return { value: o && o[i++], done: !o };
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
27
|
+
};
|
|
17
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.parseSHTMLElement = exports.parseSElementNode = void 0;
|
|
18
30
|
var log_1 = require("../../../../../../log");
|
|
31
|
+
var is_null_or_undefined_1 = require("../../../../../../utils/is_null_or_undefined");
|
|
32
|
+
/**
|
|
33
|
+
* Parse a given <S> element in the MPD under a parsed Node form into a JS
|
|
34
|
+
* Object.
|
|
35
|
+
* @param {Object} root
|
|
36
|
+
* @returns {Object}
|
|
37
|
+
*/
|
|
38
|
+
function parseSElementNode(root) {
|
|
39
|
+
var e_1, _a;
|
|
40
|
+
var parsedS = {};
|
|
41
|
+
try {
|
|
42
|
+
for (var _b = __values(Object.keys(root.attributes)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
43
|
+
var attributeName = _c.value;
|
|
44
|
+
var attributeVal = root.attributes[attributeName];
|
|
45
|
+
if ((0, is_null_or_undefined_1.default)(attributeVal)) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
switch (attributeName) {
|
|
49
|
+
case "t":
|
|
50
|
+
var start = parseInt(attributeVal, 10);
|
|
51
|
+
if (isNaN(start)) {
|
|
52
|
+
log_1.default.warn("DASH: invalid t (\"".concat(attributeVal, "\")"));
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
parsedS.start = start;
|
|
56
|
+
}
|
|
57
|
+
break;
|
|
58
|
+
case "d":
|
|
59
|
+
var duration = parseInt(attributeVal, 10);
|
|
60
|
+
if (isNaN(duration)) {
|
|
61
|
+
log_1.default.warn("DASH: invalid d (\"".concat(attributeVal, "\")"));
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
parsedS.duration = duration;
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
case "r":
|
|
68
|
+
var repeatCount = parseInt(attributeVal, 10);
|
|
69
|
+
if (isNaN(repeatCount)) {
|
|
70
|
+
log_1.default.warn("DASH: invalid r (\"".concat(attributeVal, "\")"));
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
parsedS.repeatCount = repeatCount;
|
|
74
|
+
}
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
80
|
+
finally {
|
|
81
|
+
try {
|
|
82
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
83
|
+
}
|
|
84
|
+
finally { if (e_1) throw e_1.error; }
|
|
85
|
+
}
|
|
86
|
+
return parsedS;
|
|
87
|
+
}
|
|
88
|
+
exports.parseSElementNode = parseSElementNode;
|
|
19
89
|
/**
|
|
20
|
-
* Parse a given <S> element in the MPD into a JS
|
|
90
|
+
* Parse a given <S> element in the MPD under an `Element` form into a JS
|
|
91
|
+
* Object.
|
|
21
92
|
* @param {Element} root
|
|
22
93
|
* @returns {Object}
|
|
23
94
|
*/
|
|
24
|
-
function
|
|
95
|
+
function parseSHTMLElement(root) {
|
|
25
96
|
var parsedS = {};
|
|
26
97
|
for (var j = 0; j < root.attributes.length; j++) {
|
|
27
98
|
var attribute = root.attributes[j];
|
|
@@ -57,4 +128,4 @@ function parseSElement(root) {
|
|
|
57
128
|
}
|
|
58
129
|
return parsedS;
|
|
59
130
|
}
|
|
60
|
-
exports.
|
|
131
|
+
exports.parseSHTMLElement = parseSHTMLElement;
|
|
@@ -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. */
|
|
@@ -302,7 +302,9 @@ function generateStreamEvents(baseIr, periodStart, xmlNamespaces) {
|
|
|
302
302
|
try {
|
|
303
303
|
xmlData = {
|
|
304
304
|
namespaces: allNamespaces,
|
|
305
|
-
data:
|
|
305
|
+
data: typeof eventIr.eventStreamData === "string"
|
|
306
|
+
? eventIr.eventStreamData
|
|
307
|
+
: (0, string_parsing_1.utf8ToStr)(new Uint8Array(eventIr.eventStreamData)),
|
|
306
308
|
};
|
|
307
309
|
}
|
|
308
310
|
catch (err) {
|