rx-player 4.5.0-dev.2026021900 → 4.5.0-dev.2026032600
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/CHANGELOG.md +15 -3
- package/VERSION +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/commonjs/compat/browser_compatibility_types.d.ts +16 -14
- package/dist/commonjs/compat/browser_compatibility_types.d.ts.map +1 -1
- package/dist/commonjs/compat/browser_compatibility_types.js +7 -4
- package/dist/commonjs/compat/browser_version.d.ts +2 -1
- package/dist/commonjs/compat/browser_version.d.ts.map +1 -1
- package/dist/commonjs/compat/browser_version.js +13 -0
- package/dist/commonjs/compat/disable_remote_playback_on_managed_media_source.d.ts.map +1 -1
- package/dist/commonjs/compat/disable_remote_playback_on_managed_media_source.js +1 -1
- package/dist/commonjs/compat/is_codec_supported.d.ts.map +1 -1
- package/dist/commonjs/compat/is_codec_supported.js +4 -3
- package/dist/commonjs/compat/should_patch_out_dolby_vision_config_data_from_mp4.d.ts +26 -0
- package/dist/commonjs/compat/should_patch_out_dolby_vision_config_data_from_mp4.d.ts.map +1 -0
- package/dist/commonjs/compat/should_patch_out_dolby_vision_config_data_from_mp4.js +45 -0
- package/dist/commonjs/core/cmcd/cmcd_data_builder.js +2 -2
- package/dist/commonjs/core/entry/content_preparer.d.ts +1 -6
- package/dist/commonjs/core/entry/content_preparer.d.ts.map +1 -1
- package/dist/commonjs/core/entry/content_preparer.js +2 -125
- package/dist/commonjs/core/entry/core_entry.d.ts +1 -1
- package/dist/commonjs/core/entry/core_entry.d.ts.map +1 -1
- package/dist/commonjs/core/entry/core_entry.js +2 -7
- package/dist/commonjs/core/entry/core_text_displayer_interface.d.ts.map +1 -1
- package/dist/commonjs/core/entry/core_text_displayer_interface.js +3 -1
- package/dist/commonjs/core/entry/index.d.ts +1 -1
- package/dist/commonjs/core/entry/index.d.ts.map +1 -1
- package/dist/commonjs/core/entry/utils.d.ts +64 -0
- package/dist/commonjs/core/entry/utils.d.ts.map +1 -1
- package/dist/commonjs/core/entry/utils.js +165 -0
- package/dist/commonjs/core/fetchers/segment/segment_fetcher.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/segment/segment_fetcher.js +2 -1
- package/dist/commonjs/core/fetchers/segment/segment_queue.d.ts +5 -6
- package/dist/commonjs/core/fetchers/segment/segment_queue.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/thumbnails/thumbnail_fetcher.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/thumbnails/thumbnail_fetcher.js +34 -30
- package/dist/commonjs/experimental/features/worker/index.d.ts +2 -1
- package/dist/commonjs/experimental/features/worker/index.d.ts.map +1 -1
- package/dist/commonjs/experimental/features/worker/index.js +4 -3
- package/dist/commonjs/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.js +2 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +8 -6
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +4 -3
- package/dist/commonjs/initialize_worker.js +1 -1
- package/dist/commonjs/main_thread/api/debug/modules/segment_buffer_content.js +3 -3
- package/dist/commonjs/main_thread/api/public_api.js +3 -3
- package/dist/commonjs/main_thread/init/utils/update_manifest_codec_support.d.ts.map +1 -1
- package/dist/commonjs/main_thread/init/utils/update_manifest_codec_support.js +24 -12
- package/dist/commonjs/manifest/classes/adaptation.d.ts.map +1 -1
- package/dist/commonjs/manifest/classes/adaptation.js +3 -1
- package/dist/commonjs/manifest/classes/representation.d.ts +6 -2
- package/dist/commonjs/manifest/classes/representation.d.ts.map +1 -1
- package/dist/commonjs/manifest/classes/representation.js +45 -23
- package/dist/commonjs/manifest/types.d.ts +14 -6
- package/dist/commonjs/manifest/types.d.ts.map +1 -1
- package/dist/commonjs/manifest/utils.js +4 -4
- package/dist/commonjs/mse/main_media_source_interface.d.ts.map +1 -1
- package/dist/commonjs/mse/main_media_source_interface.js +3 -2
- package/dist/commonjs/mse/worker_media_source_interface.d.ts.map +1 -1
- package/dist/commonjs/parsers/containers/isobmff/get_box.d.ts +12 -1
- package/dist/commonjs/parsers/containers/isobmff/get_box.d.ts.map +1 -1
- package/dist/commonjs/parsers/containers/isobmff/get_box.js +16 -0
- package/dist/commonjs/parsers/containers/isobmff/index.d.ts +2 -1
- package/dist/commonjs/parsers/containers/isobmff/index.d.ts.map +1 -1
- package/dist/commonjs/parsers/containers/isobmff/index.js +3 -1
- package/dist/commonjs/parsers/containers/isobmff/remove_dolby_vision_config_data.d.ts +13 -0
- package/dist/commonjs/parsers/containers/isobmff/remove_dolby_vision_config_data.d.ts.map +1 -0
- package/dist/commonjs/parsers/containers/isobmff/remove_dolby_vision_config_data.js +180 -0
- package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.js +4 -4
- package/dist/commonjs/parsers/texttracks/ttml/html/apply_line_height.d.ts.map +1 -1
- package/dist/commonjs/parsers/texttracks/ttml/html/apply_line_height.js +16 -1
- package/dist/commonjs/transports/dash/segment_parser.d.ts.map +1 -1
- package/dist/commonjs/transports/dash/segment_parser.js +6 -0
- package/dist/commonjs/transports/metaplaylist/pipelines.d.ts.map +1 -1
- package/dist/commonjs/transports/metaplaylist/pipelines.js +2 -1
- package/dist/commonjs/transports/smooth/pipelines.js +3 -3
- package/dist/commonjs/transports/types.d.ts +28 -2
- package/dist/commonjs/transports/types.d.ts.map +1 -1
- package/dist/commonjs/transports/utils/parse_text_track.js +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/es2017/compat/browser_compatibility_types.d.ts +16 -14
- package/dist/es2017/compat/browser_compatibility_types.d.ts.map +1 -1
- package/dist/es2017/compat/browser_compatibility_types.js +7 -1
- package/dist/es2017/compat/browser_version.d.ts +2 -1
- package/dist/es2017/compat/browser_version.d.ts.map +1 -1
- package/dist/es2017/compat/browser_version.js +13 -1
- package/dist/es2017/compat/disable_remote_playback_on_managed_media_source.d.ts.map +1 -1
- package/dist/es2017/compat/disable_remote_playback_on_managed_media_source.js +2 -2
- package/dist/es2017/compat/is_codec_supported.d.ts.map +1 -1
- package/dist/es2017/compat/is_codec_supported.js +2 -1
- package/dist/es2017/compat/should_patch_out_dolby_vision_config_data_from_mp4.d.ts +26 -0
- package/dist/es2017/compat/should_patch_out_dolby_vision_config_data_from_mp4.d.ts.map +1 -0
- package/dist/es2017/compat/should_patch_out_dolby_vision_config_data_from_mp4.js +42 -0
- package/dist/es2017/core/cmcd/cmcd_data_builder.js +2 -2
- package/dist/es2017/core/entry/content_preparer.d.ts +1 -6
- package/dist/es2017/core/entry/content_preparer.d.ts.map +1 -1
- package/dist/es2017/core/entry/content_preparer.js +1 -76
- package/dist/es2017/core/entry/core_entry.d.ts +1 -1
- package/dist/es2017/core/entry/core_entry.d.ts.map +1 -1
- package/dist/es2017/core/entry/core_entry.js +2 -7
- package/dist/es2017/core/entry/core_text_displayer_interface.d.ts.map +1 -1
- package/dist/es2017/core/entry/core_text_displayer_interface.js +3 -1
- package/dist/es2017/core/entry/index.d.ts +1 -1
- package/dist/es2017/core/entry/index.d.ts.map +1 -1
- package/dist/es2017/core/entry/utils.d.ts +64 -0
- package/dist/es2017/core/entry/utils.d.ts.map +1 -1
- package/dist/es2017/core/entry/utils.js +98 -0
- package/dist/es2017/core/fetchers/segment/segment_fetcher.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/segment/segment_fetcher.js +2 -1
- package/dist/es2017/core/fetchers/segment/segment_queue.d.ts +5 -6
- package/dist/es2017/core/fetchers/segment/segment_queue.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/thumbnails/thumbnail_fetcher.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/thumbnails/thumbnail_fetcher.js +21 -16
- package/dist/es2017/experimental/features/worker/index.d.ts +2 -1
- package/dist/es2017/experimental/features/worker/index.d.ts.map +1 -1
- package/dist/es2017/experimental/features/worker/index.js +2 -3
- package/dist/es2017/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.js +2 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +3 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +2 -1
- package/dist/es2017/initialize_worker.js +1 -1
- package/dist/es2017/main_thread/api/debug/modules/segment_buffer_content.js +3 -3
- package/dist/es2017/main_thread/api/public_api.js +3 -3
- package/dist/es2017/main_thread/init/utils/update_manifest_codec_support.d.ts.map +1 -1
- package/dist/es2017/main_thread/init/utils/update_manifest_codec_support.js +9 -7
- package/dist/es2017/manifest/classes/adaptation.d.ts.map +1 -1
- package/dist/es2017/manifest/classes/adaptation.js +3 -1
- package/dist/es2017/manifest/classes/representation.d.ts +6 -2
- package/dist/es2017/manifest/classes/representation.d.ts.map +1 -1
- package/dist/es2017/manifest/classes/representation.js +45 -23
- package/dist/es2017/manifest/types.d.ts +14 -6
- package/dist/es2017/manifest/types.d.ts.map +1 -1
- package/dist/es2017/manifest/utils.js +4 -4
- package/dist/es2017/mse/main_media_source_interface.d.ts.map +1 -1
- package/dist/es2017/mse/main_media_source_interface.js +2 -1
- package/dist/es2017/mse/worker_media_source_interface.d.ts.map +1 -1
- package/dist/es2017/parsers/containers/isobmff/get_box.d.ts +12 -1
- package/dist/es2017/parsers/containers/isobmff/get_box.d.ts.map +1 -1
- package/dist/es2017/parsers/containers/isobmff/get_box.js +16 -1
- package/dist/es2017/parsers/containers/isobmff/index.d.ts +2 -1
- package/dist/es2017/parsers/containers/isobmff/index.d.ts.map +1 -1
- package/dist/es2017/parsers/containers/isobmff/index.js +2 -1
- package/dist/es2017/parsers/containers/isobmff/remove_dolby_vision_config_data.d.ts +13 -0
- package/dist/es2017/parsers/containers/isobmff/remove_dolby_vision_config_data.d.ts.map +1 -0
- package/dist/es2017/parsers/containers/isobmff/remove_dolby_vision_config_data.js +155 -0
- package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.js +4 -4
- package/dist/es2017/parsers/texttracks/ttml/html/apply_line_height.d.ts.map +1 -1
- package/dist/es2017/parsers/texttracks/ttml/html/apply_line_height.js +16 -1
- package/dist/es2017/transports/dash/segment_parser.d.ts.map +1 -1
- package/dist/es2017/transports/dash/segment_parser.js +7 -1
- package/dist/es2017/transports/metaplaylist/pipelines.d.ts.map +1 -1
- package/dist/es2017/transports/metaplaylist/pipelines.js +2 -1
- package/dist/es2017/transports/smooth/pipelines.js +3 -3
- package/dist/es2017/transports/types.d.ts +28 -2
- package/dist/es2017/transports/types.d.ts.map +1 -1
- package/dist/es2017/transports/utils/parse_text_track.js +1 -1
- package/dist/mpd-parser.wasm +0 -0
- package/dist/worker.js +8 -8
- package/eslint.config.mjs +1 -14
- package/package.json +19 -22
- package/src/__GENERATED_CODE/embedded_dash_wasm.ts +1 -1
- package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
- package/src/compat/__tests__/browser_compatibility_types.test.ts +15 -26
- package/src/compat/__tests__/browser_version.test.ts +57 -18
- package/src/compat/__tests__/clear_element_src.test.ts +20 -40
- package/src/compat/__tests__/is_codec_supported.test.ts +39 -44
- package/src/compat/__tests__/is_vtt_cue.test.ts +5 -8
- package/src/compat/__tests__/make_vtt_cue.test.ts +20 -31
- package/src/compat/__tests__/remove_cue.test.ts +8 -20
- package/src/compat/__tests__/should_patch_out_dolby_vision_config_data_from_mp4.test.ts +78 -0
- package/src/compat/browser_compatibility_types.ts +8 -1
- package/src/compat/browser_version.ts +17 -1
- package/src/compat/disable_remote_playback_on_managed_media_source.ts +2 -2
- package/src/compat/is_codec_supported.ts +2 -1
- package/src/compat/should_patch_out_dolby_vision_config_data_from_mp4.ts +50 -0
- package/src/core/adaptive/__tests__/adaptive_representation_selector.test.ts +774 -0
- package/src/core/adaptive/__tests__/buffer_based_chooser.test.ts +26 -84
- package/src/core/adaptive/__tests__/guess_based_chooser.test.ts +5 -2
- package/src/core/adaptive/utils/__tests__/bandwidth_estimator.test.ts +117 -0
- package/src/core/adaptive/utils/__tests__/last_estimate_storage.test.ts +76 -0
- package/src/core/adaptive/utils/__tests__/pending_requests_store.test.ts +5 -2
- package/src/core/adaptive/utils/__tests__/representation_score_calculator.test.ts +4 -2
- package/src/core/cmcd/__tests__/cmcd_data_builder.test.ts +464 -0
- package/src/core/cmcd/cmcd_data_builder.ts +2 -2
- package/src/core/entry/__tests__/FreezeResolver.test.ts +1 -1
- package/src/core/entry/__tests__/content_time_boundaries_observer.test.ts +1 -2
- package/src/core/entry/__tests__/core_text_displayer_interface.test.ts +205 -0
- package/src/core/entry/__tests__/get_buffered_data_per_media_buffer.test.ts +95 -0
- package/src/core/entry/__tests__/track_choice_setter.test.ts +288 -0
- package/src/core/entry/__tests__/utils.test.ts +315 -0
- package/src/core/entry/content_preparer.ts +7 -118
- package/src/core/entry/core_entry.ts +7 -14
- package/src/core/entry/core_text_displayer_interface.ts +3 -1
- package/src/core/entry/index.ts +1 -1
- package/src/core/entry/utils.ts +151 -0
- package/src/core/fetchers/__tests__/cdn_prioritizer.test.ts +166 -0
- package/src/core/fetchers/manifest/__tests__/manifest_fetcher.test.ts +803 -0
- package/src/core/fetchers/segment/__tests__/segment_fetcher.test.ts +872 -0
- package/src/core/fetchers/segment/__tests__/segment_queue.test.ts +557 -0
- package/src/core/fetchers/segment/segment_fetcher.ts +2 -1
- package/src/core/fetchers/segment/segment_queue.ts +5 -6
- package/src/core/fetchers/thumbnails/__tests__/thumbnail_fetcher.test.ts +435 -0
- package/src/core/fetchers/thumbnails/thumbnail_fetcher.ts +28 -20
- package/src/core/fetchers/utils/__tests__/schedule_request.test.ts +331 -0
- package/src/core/stream/adaptation/__tests__/get_representations_switch_strategy.test.ts +4 -3
- package/src/core/stream/representation/utils/__tests__/append_segment_to_buffer.test.ts +1 -1
- package/src/core/stream/representation/utils/__tests__/get_segment_priority.test.ts +1 -1
- package/src/core/stream/representation/utils/__tests__/push_init_segment.test.ts +1 -1
- package/src/core/stream/representation/utils/__tests__/push_media_segment.test.ts +1 -1
- package/src/errors/__tests__/format_error.test.ts +23 -24
- package/src/experimental/features/worker/index.ts +2 -4
- package/src/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.ts +2 -1
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaDisplayInfos.test.ts +106 -0
- package/src/experimental/tools/mediaCapabilitiesProber/probers/__tests__/HDCPPolicy.test.ts +19 -42
- package/src/experimental/tools/mediaCapabilitiesProber/probers/__tests__/decodingInfo.test.ts +33 -40
- package/src/experimental/tools/mediaCapabilitiesProber/probers/__tests__/defaultCodecsFinder.test.ts +44 -68
- package/src/experimental/tools/mediaCapabilitiesProber/probers/__tests__/mediaContentType.test.ts +45 -80
- package/src/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.ts +3 -1
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.ts +2 -1
- package/src/features/__tests__/add_features.test.ts +12 -27
- package/src/initialize_worker.ts +1 -1
- package/src/main_thread/api/__tests__/option_utils.test.ts +38 -67
- package/src/main_thread/api/__tests__/public_api.test.ts +56 -138
- package/src/main_thread/api/debug/modules/segment_buffer_content.ts +3 -3
- package/src/main_thread/api/public_api.ts +3 -3
- package/src/main_thread/decrypt/__tests__/__global__/find_key_system.test.ts +46 -28
- package/src/main_thread/decrypt/__tests__/__global__/get_license.test.ts +40 -10
- package/src/main_thread/decrypt/__tests__/__global__/init_data.test.ts +112 -129
- package/src/main_thread/decrypt/__tests__/__global__/media_key_system_access.test.ts +282 -377
- package/src/main_thread/decrypt/__tests__/__global__/media_keys.test.ts +70 -63
- package/src/main_thread/decrypt/__tests__/__global__/server_certificate.test.ts +73 -54
- package/src/main_thread/decrypt/__tests__/__global__/utils.ts +43 -83
- package/src/main_thread/decrypt/__tests__/find_key_system.test.ts +36 -17
- package/src/main_thread/decrypt/utils/__tests__/clean_old_stored_persistent_info.test.ts +44 -48
- package/src/main_thread/init/utils/__tests__/are_same_stream_events.test.ts +7 -22
- package/src/main_thread/init/utils/__tests__/refresh_scheduled_events_list.test.ts +3 -6
- package/src/main_thread/init/utils/__tests__/update_manifest_codec_support.test.ts +42 -19
- package/src/main_thread/init/utils/update_manifest_codec_support.ts +8 -6
- package/src/manifest/classes/__tests__/adaptation.test.ts +69 -125
- package/src/manifest/classes/__tests__/manifest.test.ts +88 -95
- package/src/manifest/classes/__tests__/period.test.ts +167 -117
- package/src/manifest/classes/__tests__/representation.test.ts +84 -25
- package/src/manifest/classes/__tests__/update_periods.test.ts +96 -225
- package/src/manifest/classes/adaptation.ts +4 -1
- package/src/manifest/classes/representation.ts +59 -27
- package/src/manifest/types.ts +14 -6
- package/src/manifest/utils.ts +4 -4
- package/src/mse/__tests__/main_media_source_interface.test.ts +848 -0
- package/src/mse/__tests__/worker_media_source_interface.test.ts +608 -0
- package/src/mse/main_media_source_interface.ts +2 -1
- package/src/mse/worker_media_source_interface.ts +2 -2
- package/src/parsers/containers/isobmff/__tests__/get_box.test.ts +449 -0
- package/src/parsers/containers/isobmff/__tests__/remove_dolby_vision_config_data.test.ts +282 -0
- package/src/parsers/containers/isobmff/get_box.ts +17 -0
- package/src/parsers/containers/isobmff/index.ts +8 -1
- package/src/parsers/containers/isobmff/remove_dolby_vision_config_data.ts +179 -0
- package/src/parsers/manifest/dash/common/__tests__/get_clock_offset.test.ts +19 -25
- package/src/parsers/manifest/dash/common/__tests__/get_http_utc-timing_url.test.ts +7 -19
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/ContentProtection.test.ts +26 -37
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/Initialization.test.ts +24 -53
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/SegmentURL.test.ts +31 -78
- package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +6 -4
- package/src/parsers/manifest/utils/__tests__/update_segment_timeline.test.ts +79 -87
- package/src/parsers/texttracks/ttml/__tests__/resolve_styles_inheritance.test.ts +20 -26
- package/src/parsers/texttracks/ttml/html/__tests__/__global__/html_ttml_parser.test.ts +2 -7
- package/src/parsers/texttracks/ttml/html/apply_line_height.ts +16 -1
- package/src/parsers/texttracks/webvtt/__tests__/parse_cue_block.test.ts +33 -30
- package/src/parsers/texttracks/webvtt/__tests__/parse_style_block.test.ts +33 -100
- package/src/parsers/texttracks/webvtt/html/__tests__/convert_payload_to_html.test.ts +16 -18
- package/src/parsers/texttracks/webvtt/html/__tests__/parse_webvtt_to_div.test.ts +73 -78
- package/src/parsers/texttracks/webvtt/html/__tests__/to_html.test.ts +36 -37
- package/src/transports/dash/segment_parser.ts +13 -0
- package/src/transports/metaplaylist/pipelines.ts +2 -1
- package/src/transports/smooth/isobmff/__tests__/create_boxes.test.ts +150 -127
- package/src/transports/smooth/pipelines.ts +3 -3
- package/src/transports/types.ts +28 -2
- package/src/transports/utils/__tests__/check_isobmff_integrity.test.ts +49 -75
- package/src/transports/utils/parse_text_track.ts +1 -1
- package/src/utils/__tests__/base64.test.ts +159 -191
- package/src/utils/__tests__/object_assign.test.ts +2 -2
|
@@ -171,7 +171,10 @@ export default class Adaptation implements IAdaptationMetadata {
|
|
|
171
171
|
const reprObject: IRepresentationFilterRepresentation = {
|
|
172
172
|
id: representation.id,
|
|
173
173
|
bitrate: representation.bitrate,
|
|
174
|
-
codecs:
|
|
174
|
+
codecs:
|
|
175
|
+
representation.chosenCodec !== undefined
|
|
176
|
+
? [representation.chosenCodec]
|
|
177
|
+
: representation.baseCodecs,
|
|
175
178
|
height: representation.height,
|
|
176
179
|
width: representation.width,
|
|
177
180
|
frameRate: representation.frameRate,
|
|
@@ -71,9 +71,13 @@ class Representation implements IRepresentationMetadata {
|
|
|
71
71
|
*/
|
|
72
72
|
public isSpatialAudio?: boolean | undefined;
|
|
73
73
|
/**
|
|
74
|
-
* @see IRepresentationMetadata.
|
|
74
|
+
* @see IRepresentationMetadata.baseCodecs
|
|
75
75
|
*/
|
|
76
|
-
public
|
|
76
|
+
public baseCodecs: string[];
|
|
77
|
+
/**
|
|
78
|
+
* @see IRepresentationMetadata.chosenCodec
|
|
79
|
+
*/
|
|
80
|
+
public chosenCodec: string | undefined;
|
|
77
81
|
/**
|
|
78
82
|
* @see IRepresentationMetadata.mimeType
|
|
79
83
|
*/
|
|
@@ -139,7 +143,7 @@ class Representation implements IRepresentationMetadata {
|
|
|
139
143
|
this.uniqueId = generateRepresentationUniqueId();
|
|
140
144
|
this.shouldBeAvoided = false;
|
|
141
145
|
this.bitrate = args.bitrate;
|
|
142
|
-
this.
|
|
146
|
+
this.baseCodecs = [];
|
|
143
147
|
this.trackType = trackType;
|
|
144
148
|
|
|
145
149
|
if (args.isSpatialAudio !== undefined) {
|
|
@@ -176,38 +180,54 @@ class Representation implements IRepresentationMetadata {
|
|
|
176
180
|
const isEncrypted = this.contentProtections !== undefined;
|
|
177
181
|
|
|
178
182
|
if (trackType === "audio" || trackType === "video") {
|
|
183
|
+
/**
|
|
184
|
+
* - `true` -> We found a supported codec linked to this Representation
|
|
185
|
+
* - `false` -> We did not find yet a supported codec linked to this
|
|
186
|
+
* Representation
|
|
187
|
+
* - `undefined` -> The current prefered codec has its support not
|
|
188
|
+
* known yet.
|
|
189
|
+
*/
|
|
190
|
+
let foundSupportedCodec: boolean | undefined = false;
|
|
191
|
+
|
|
179
192
|
// Supplemental codecs are defined as backwards-compatible codecs enhancing
|
|
180
193
|
// the experience of a base layer codec
|
|
181
194
|
if (args.supplementalCodecs !== undefined) {
|
|
182
|
-
|
|
195
|
+
this.baseCodecs.push(args.supplementalCodecs);
|
|
196
|
+
foundSupportedCodec = cachedCodecSupport.isSupported(
|
|
183
197
|
this.mimeType ?? "",
|
|
184
198
|
args.supplementalCodecs ?? "",
|
|
185
199
|
isEncrypted,
|
|
186
200
|
);
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
201
|
+
if (foundSupportedCodec === true) {
|
|
202
|
+
log.debug("manifest", "supplementalCodec is supported as per the cache", {
|
|
203
|
+
codec: args.supplementalCodecs,
|
|
204
|
+
});
|
|
205
|
+
this.chosenCodec = args.supplementalCodecs;
|
|
191
206
|
}
|
|
192
207
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
// Just push that codec without testing support yet, we'll check
|
|
197
|
-
// support later.
|
|
198
|
-
this.codecs.push(args.codecs ?? "");
|
|
199
|
-
} else {
|
|
200
|
-
this.codecs = args.codecs === undefined ? [] : [args.codecs];
|
|
201
|
-
this.isSupported = cachedCodecSupport.isSupported(
|
|
202
|
-
this.mimeType ?? "",
|
|
203
|
-
args.codecs ?? "",
|
|
204
|
-
isEncrypted,
|
|
205
|
-
);
|
|
206
|
-
}
|
|
208
|
+
|
|
209
|
+
if (args.codecs !== undefined) {
|
|
210
|
+
this.baseCodecs.push(args.codecs);
|
|
207
211
|
}
|
|
212
|
+
|
|
213
|
+
if (foundSupportedCodec === false) {
|
|
214
|
+
foundSupportedCodec = cachedCodecSupport.isSupported(
|
|
215
|
+
this.mimeType ?? "",
|
|
216
|
+
args.codecs ?? "",
|
|
217
|
+
isEncrypted,
|
|
218
|
+
);
|
|
219
|
+
// Put the generic codec as a fallback anyway if supplemental ones
|
|
220
|
+
// aren't present or supported.
|
|
221
|
+
log.debug("manifest", "codec is supported as per the cache", {
|
|
222
|
+
codec: args.codecs,
|
|
223
|
+
});
|
|
224
|
+
this.chosenCodec = args.codecs;
|
|
225
|
+
}
|
|
226
|
+
this.isSupported = foundSupportedCodec;
|
|
208
227
|
} else {
|
|
209
228
|
if (args.codecs !== undefined) {
|
|
210
|
-
this.
|
|
229
|
+
this.baseCodecs.push(args.codecs);
|
|
230
|
+
this.chosenCodec = args.codecs;
|
|
211
231
|
}
|
|
212
232
|
this.isSupported = true;
|
|
213
233
|
}
|
|
@@ -233,7 +253,7 @@ class Representation implements IRepresentationMetadata {
|
|
|
233
253
|
const isEncrypted = this.contentProtections !== undefined;
|
|
234
254
|
let isSupported: boolean | undefined = false;
|
|
235
255
|
const mimeType = this.mimeType ?? "";
|
|
236
|
-
let codecs = this.
|
|
256
|
+
let codecs = this.baseCodecs ?? [];
|
|
237
257
|
if (codecs.length === 0) {
|
|
238
258
|
codecs = [""];
|
|
239
259
|
}
|
|
@@ -241,7 +261,8 @@ class Representation implements IRepresentationMetadata {
|
|
|
241
261
|
for (const codec of codecs) {
|
|
242
262
|
isSupported = cachedCodecSupport.isSupported(mimeType, codec, isEncrypted);
|
|
243
263
|
if (isSupported === true) {
|
|
244
|
-
|
|
264
|
+
log.debug("manifest", "codec is found to be supported", { codec });
|
|
265
|
+
this.chosenCodec = codec;
|
|
245
266
|
break;
|
|
246
267
|
}
|
|
247
268
|
if (isSupported === undefined) {
|
|
@@ -271,7 +292,17 @@ class Representation implements IRepresentationMetadata {
|
|
|
271
292
|
* @returns {string}
|
|
272
293
|
*/
|
|
273
294
|
public getMimeTypeString(): string {
|
|
274
|
-
|
|
295
|
+
let codec = this.chosenCodec;
|
|
296
|
+
if (codec === undefined) {
|
|
297
|
+
log.warn(
|
|
298
|
+
"manifest",
|
|
299
|
+
"Asked for mimetype string when codec support is yet unknown, attempting with first known linked codec",
|
|
300
|
+
);
|
|
301
|
+
if (this.baseCodecs !== undefined) {
|
|
302
|
+
codec = this.baseCodecs[0];
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return `${this.mimeType ?? ""};codecs="${codec ?? ""}"`;
|
|
275
306
|
}
|
|
276
307
|
|
|
277
308
|
/**
|
|
@@ -483,7 +514,8 @@ class Representation implements IRepresentationMetadata {
|
|
|
483
514
|
id: this.id,
|
|
484
515
|
uniqueId: this.uniqueId,
|
|
485
516
|
bitrate: this.bitrate,
|
|
486
|
-
|
|
517
|
+
baseCodecs: this.baseCodecs,
|
|
518
|
+
chosenCodec: this.chosenCodec,
|
|
487
519
|
mimeType: this.mimeType,
|
|
488
520
|
width: this.width,
|
|
489
521
|
height: this.height,
|
package/src/manifest/types.ts
CHANGED
|
@@ -431,14 +431,22 @@ export interface IRepresentationMetadata {
|
|
|
431
431
|
* In that scenario, we could have an array with two elements:
|
|
432
432
|
* 1. The Dolby Vision codec
|
|
433
433
|
* 2. The base HDR10 codec, hopefully with higher device compatibility.
|
|
434
|
+
*/
|
|
435
|
+
baseCodecs?: string[];
|
|
436
|
+
/**
|
|
437
|
+
* `baseCodecs` can define multiple codecs linked to this `Representation`,
|
|
438
|
+
* e.g. Dolby Vision retro-compatible to a non-Dolby Vision HEVC-based
|
|
439
|
+
* codec).
|
|
440
|
+
*
|
|
441
|
+
* But on the current device, we'll generally want to announce a unique
|
|
442
|
+
* codec, after checking the one that is supported.
|
|
443
|
+
*
|
|
444
|
+
* This is what `chosenCodecs` is for: the actual codec to rely on.
|
|
434
445
|
*
|
|
435
|
-
*
|
|
436
|
-
*
|
|
437
|
-
* to only have several elements in this Array _BEFORE_ testing for codec
|
|
438
|
-
* support on the current device, only to then remove all non-used codecs to
|
|
439
|
-
* keep the one actually relied on.
|
|
446
|
+
* Set to `undefined` initially until we know which codec from `baseCodecs`
|
|
447
|
+
* is supported.
|
|
440
448
|
*/
|
|
441
|
-
|
|
449
|
+
chosenCodec?: string | undefined;
|
|
442
450
|
/**
|
|
443
451
|
* A string describing the mime-type for this Representation.
|
|
444
452
|
* Examples: audio/mp4, video/webm, application/mp4, text/plain
|
package/src/manifest/utils.ts
CHANGED
|
@@ -328,12 +328,12 @@ export function toVideoTrack(
|
|
|
328
328
|
export function toAudioRepresentation(
|
|
329
329
|
representation: IRepresentationMetadata,
|
|
330
330
|
): IAudioRepresentation {
|
|
331
|
-
const { id, bitrate,
|
|
331
|
+
const { id, bitrate, chosenCodec, isSpatialAudio, isSupported, decipherable } =
|
|
332
332
|
representation;
|
|
333
333
|
return {
|
|
334
334
|
id,
|
|
335
335
|
bitrate,
|
|
336
|
-
codec:
|
|
336
|
+
codec: chosenCodec,
|
|
337
337
|
isSpatialAudio,
|
|
338
338
|
isCodecSupported: isSupported,
|
|
339
339
|
decipherable,
|
|
@@ -353,7 +353,7 @@ export function toVideoRepresentation(
|
|
|
353
353
|
frameRate,
|
|
354
354
|
width,
|
|
355
355
|
height,
|
|
356
|
-
|
|
356
|
+
chosenCodec,
|
|
357
357
|
hdrInfo,
|
|
358
358
|
isSupported,
|
|
359
359
|
decipherable,
|
|
@@ -365,7 +365,7 @@ export function toVideoRepresentation(
|
|
|
365
365
|
frameRate,
|
|
366
366
|
width,
|
|
367
367
|
height,
|
|
368
|
-
codec:
|
|
368
|
+
codec: chosenCodec,
|
|
369
369
|
hdrInfo,
|
|
370
370
|
isCodecSupported: isSupported,
|
|
371
371
|
decipherable,
|