rx-player 4.4.0 → 4.4.1-dev.2025101500
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 +7 -0
- package/README.md +52 -113
- package/VERSION +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/core/{main/common → entry}/FreezeResolver.d.ts +3 -3
- package/dist/commonjs/core/entry/FreezeResolver.d.ts.map +1 -0
- package/dist/commonjs/core/{main/common → entry}/FreezeResolver.js +3 -3
- package/dist/{es2017/core/main/worker → commonjs/core/entry}/content_preparer.d.ts +22 -15
- package/dist/commonjs/core/entry/content_preparer.d.ts.map +1 -0
- package/dist/commonjs/core/{main/worker → entry}/content_preparer.js +62 -64
- package/dist/{es2017/core/main/common → commonjs/core/entry}/content_time_boundaries_observer.d.ts +5 -5
- package/dist/commonjs/core/entry/content_time_boundaries_observer.d.ts.map +1 -0
- package/dist/commonjs/core/{main/common → entry}/content_time_boundaries_observer.js +6 -6
- package/dist/commonjs/core/entry/core_entry.d.ts +36 -0
- package/dist/commonjs/core/entry/core_entry.d.ts.map +1 -0
- package/dist/commonjs/core/{main/worker/worker_main.js → entry/core_entry.js} +192 -153
- package/dist/commonjs/core/{main/worker/worker_text_displayer_interface.d.ts → entry/core_text_displayer_interface.d.ts} +11 -11
- package/dist/commonjs/core/entry/core_text_displayer_interface.d.ts.map +1 -0
- package/dist/commonjs/core/{main/worker/worker_text_displayer_interface.js → entry/core_text_displayer_interface.js} +22 -22
- package/dist/commonjs/core/{main/common → entry}/create_content_time_boundaries_observer.d.ts +6 -6
- package/dist/commonjs/core/entry/create_content_time_boundaries_observer.d.ts.map +1 -0
- package/dist/commonjs/core/{main/common → entry}/create_content_time_boundaries_observer.js +1 -1
- package/dist/commonjs/core/{main/common → entry}/get_buffered_data_per_media_buffer.d.ts +4 -4
- package/dist/commonjs/core/entry/get_buffered_data_per_media_buffer.d.ts.map +1 -0
- package/dist/commonjs/core/{main/common → entry}/get_buffered_data_per_media_buffer.js +1 -1
- package/dist/{es2017/core/main/common → commonjs/core/entry}/get_thumbnail_data.d.ts +3 -3
- package/dist/commonjs/core/entry/get_thumbnail_data.d.ts.map +1 -0
- package/dist/commonjs/core/{main/common → entry}/get_thumbnail_data.js +2 -2
- package/dist/commonjs/core/entry/index.d.ts +5 -0
- package/dist/commonjs/core/entry/index.d.ts.map +1 -0
- package/dist/commonjs/core/entry/index.js +4 -0
- package/dist/{es2017/core/main/common → commonjs/core/entry}/synchronize_sinks_on_observation.d.ts +2 -2
- package/dist/commonjs/core/entry/synchronize_sinks_on_observation.d.ts.map +1 -0
- package/dist/commonjs/core/{main/worker → entry}/track_choice_setter.d.ts +4 -4
- package/dist/commonjs/core/entry/track_choice_setter.d.ts.map +1 -0
- package/dist/commonjs/core/{main/worker → entry}/track_choice_setter.js +4 -4
- package/dist/commonjs/core/entry/utils.d.ts +3 -0
- package/dist/commonjs/core/entry/utils.d.ts.map +1 -0
- package/dist/commonjs/core/entry/utils.js +11 -0
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +17 -0
- package/dist/commonjs/core/types.d.ts +519 -1
- package/dist/commonjs/core/types.d.ts.map +1 -1
- package/dist/commonjs/core/types.js +1 -0
- package/dist/commonjs/experimental/features/local.d.ts.map +1 -1
- package/dist/commonjs/experimental/features/local.js +7 -1
- package/dist/commonjs/experimental/features/metaplaylist.d.ts.map +1 -1
- package/dist/commonjs/experimental/features/metaplaylist.js +7 -1
- package/dist/commonjs/experimental/features/multi_thread.d.ts.map +1 -1
- package/dist/commonjs/experimental/features/multi_thread.js +6 -2
- package/dist/commonjs/features/features_object.js +1 -1
- package/dist/commonjs/features/list/dash.d.ts.map +1 -1
- package/dist/commonjs/features/list/dash.js +7 -1
- package/dist/commonjs/features/list/dash_wasm.d.ts.map +1 -1
- package/dist/commonjs/features/list/dash_wasm.js +7 -1
- package/dist/commonjs/features/list/media_source_main.d.ts.map +1 -1
- package/dist/commonjs/features/list/media_source_main.js +7 -1
- package/dist/commonjs/features/list/smooth.d.ts.map +1 -1
- package/dist/commonjs/features/list/smooth.js +7 -1
- package/dist/commonjs/features/types.d.ts +20 -4
- package/dist/commonjs/features/types.d.ts.map +1 -1
- package/dist/commonjs/main_thread/api/public_api.d.ts.map +1 -1
- package/dist/commonjs/main_thread/api/public_api.js +39 -42
- package/dist/commonjs/main_thread/core_interface/base.d.ts +13 -0
- package/dist/commonjs/main_thread/core_interface/base.d.ts.map +1 -0
- package/dist/commonjs/main_thread/core_interface/base.js +32 -0
- package/dist/commonjs/main_thread/core_interface/monothread.d.ts +13 -0
- package/dist/commonjs/main_thread/core_interface/monothread.d.ts.map +1 -0
- package/dist/commonjs/main_thread/core_interface/monothread.js +56 -0
- package/dist/commonjs/main_thread/core_interface/multithread.d.ts +25 -0
- package/dist/commonjs/main_thread/core_interface/multithread.d.ts.map +1 -0
- package/dist/commonjs/main_thread/core_interface/multithread.js +67 -0
- package/dist/commonjs/main_thread/core_interface/types.d.ts +6 -0
- package/dist/commonjs/main_thread/core_interface/types.d.ts.map +1 -0
- package/dist/commonjs/main_thread/core_interface/types.js +2 -0
- package/dist/commonjs/main_thread/init/media_source_content_initializer.d.ts +166 -108
- package/dist/commonjs/main_thread/init/media_source_content_initializer.d.ts.map +1 -1
- package/dist/commonjs/main_thread/init/media_source_content_initializer.js +1492 -919
- package/dist/commonjs/main_thread/init/utils/create_core_playback_observer.d.ts.map +1 -1
- package/dist/commonjs/main_thread/init/utils/create_core_playback_observer.js +2 -1
- package/dist/commonjs/main_thread/init/utils/update_manifest_codec_support.d.ts +1 -1
- package/dist/commonjs/main_thread/init/utils/update_manifest_codec_support.d.ts.map +1 -1
- package/dist/commonjs/main_thread/types.d.ts +537 -0
- package/dist/commonjs/main_thread/types.d.ts.map +1 -1
- package/dist/commonjs/manifest/utils.d.ts.map +1 -1
- package/dist/commonjs/manifest/utils.js +18 -4
- package/dist/commonjs/mse/worker_media_source_interface.d.ts +2 -2
- package/dist/commonjs/mse/worker_media_source_interface.d.ts.map +1 -1
- package/dist/commonjs/mse/worker_media_source_interface.js +12 -12
- package/dist/commonjs/parsers/manifest/smooth/create_parser.d.ts +1 -1
- package/dist/commonjs/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/smooth/create_parser.js +31 -27
- package/dist/commonjs/parsers/manifest/smooth/parse_C_nodes.d.ts +3 -2
- package/dist/commonjs/parsers/manifest/smooth/parse_C_nodes.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/smooth/parse_C_nodes.js +16 -7
- package/dist/commonjs/parsers/manifest/smooth/parse_protection_node.d.ts +3 -2
- package/dist/commonjs/parsers/manifest/smooth/parse_protection_node.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/smooth/parse_protection_node.js +37 -6
- package/dist/commonjs/parsers/manifest/smooth/utils/parseBoolean.d.ts +1 -1
- package/dist/commonjs/parsers/manifest/smooth/utils/parseBoolean.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/smooth/utils/reduceChildren.d.ts +3 -2
- package/dist/commonjs/parsers/manifest/smooth/utils/reduceChildren.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/smooth/utils/reduceChildren.js +28 -5
- package/dist/{es2017/playback_observer/worker_playback_observer.d.ts → commonjs/playback_observer/core_playback_observer.d.ts} +8 -8
- package/dist/commonjs/playback_observer/core_playback_observer.d.ts.map +1 -0
- package/dist/commonjs/playback_observer/{worker_playback_observer.js → core_playback_observer.js} +13 -13
- package/dist/commonjs/transports/smooth/pipelines.d.ts.map +1 -1
- package/dist/commonjs/transports/smooth/pipelines.js +25 -3
- package/dist/commonjs/worker_entry_point.js +62 -2
- 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/core/{main/common → entry}/FreezeResolver.d.ts +3 -3
- package/dist/es2017/core/entry/FreezeResolver.d.ts.map +1 -0
- package/dist/es2017/core/{main/common → entry}/FreezeResolver.js +3 -3
- package/dist/{commonjs/core/main/worker → es2017/core/entry}/content_preparer.d.ts +22 -15
- package/dist/es2017/core/entry/content_preparer.d.ts.map +1 -0
- package/dist/es2017/core/{main/worker → entry}/content_preparer.js +53 -55
- package/dist/{commonjs/core/main/common → es2017/core/entry}/content_time_boundaries_observer.d.ts +5 -5
- package/dist/es2017/core/entry/content_time_boundaries_observer.d.ts.map +1 -0
- package/dist/es2017/core/{main/common → entry}/content_time_boundaries_observer.js +6 -6
- package/dist/es2017/core/entry/core_entry.d.ts +36 -0
- package/dist/es2017/core/entry/core_entry.d.ts.map +1 -0
- package/dist/es2017/core/{main/worker/worker_main.js → entry/core_entry.js} +153 -114
- package/dist/es2017/core/{main/worker/worker_text_displayer_interface.d.ts → entry/core_text_displayer_interface.d.ts} +11 -11
- package/dist/es2017/core/entry/core_text_displayer_interface.d.ts.map +1 -0
- package/dist/es2017/core/{main/worker/worker_text_displayer_interface.js → entry/core_text_displayer_interface.js} +10 -10
- package/dist/es2017/core/{main/common → entry}/create_content_time_boundaries_observer.d.ts +6 -6
- package/dist/es2017/core/entry/create_content_time_boundaries_observer.d.ts.map +1 -0
- package/dist/es2017/core/{main/common → entry}/create_content_time_boundaries_observer.js +1 -1
- package/dist/es2017/core/{main/common → entry}/get_buffered_data_per_media_buffer.d.ts +4 -4
- package/dist/es2017/core/entry/get_buffered_data_per_media_buffer.d.ts.map +1 -0
- package/dist/es2017/core/{main/common → entry}/get_buffered_data_per_media_buffer.js +1 -1
- package/dist/{commonjs/core/main/common → es2017/core/entry}/get_thumbnail_data.d.ts +3 -3
- package/dist/es2017/core/entry/get_thumbnail_data.d.ts.map +1 -0
- package/dist/es2017/core/{main/common → entry}/get_thumbnail_data.js +2 -2
- package/dist/es2017/core/entry/index.d.ts +5 -0
- package/dist/es2017/core/entry/index.d.ts.map +1 -0
- package/dist/es2017/core/entry/index.js +2 -0
- package/dist/{commonjs/core/main/common → es2017/core/entry}/synchronize_sinks_on_observation.d.ts +2 -2
- package/dist/es2017/core/entry/synchronize_sinks_on_observation.d.ts.map +1 -0
- package/dist/es2017/core/{main/worker → entry}/track_choice_setter.d.ts +4 -4
- package/dist/es2017/core/entry/track_choice_setter.d.ts.map +1 -0
- package/dist/es2017/core/{main/worker → entry}/track_choice_setter.js +4 -4
- package/dist/es2017/core/entry/utils.d.ts +3 -0
- package/dist/es2017/core/entry/utils.d.ts.map +1 -0
- package/dist/es2017/core/entry/utils.js +8 -0
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.js +18 -1
- package/dist/es2017/core/types.d.ts +519 -1
- package/dist/es2017/core/types.d.ts.map +1 -1
- package/dist/es2017/core/types.js +1 -0
- package/dist/es2017/experimental/features/local.d.ts.map +1 -1
- package/dist/es2017/experimental/features/local.js +7 -1
- package/dist/es2017/experimental/features/metaplaylist.d.ts.map +1 -1
- package/dist/es2017/experimental/features/metaplaylist.js +7 -1
- package/dist/es2017/experimental/features/multi_thread.d.ts.map +1 -1
- package/dist/es2017/experimental/features/multi_thread.js +6 -2
- package/dist/es2017/features/features_object.js +1 -1
- package/dist/es2017/features/list/dash.d.ts.map +1 -1
- package/dist/es2017/features/list/dash.js +7 -1
- package/dist/es2017/features/list/dash_wasm.d.ts.map +1 -1
- package/dist/es2017/features/list/dash_wasm.js +7 -1
- package/dist/es2017/features/list/media_source_main.d.ts.map +1 -1
- package/dist/es2017/features/list/media_source_main.js +7 -1
- package/dist/es2017/features/list/smooth.d.ts.map +1 -1
- package/dist/es2017/features/list/smooth.js +7 -1
- package/dist/es2017/features/types.d.ts +20 -4
- package/dist/es2017/features/types.d.ts.map +1 -1
- package/dist/es2017/main_thread/api/public_api.d.ts.map +1 -1
- package/dist/es2017/main_thread/api/public_api.js +40 -43
- package/dist/es2017/main_thread/core_interface/base.d.ts +13 -0
- package/dist/es2017/main_thread/core_interface/base.d.ts.map +1 -0
- package/dist/es2017/main_thread/core_interface/base.js +28 -0
- package/dist/es2017/main_thread/core_interface/monothread.d.ts +13 -0
- package/dist/es2017/main_thread/core_interface/monothread.d.ts.map +1 -0
- package/dist/es2017/main_thread/core_interface/monothread.js +32 -0
- package/dist/es2017/main_thread/core_interface/multithread.d.ts +25 -0
- package/dist/es2017/main_thread/core_interface/multithread.d.ts.map +1 -0
- package/dist/es2017/main_thread/core_interface/multithread.js +45 -0
- package/dist/es2017/main_thread/core_interface/types.d.ts +6 -0
- package/dist/es2017/main_thread/core_interface/types.d.ts.map +1 -0
- package/dist/es2017/main_thread/core_interface/types.js +1 -0
- package/dist/es2017/main_thread/init/media_source_content_initializer.d.ts +166 -108
- package/dist/es2017/main_thread/init/media_source_content_initializer.d.ts.map +1 -1
- package/dist/es2017/main_thread/init/media_source_content_initializer.js +1405 -760
- package/dist/es2017/main_thread/init/utils/create_core_playback_observer.d.ts.map +1 -1
- package/dist/es2017/main_thread/init/utils/create_core_playback_observer.js +2 -1
- package/dist/es2017/main_thread/init/utils/update_manifest_codec_support.d.ts +1 -1
- package/dist/es2017/main_thread/init/utils/update_manifest_codec_support.d.ts.map +1 -1
- package/dist/es2017/main_thread/types.d.ts +537 -0
- package/dist/es2017/main_thread/types.d.ts.map +1 -1
- package/dist/es2017/manifest/utils.d.ts.map +1 -1
- package/dist/es2017/manifest/utils.js +16 -4
- package/dist/es2017/mse/worker_media_source_interface.d.ts +2 -2
- package/dist/es2017/mse/worker_media_source_interface.d.ts.map +1 -1
- package/dist/es2017/mse/worker_media_source_interface.js +12 -12
- package/dist/es2017/parsers/manifest/smooth/create_parser.d.ts +1 -1
- package/dist/es2017/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/smooth/create_parser.js +31 -27
- package/dist/es2017/parsers/manifest/smooth/parse_C_nodes.d.ts +3 -2
- package/dist/es2017/parsers/manifest/smooth/parse_C_nodes.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/smooth/parse_C_nodes.js +16 -7
- package/dist/es2017/parsers/manifest/smooth/parse_protection_node.d.ts +3 -2
- package/dist/es2017/parsers/manifest/smooth/parse_protection_node.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/smooth/parse_protection_node.js +15 -6
- package/dist/es2017/parsers/manifest/smooth/utils/parseBoolean.d.ts +1 -1
- package/dist/es2017/parsers/manifest/smooth/utils/parseBoolean.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/smooth/utils/reduceChildren.d.ts +3 -2
- package/dist/es2017/parsers/manifest/smooth/utils/reduceChildren.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/smooth/utils/reduceChildren.js +6 -5
- package/dist/{commonjs/playback_observer/worker_playback_observer.d.ts → es2017/playback_observer/core_playback_observer.d.ts} +8 -8
- package/dist/es2017/playback_observer/core_playback_observer.d.ts.map +1 -0
- package/dist/es2017/playback_observer/{worker_playback_observer.js → core_playback_observer.js} +2 -2
- package/dist/es2017/transports/smooth/pipelines.d.ts.map +1 -1
- package/dist/es2017/transports/smooth/pipelines.js +25 -3
- package/dist/es2017/worker_entry_point.js +62 -2
- package/dist/rx-player.js +21882 -19021
- package/dist/rx-player.min.js +20 -20
- package/dist/worker.js +8 -8
- package/package.json +1 -1
- package/src/README.md +88 -198
- package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
- package/src/core/{main/common → entry}/FreezeResolver.ts +7 -7
- package/src/core/{main → entry}/README.md +1 -1
- package/src/core/{main/worker → entry}/content_preparer.ts +77 -76
- package/src/core/{main/common → entry}/content_time_boundaries_observer.ts +10 -10
- package/src/core/{main/worker/worker_main.ts → entry/core_entry.ts} +223 -149
- package/src/core/{main/worker/worker_text_displayer_interface.ts → entry/core_text_displayer_interface.ts} +26 -26
- package/src/core/{main/common → entry}/create_content_time_boundaries_observer.ts +7 -7
- package/src/core/{main/common → entry}/get_buffered_data_per_media_buffer.ts +6 -6
- package/src/core/{main/common → entry}/get_thumbnail_data.ts +5 -5
- package/src/core/entry/index.ts +4 -0
- package/src/core/{main/common → entry}/synchronize_sinks_on_observation.ts +2 -2
- package/src/core/{main/worker → entry}/track_choice_setter.ts +7 -7
- package/src/core/entry/utils.ts +11 -0
- package/src/core/stream/orchestrator/stream_orchestrator.ts +26 -1
- package/src/core/types.ts +631 -3
- package/src/experimental/features/__tests__/local.test.ts +11 -2
- package/src/experimental/features/__tests__/metaplaylist.test.ts +11 -2
- package/src/experimental/features/__tests__/multi_thread.test.ts +8 -3
- package/src/experimental/features/local.ts +7 -1
- package/src/experimental/features/metaplaylist.ts +7 -1
- package/src/experimental/features/multi_thread.ts +6 -2
- package/src/features/features_object.ts +1 -1
- package/src/features/list/__tests__/dash.test.ts +12 -3
- package/src/features/list/__tests__/smooth.test.ts +11 -2
- package/src/features/list/dash.ts +7 -1
- package/src/features/list/dash_wasm.ts +7 -1
- package/src/features/list/media_source_main.ts +7 -1
- package/src/features/list/smooth.ts +7 -1
- package/src/features/types.ts +23 -4
- package/src/main_thread/README.md +8 -0
- package/src/main_thread/api/public_api.ts +46 -48
- package/src/main_thread/core_interface/README.md +22 -0
- package/src/main_thread/core_interface/base.ts +36 -0
- package/src/main_thread/core_interface/monothread.ts +46 -0
- package/src/main_thread/core_interface/multithread.ts +49 -0
- package/src/main_thread/core_interface/types.ts +5 -0
- package/src/main_thread/init/media_source_content_initializer.ts +2034 -1152
- package/src/main_thread/init/utils/create_core_playback_observer.ts +2 -1
- package/src/main_thread/init/utils/update_manifest_codec_support.ts +1 -1
- package/src/main_thread/types.ts +610 -0
- package/src/manifest/utils.ts +20 -4
- package/src/mse/worker_media_source_interface.ts +35 -35
- package/src/parsers/manifest/smooth/create_parser.ts +40 -34
- package/src/parsers/manifest/smooth/parse_C_nodes.ts +19 -8
- package/src/parsers/manifest/smooth/parse_protection_node.ts +17 -9
- package/src/parsers/manifest/smooth/utils/parseBoolean.ts +1 -1
- package/src/parsers/manifest/smooth/utils/reduceChildren.ts +10 -7
- package/src/playback_observer/{worker_playback_observer.ts → core_playback_observer.ts} +13 -13
- package/src/transports/smooth/pipelines.ts +25 -5
- package/src/worker_entry_point.ts +71 -2
- package/dist/commonjs/core/main/common/FreezeResolver.d.ts.map +0 -1
- package/dist/commonjs/core/main/common/content_time_boundaries_observer.d.ts.map +0 -1
- package/dist/commonjs/core/main/common/create_content_time_boundaries_observer.d.ts.map +0 -1
- package/dist/commonjs/core/main/common/get_buffered_data_per_media_buffer.d.ts.map +0 -1
- package/dist/commonjs/core/main/common/get_thumbnail_data.d.ts.map +0 -1
- package/dist/commonjs/core/main/common/synchronize_sinks_on_observation.d.ts.map +0 -1
- package/dist/commonjs/core/main/worker/content_preparer.d.ts.map +0 -1
- package/dist/commonjs/core/main/worker/globals.d.ts +0 -14
- package/dist/commonjs/core/main/worker/globals.d.ts.map +0 -1
- package/dist/commonjs/core/main/worker/globals.js +0 -26
- package/dist/commonjs/core/main/worker/index.d.ts +0 -3
- package/dist/commonjs/core/main/worker/index.d.ts.map +0 -1
- package/dist/commonjs/core/main/worker/index.js +0 -4
- package/dist/commonjs/core/main/worker/send_message.d.ts +0 -4
- package/dist/commonjs/core/main/worker/send_message.d.ts.map +0 -1
- package/dist/commonjs/core/main/worker/send_message.js +0 -23
- package/dist/commonjs/core/main/worker/track_choice_setter.d.ts.map +0 -1
- package/dist/commonjs/core/main/worker/worker_main.d.ts +0 -2
- package/dist/commonjs/core/main/worker/worker_main.d.ts.map +0 -1
- package/dist/commonjs/core/main/worker/worker_text_displayer_interface.d.ts.map +0 -1
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts +0 -308
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts.map +0 -1
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.js +0 -1713
- package/dist/commonjs/main_thread/init/send_message.d.ts +0 -3
- package/dist/commonjs/main_thread/init/send_message.d.ts.map +0 -1
- package/dist/commonjs/main_thread/init/send_message.js +0 -13
- package/dist/commonjs/multithread_types.d.ts +0 -915
- package/dist/commonjs/multithread_types.d.ts.map +0 -1
- package/dist/commonjs/multithread_types.js +0 -7
- package/dist/commonjs/playback_observer/worker_playback_observer.d.ts.map +0 -1
- package/dist/es2017/core/main/common/FreezeResolver.d.ts.map +0 -1
- package/dist/es2017/core/main/common/content_time_boundaries_observer.d.ts.map +0 -1
- package/dist/es2017/core/main/common/create_content_time_boundaries_observer.d.ts.map +0 -1
- package/dist/es2017/core/main/common/get_buffered_data_per_media_buffer.d.ts.map +0 -1
- package/dist/es2017/core/main/common/get_thumbnail_data.d.ts.map +0 -1
- package/dist/es2017/core/main/common/synchronize_sinks_on_observation.d.ts.map +0 -1
- package/dist/es2017/core/main/worker/content_preparer.d.ts.map +0 -1
- package/dist/es2017/core/main/worker/globals.d.ts +0 -14
- package/dist/es2017/core/main/worker/globals.d.ts.map +0 -1
- package/dist/es2017/core/main/worker/globals.js +0 -18
- package/dist/es2017/core/main/worker/index.d.ts +0 -3
- package/dist/es2017/core/main/worker/index.d.ts.map +0 -1
- package/dist/es2017/core/main/worker/index.js +0 -2
- package/dist/es2017/core/main/worker/send_message.d.ts +0 -4
- package/dist/es2017/core/main/worker/send_message.d.ts.map +0 -1
- package/dist/es2017/core/main/worker/send_message.js +0 -19
- package/dist/es2017/core/main/worker/track_choice_setter.d.ts.map +0 -1
- package/dist/es2017/core/main/worker/worker_main.d.ts +0 -2
- package/dist/es2017/core/main/worker/worker_main.d.ts.map +0 -1
- package/dist/es2017/core/main/worker/worker_text_displayer_interface.d.ts.map +0 -1
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts +0 -308
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts.map +0 -1
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.js +0 -1559
- package/dist/es2017/main_thread/init/send_message.d.ts +0 -3
- package/dist/es2017/main_thread/init/send_message.d.ts.map +0 -1
- package/dist/es2017/main_thread/init/send_message.js +0 -10
- package/dist/es2017/multithread_types.d.ts +0 -915
- package/dist/es2017/multithread_types.d.ts.map +0 -1
- package/dist/es2017/multithread_types.js +0 -6
- package/dist/es2017/playback_observer/worker_playback_observer.d.ts.map +0 -1
- package/src/core/main/worker/globals.ts +0 -38
- package/src/core/main/worker/index.ts +0 -2
- package/src/core/main/worker/send_message.ts +0 -28
- package/src/main_thread/init/multi_thread_content_initializer.ts +0 -2330
- package/src/main_thread/init/send_message.ts +0 -15
- package/src/multithread_types.ts +0 -1095
- /package/dist/commonjs/core/{main/common → entry}/synchronize_sinks_on_observation.js +0 -0
- /package/dist/es2017/core/{main/common → entry}/synchronize_sinks_on_observation.js +0 -0
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
// TODO: move that file somewhere else
|
|
18
|
+
import getBufferedDataPerMediaBuffer from "../../../core/entry/get_buffered_data_per_media_buffer";
|
|
18
19
|
import type { IPausedPlaybackObservation } from "../../../core/types";
|
|
19
20
|
import type { IManifestMetadata } from "../../../manifest";
|
|
20
21
|
import { getMaximumSafePosition } from "../../../manifest";
|
|
@@ -2,10 +2,10 @@ import type { IMediaElement } from "../../../compat/browser_compatibility_types"
|
|
|
2
2
|
import isCodecSupported from "../../../compat/is_codec_supported";
|
|
3
3
|
import type { IManifestMetadata } from "../../../manifest";
|
|
4
4
|
import type Manifest from "../../../manifest/classes";
|
|
5
|
-
import type { ICodecSupportInfo } from "../../../multithread_types";
|
|
6
5
|
import isNullOrUndefined from "../../../utils/is_null_or_undefined";
|
|
7
6
|
import type ContentDecryptor from "../../decrypt";
|
|
8
7
|
import { ContentDecryptorState } from "../../decrypt";
|
|
8
|
+
import type { ICodecSupportInfo } from "../../types";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Returns a list of all codecs that the support is not known yet on the given
|
package/src/main_thread/types.ts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
IResolutionInfo,
|
|
3
|
+
IManifestFetcherSettings,
|
|
4
|
+
ISegmentQueueCreatorBackoffOptions,
|
|
5
|
+
IPausedPlaybackObservation,
|
|
6
|
+
IRepresentationsChoice,
|
|
7
|
+
ITrackSwitchingMode,
|
|
8
|
+
} from "../core/types";
|
|
9
|
+
import type { IDefaultConfig } from "../default_config";
|
|
10
|
+
import type { ISerializedSourceBufferError } from "../errors/source_buffer_error";
|
|
11
|
+
import type { SourceBufferType } from "../mse";
|
|
12
|
+
import type { IFreezingStatus, IRebufferingStatus } from "../playback_observer";
|
|
13
|
+
import type { ICmcdOptions, IRepresentationFilter, ITrackType } from "../public_types";
|
|
14
|
+
import type { ITransportOptions } from "../transports";
|
|
15
|
+
import type { ILogFormat, ILoggerLevel } from "../utils/logger";
|
|
16
|
+
import type { IRange } from "../utils/ranges";
|
|
1
17
|
import type RxPlayer from "./api";
|
|
2
18
|
import type { IContentProtection, IProcessedProtectionData } from "./decrypt";
|
|
3
19
|
import type { ITextDisplayer, ITextDisplayerData } from "./text_displayer";
|
|
@@ -12,3 +28,597 @@ export type {
|
|
|
12
28
|
ITextDisplayer,
|
|
13
29
|
ITextDisplayerData,
|
|
14
30
|
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* First message sent by the main thread to the Core.
|
|
34
|
+
* The Core should only receive one `IInitMessage` at most and it should be
|
|
35
|
+
* always the first message received.
|
|
36
|
+
*
|
|
37
|
+
* Allows for Core initialization.
|
|
38
|
+
*/
|
|
39
|
+
export interface IInitMessage {
|
|
40
|
+
type: MainThreadMessageType.Init;
|
|
41
|
+
value: {
|
|
42
|
+
/** Link to the DASH_WASM's feature WebAssembly file to parse DASH MPDs. */
|
|
43
|
+
dashWasmUrl: string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* If `true` the final element on the current page displaying the content
|
|
46
|
+
* can display video content.
|
|
47
|
+
*
|
|
48
|
+
* If `false`, it cannot, but it can be assumed to be able to play audio
|
|
49
|
+
* content.
|
|
50
|
+
* An example where it would be set to `false` is for `HTMLAudioElement`
|
|
51
|
+
* elements (`<audio>` tags).
|
|
52
|
+
*/
|
|
53
|
+
hasVideo: boolean;
|
|
54
|
+
/** Initial logging level that should be set. */
|
|
55
|
+
logLevel: ILoggerLevel;
|
|
56
|
+
/** Intitial logger's log format that should be set. */
|
|
57
|
+
logFormat: ILogFormat;
|
|
58
|
+
/**
|
|
59
|
+
* If `true`, logs should be sent back to the main thread, through a
|
|
60
|
+
* `ILogMessageCoreMessage` message.
|
|
61
|
+
*/
|
|
62
|
+
sendBackLogs: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Value of `Date.now()` at the time the `timestamp` property was generated.
|
|
65
|
+
*
|
|
66
|
+
* This is mostly useful for timestamp synchronization: by calling both
|
|
67
|
+
* `performance.now` (the same call on the main thread made to calculate
|
|
68
|
+
* `timestamp` - but which is not synchronized initially to the Core's)
|
|
69
|
+
* and `Date.now()` both on the main thread and on the Core,
|
|
70
|
+
* calculating the difference between the two and comparing both the main
|
|
71
|
+
* thread's difference and the Core's difference, you're able to
|
|
72
|
+
* produce a relatively-synchronized timestamp between the two if they run
|
|
73
|
+
* in different environment, e.g. a WebWorker.
|
|
74
|
+
*/
|
|
75
|
+
date: number;
|
|
76
|
+
/**
|
|
77
|
+
* Value returned by `performance.now()` at the same time `date` was
|
|
78
|
+
* calculated.
|
|
79
|
+
*
|
|
80
|
+
* Allows for timestamp synchronization.
|
|
81
|
+
* @see date property.
|
|
82
|
+
*/
|
|
83
|
+
timestamp: number;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Options needed when initializing a new content. */
|
|
88
|
+
export interface IContentInitializationData {
|
|
89
|
+
/**
|
|
90
|
+
* Identifier uniquely identifying a specific content.
|
|
91
|
+
*
|
|
92
|
+
* Protects against all kind of race conditions or asynchronous issues.
|
|
93
|
+
*/
|
|
94
|
+
contentId: string;
|
|
95
|
+
/**
|
|
96
|
+
* When set to an object, enable "Common Media Client Data", or "CMCD".
|
|
97
|
+
*/
|
|
98
|
+
cmcd?: ICmcdOptions | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* If `true`, the RxPlayer can enable its "Representation avoidance"
|
|
101
|
+
* mechanism, where it avoid loading Representation that it suspect
|
|
102
|
+
* have issues being decoded on the current device.
|
|
103
|
+
*/
|
|
104
|
+
enableRepresentationAvoidance: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* URL at which the content's Manifest is accessible.
|
|
107
|
+
* `undefined` if unknown.
|
|
108
|
+
*/
|
|
109
|
+
url?: string | undefined;
|
|
110
|
+
/** If `true`, text buffer (e.g. for subtitles) is enabled. */
|
|
111
|
+
hasText: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* The type of "transport" wanted, e.g. "dash" or "smooth".
|
|
114
|
+
*/
|
|
115
|
+
transport: string;
|
|
116
|
+
/** Options relative to the streaming protocol. */
|
|
117
|
+
transportOptions: Omit<ITransportOptions, "representationFilter"> & {
|
|
118
|
+
representationFilter?: IRepresentationFilter | string | undefined;
|
|
119
|
+
};
|
|
120
|
+
/** Initial video bitrate on which the adaptive logic will base itself. */
|
|
121
|
+
initialVideoBitrate?: number | undefined;
|
|
122
|
+
/** Initial audio bitrate on which the adaptive logic will base itself. */
|
|
123
|
+
initialAudioBitrate?: number | undefined;
|
|
124
|
+
/**
|
|
125
|
+
* Options relative to the fetching and refreshing of the Manifest.
|
|
126
|
+
*/
|
|
127
|
+
manifestRetryOptions: Omit<IManifestFetcherSettings, "cmcdDataBuilder">;
|
|
128
|
+
/** Options relative to the fetching of media segments. */
|
|
129
|
+
segmentRetryOptions: ISegmentQueueCreatorBackoffOptions;
|
|
130
|
+
/**
|
|
131
|
+
* If `true`, MSE API should be used in the core part of the RxPlayer when
|
|
132
|
+
* relying on a WebWorker.
|
|
133
|
+
* If `false`, they should be relied on on main thread.
|
|
134
|
+
*
|
|
135
|
+
* This might depend on both browser capabilities and preferences. It is
|
|
136
|
+
* assumed that the caller perform all those checks, the core won't check
|
|
137
|
+
* again the validity of this value.
|
|
138
|
+
*/
|
|
139
|
+
useMseInWorker: boolean;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export interface ILogLevelUpdateMessage {
|
|
143
|
+
type: MainThreadMessageType.LogLevelUpdate;
|
|
144
|
+
value: {
|
|
145
|
+
/** The new logger level that should be set. */
|
|
146
|
+
logLevel: ILoggerLevel;
|
|
147
|
+
/** Intitial logger's log format that should be set. */
|
|
148
|
+
logFormat: ILogFormat;
|
|
149
|
+
/**
|
|
150
|
+
* If `true`, logs should be sent back to the main thread, through a
|
|
151
|
+
* `ILogMessageCoreMessage` message.
|
|
152
|
+
*/
|
|
153
|
+
sendBackLogs: boolean;
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** Message sent by the main thread to update the Worker's global config. */
|
|
158
|
+
export interface IConfigUpdateMessage {
|
|
159
|
+
type: MainThreadMessageType.ConfigUpdate;
|
|
160
|
+
value: Partial<IDefaultConfig>;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Message sent by the main thread when a new content should be "prepared".
|
|
165
|
+
*
|
|
166
|
+
* You can begin performing operarions which do not interrupt the previous
|
|
167
|
+
* content, like fetching its Manifest.
|
|
168
|
+
*
|
|
169
|
+
* Note that on the receivings-side, you only need to prepare one content at
|
|
170
|
+
* most. Meaning that if multiple `IPrepareContentMessage` arrive in a row, you
|
|
171
|
+
* can stop the preparation of previous contents.
|
|
172
|
+
*/
|
|
173
|
+
export interface IPrepareContentMessage {
|
|
174
|
+
type: MainThreadMessageType.PrepareContent;
|
|
175
|
+
value: IContentInitializationData;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Message sent by the main thread to stop playback of the last prepared content
|
|
180
|
+
* (through a `IPrepareContentMessage`) - if it was playing - and dispose all
|
|
181
|
+
* associated resources.
|
|
182
|
+
*/
|
|
183
|
+
export interface IStopContentMessage {
|
|
184
|
+
type: MainThreadMessageType.StopContent;
|
|
185
|
+
/**
|
|
186
|
+
* Same `contentId` than for the corresponding `IPrepareContentMessage` message.
|
|
187
|
+
*
|
|
188
|
+
* Allows to ensure no race condition lead to actually stopping another content
|
|
189
|
+
* than the one meant by the main thread.
|
|
190
|
+
*/
|
|
191
|
+
contentId: string;
|
|
192
|
+
value: null;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Message sent by the main thread to start playback of the last prepared content
|
|
197
|
+
* (through a `IPrepareContentMessage`).
|
|
198
|
+
*/
|
|
199
|
+
export interface IStartPreparedContentMessage {
|
|
200
|
+
type: MainThreadMessageType.StartPreparedContent;
|
|
201
|
+
/**
|
|
202
|
+
* Same `contentId` than for the corresponding `IPrepareContentMessage` message.
|
|
203
|
+
*
|
|
204
|
+
* Allows to ensure no race condition lead to starting another content than
|
|
205
|
+
* the one meant by the main thread.
|
|
206
|
+
*/
|
|
207
|
+
contentId: string;
|
|
208
|
+
value: IStartPreparedContentMessageValue;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/** Options needed when starting a new content. */
|
|
212
|
+
export interface IStartPreparedContentMessageValue {
|
|
213
|
+
/** The start time at which we should play, in seconds. */
|
|
214
|
+
initialTime: number;
|
|
215
|
+
/** The current playback observation. */
|
|
216
|
+
initialObservation: ISerializedPlaybackObservation;
|
|
217
|
+
/**
|
|
218
|
+
* Hex-encoded string identifying the key system used.
|
|
219
|
+
* May be cross-referenced with the content's metadata when performing
|
|
220
|
+
* optimizations.
|
|
221
|
+
*/
|
|
222
|
+
drmSystemId: string | undefined;
|
|
223
|
+
/**
|
|
224
|
+
* Enable/Disable fastSwitching: allow to replace lower-quality segments by
|
|
225
|
+
* higher-quality ones to have a faster transition.
|
|
226
|
+
*/
|
|
227
|
+
enableFastSwitching: boolean;
|
|
228
|
+
/** Behavior when a new video and/or audio codec is encountered. */
|
|
229
|
+
onCodecSwitch: "continue" | "reload";
|
|
230
|
+
|
|
231
|
+
// TODO prepare chosen Adaptations here?
|
|
232
|
+
// In which case the Period's `id` should probably be given instead of the
|
|
233
|
+
// `initialTime`
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Message sent by the main thread when it has updated its list of supported
|
|
238
|
+
* codecs and has reasons to think that the Core is not aware of it
|
|
239
|
+
* (e.g. their support was not set in a Manifest).
|
|
240
|
+
*/
|
|
241
|
+
export interface ICodecSupportUpdateMessage {
|
|
242
|
+
type: MainThreadMessageType.CodecSupportUpdate;
|
|
243
|
+
value: ICodecSupportInfo[];
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export interface ICodecSupportInfo {
|
|
247
|
+
mimeType: string;
|
|
248
|
+
codec: string;
|
|
249
|
+
supported?: boolean | undefined;
|
|
250
|
+
supportedIfEncrypted?: boolean | undefined;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Message sent by the main thread to the Core regularly after an
|
|
255
|
+
* `IPrepareContentMessage` to provide various media-related metadata
|
|
256
|
+
* only obtainable on the main thread.
|
|
257
|
+
*
|
|
258
|
+
* Those messages are sent until the `IStopContentMessage` for that same
|
|
259
|
+
* `contentId`.
|
|
260
|
+
*/
|
|
261
|
+
export interface IPlaybackObservationMessage {
|
|
262
|
+
type: MainThreadMessageType.PlaybackObservation;
|
|
263
|
+
/**
|
|
264
|
+
* Same `contentId` than for the corresponding `IPrepareContentMessage` message.
|
|
265
|
+
* Allows to prevent race conditions.
|
|
266
|
+
*/
|
|
267
|
+
contentId: string;
|
|
268
|
+
/** The media-related metadata that has just been observed now. */
|
|
269
|
+
value: ISerializedPlaybackObservation;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Message sent by the main thread when at least one of the `Representation` of
|
|
274
|
+
* the current content just had a change of decipherability status.
|
|
275
|
+
*
|
|
276
|
+
* That is if one of the Representation either:
|
|
277
|
+
* - became undecipherable
|
|
278
|
+
* - became decipherable
|
|
279
|
+
* - had its decipherability status transition from being known to unknown
|
|
280
|
+
*/
|
|
281
|
+
export interface IDecipherabilityStatusChangedMessage {
|
|
282
|
+
type: MainThreadMessageType.DecipherabilityStatusUpdate;
|
|
283
|
+
/**
|
|
284
|
+
* Same `contentId` than for the corresponding `IPrepareContentMessage` message.
|
|
285
|
+
* Allows to prevent race conditions.
|
|
286
|
+
*/
|
|
287
|
+
contentId: string;
|
|
288
|
+
/** List of the `Representation` which had their decipherability status updated. */
|
|
289
|
+
value: IDecipherabilityStatusChangedPayload[];
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/** Object describing the new decipherability status of a `Representation`. */
|
|
293
|
+
export interface IDecipherabilityStatusChangedPayload {
|
|
294
|
+
/** `uniqueId` for the concerned `Representation`. */
|
|
295
|
+
representationUniqueId: string;
|
|
296
|
+
/**
|
|
297
|
+
* If set to `true`, the `Representation` became decipherable.
|
|
298
|
+
*
|
|
299
|
+
* If set to `false`, the `Representation` became undecipherable.
|
|
300
|
+
*
|
|
301
|
+
* If set to `undefined`, the `Representation`'s decipherability status became
|
|
302
|
+
* unknown.
|
|
303
|
+
*/
|
|
304
|
+
decipherable: boolean | undefined;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/** Message allowing to update the URL of the content being played. */
|
|
308
|
+
export interface IUpdateContentUrlsMessage {
|
|
309
|
+
type: MainThreadMessageType.ContentUrlsUpdate;
|
|
310
|
+
/**
|
|
311
|
+
* Same `contentId` than for the corresponding `IPrepareContentMessage` message.
|
|
312
|
+
* Allows to prevent race conditions.
|
|
313
|
+
*/
|
|
314
|
+
contentId: string;
|
|
315
|
+
/** Information on the new URL to set. */
|
|
316
|
+
value: IUpdateContentUrlsMessageValue;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/** Payload of an `IUpdateContentUrlsMessage`. */
|
|
320
|
+
export interface IUpdateContentUrlsMessageValue {
|
|
321
|
+
/**
|
|
322
|
+
* URLs to reach that Manifest from the most prioritized URL to the least
|
|
323
|
+
* prioritized URL.
|
|
324
|
+
*/
|
|
325
|
+
urls: string[] | undefined;
|
|
326
|
+
/**
|
|
327
|
+
* If `true` the resource in question (e.g. DASH's MPD) will be refreshed
|
|
328
|
+
* immediately.
|
|
329
|
+
*/
|
|
330
|
+
refreshNow: boolean;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export interface ITrackUpdateMessage {
|
|
334
|
+
type: MainThreadMessageType.TrackUpdate;
|
|
335
|
+
contentId: string;
|
|
336
|
+
value: {
|
|
337
|
+
periodId: string;
|
|
338
|
+
bufferType: ITrackType;
|
|
339
|
+
choice: ITrackUpdateChoiceObject | null | undefined;
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export interface ITrackUpdateChoiceObject {
|
|
344
|
+
/** The Adaptation choosen. */
|
|
345
|
+
adaptationId: string;
|
|
346
|
+
|
|
347
|
+
/** "Switching mode" in which the track switch should happen. */
|
|
348
|
+
switchingMode: ITrackSwitchingMode;
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Shared reference allowing to indicate which Representations from
|
|
352
|
+
* that Adaptation are allowed.
|
|
353
|
+
*/
|
|
354
|
+
initialRepresentations: IRepresentationsChoice;
|
|
355
|
+
|
|
356
|
+
/** Relative resuming position after a track change */
|
|
357
|
+
relativeResumingPosition: number | undefined;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export interface IRepresentationUpdateMessage {
|
|
361
|
+
type: MainThreadMessageType.RepresentationUpdate;
|
|
362
|
+
contentId: string;
|
|
363
|
+
value: {
|
|
364
|
+
periodId: string;
|
|
365
|
+
bufferType: ITrackType;
|
|
366
|
+
adaptationId: string;
|
|
367
|
+
choice: IRepresentationsChoice;
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/** Media-related metadata. */
|
|
372
|
+
export interface ISerializedPlaybackObservation {
|
|
373
|
+
/**
|
|
374
|
+
* Information on whether the media element was paused at the time of the
|
|
375
|
+
* Observation.
|
|
376
|
+
*/
|
|
377
|
+
paused: IPausedPlaybackObservation;
|
|
378
|
+
position: [number, number | null];
|
|
379
|
+
/** `readyState` property of the HTMLMediaElement. */
|
|
380
|
+
readyState: number;
|
|
381
|
+
/** Target playback rate at which we want to play the content. */
|
|
382
|
+
speed: number;
|
|
383
|
+
/** Theoretical maximum position on the content that can currently be played. */
|
|
384
|
+
maximumPosition: number;
|
|
385
|
+
/**
|
|
386
|
+
* Ranges of buffered data per type of media.
|
|
387
|
+
*
|
|
388
|
+
* `null` as a record's value if no buffer exists for that type of media.
|
|
389
|
+
*
|
|
390
|
+
* `null` as a `buffered` value if this could not have been obtained on the
|
|
391
|
+
* current environment (e.g. in the main thread).
|
|
392
|
+
*/
|
|
393
|
+
buffered: Record<ITrackType, IRange[] | null>;
|
|
394
|
+
duration: number;
|
|
395
|
+
/**
|
|
396
|
+
* Set if the player is short on audio and/or video media data and is a such,
|
|
397
|
+
* rebuffering.
|
|
398
|
+
* `null` if not.
|
|
399
|
+
*/
|
|
400
|
+
rebuffering: IRebufferingStatus | null;
|
|
401
|
+
/**
|
|
402
|
+
* Set if the player is frozen, that is, stuck in place for unknown reason.
|
|
403
|
+
* Note that this reason can be a valid one, such as a necessary license not
|
|
404
|
+
* being obtained yet.
|
|
405
|
+
*
|
|
406
|
+
* `null` if the player is not frozen.
|
|
407
|
+
*/
|
|
408
|
+
freezing: IFreezingStatus | null;
|
|
409
|
+
/**
|
|
410
|
+
* Gap between `currentTime` and the next position with un-buffered data.
|
|
411
|
+
* `Infinity` if we don't have buffered data right now.
|
|
412
|
+
* `undefined` if we cannot determine the buffer gap.
|
|
413
|
+
*/
|
|
414
|
+
bufferGap: number | undefined;
|
|
415
|
+
/**
|
|
416
|
+
* Indicates whether the user agent believes it has enough buffered data to ensure
|
|
417
|
+
* uninterrupted playback for a meaningful period or needs more data.
|
|
418
|
+
* It also reflects whether the user agent can retrieve and buffer data in an
|
|
419
|
+
* energy-efficient manner while maintaining the desired memory usage.
|
|
420
|
+
* `true` indicates that the buffer is low, and more data should be buffered.
|
|
421
|
+
* `false` indicates that there is enough buffered data, and no additional data needs
|
|
422
|
+
* to be buffered at this time.
|
|
423
|
+
*/
|
|
424
|
+
canStream: boolean;
|
|
425
|
+
/** If `true` the content is loaded until its maximum position. */
|
|
426
|
+
fullyLoaded: boolean;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Sent when the main thread had to "reload" the media source.
|
|
431
|
+
* The worker should understand that this MediaSource won't be used anymore.
|
|
432
|
+
*/
|
|
433
|
+
export interface ITriggerMediaSourceReloadMainMessage {
|
|
434
|
+
type: MainThreadMessageType.MediaSourceReload;
|
|
435
|
+
/** Identify the MediaSource concerned by this message. */
|
|
436
|
+
mediaSourceId: string;
|
|
437
|
+
/** No message is necessary. */
|
|
438
|
+
value: null;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Sent when the SourceBuffer linked to the given `mediaSourceId` and
|
|
443
|
+
* `SourceBufferType`, running on the main thread, succeeded to perform the last
|
|
444
|
+
* operation given to it (either through an `AppendBufferCoreMessage` or a
|
|
445
|
+
* `RemoveBufferCoreMessage`).
|
|
446
|
+
*/
|
|
447
|
+
export interface ISourceBufferOperationSuccessMainMessage {
|
|
448
|
+
type: MainThreadMessageType.SourceBufferSuccess;
|
|
449
|
+
/**
|
|
450
|
+
* Identify the MediaSource which contains the SourceBuffer concerned by
|
|
451
|
+
* this update.
|
|
452
|
+
*/
|
|
453
|
+
mediaSourceId: string;
|
|
454
|
+
/**
|
|
455
|
+
* Id uniquely identifying this SourceBuffer.
|
|
456
|
+
* It should be the same `SourceBufferType` than the one on the
|
|
457
|
+
* `CreateSourceBufferCoreMessage`.
|
|
458
|
+
*/
|
|
459
|
+
sourceBufferType: SourceBufferType;
|
|
460
|
+
/** Identify the corresponding SourceBuffer operation. */
|
|
461
|
+
operationId: string;
|
|
462
|
+
value: {
|
|
463
|
+
/**
|
|
464
|
+
* New contiguous buffered time ranges, in chronological order in seconds.
|
|
465
|
+
*/
|
|
466
|
+
buffered: IRange[];
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
export interface ISourceBufferErrorMainMessage {
|
|
471
|
+
type: MainThreadMessageType.SourceBufferError;
|
|
472
|
+
/**
|
|
473
|
+
* Identify the MediaSource which contains the SourceBuffer concerned by
|
|
474
|
+
* this update.
|
|
475
|
+
*/
|
|
476
|
+
mediaSourceId: string;
|
|
477
|
+
/** Identify the SourceBuffer in question. */
|
|
478
|
+
sourceBufferType: SourceBufferType;
|
|
479
|
+
/** Identify the corresponding SourceBuffer operation. */
|
|
480
|
+
operationId: string;
|
|
481
|
+
value:
|
|
482
|
+
| ISerializedSourceBufferError
|
|
483
|
+
| {
|
|
484
|
+
/**
|
|
485
|
+
* Identify a cancellation-specific error (the corresponding operation
|
|
486
|
+
* was cancelled.
|
|
487
|
+
*/
|
|
488
|
+
errorName: "CancellationError";
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Sent by the main thread to a Worker when the MediaSource linked to the
|
|
494
|
+
* `mediaSourceId` changed its readyState.
|
|
495
|
+
*
|
|
496
|
+
* This message is only sent if the MediaSource is created on the main thread.
|
|
497
|
+
*/
|
|
498
|
+
export interface IMediaSourceReadyStateChangeMainMessage {
|
|
499
|
+
type: MainThreadMessageType.MediaSourceReadyStateChange;
|
|
500
|
+
/** Identify the MediaSource through this unique identifier. */
|
|
501
|
+
mediaSourceId: string;
|
|
502
|
+
value: ReadyState;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
export interface IPushTextDataSuccessMessage {
|
|
506
|
+
type: MainThreadMessageType.PushTextDataSuccess;
|
|
507
|
+
contentId: string;
|
|
508
|
+
value: {
|
|
509
|
+
ranges: IRange[];
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
export interface IRemoveTextDataSuccessMessage {
|
|
514
|
+
type: MainThreadMessageType.RemoveTextDataSuccess;
|
|
515
|
+
contentId: string;
|
|
516
|
+
value: {
|
|
517
|
+
ranges: IRange[];
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
export interface IPushTextDataErrorMessage {
|
|
522
|
+
type: MainThreadMessageType.PushTextDataError;
|
|
523
|
+
contentId: string;
|
|
524
|
+
value: {
|
|
525
|
+
message: string;
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
export interface IRemoveTextDataErrorMessage {
|
|
530
|
+
type: MainThreadMessageType.RemoveTextDataError;
|
|
531
|
+
contentId: string;
|
|
532
|
+
value: {
|
|
533
|
+
message: string;
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/** Message sent from main thread when it wants to fetch thumbnail data. */
|
|
538
|
+
export interface IThumbnailDataRequestMainMessage {
|
|
539
|
+
type: MainThreadMessageType.ThumbnailDataRequest;
|
|
540
|
+
contentId: string;
|
|
541
|
+
value: {
|
|
542
|
+
requestId: number;
|
|
543
|
+
periodId: string;
|
|
544
|
+
thumbnailTrackId: string;
|
|
545
|
+
time: number;
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Template for a message originating from main thread to update
|
|
551
|
+
* `SharedReference` objects (a common abstraction of the RxPlayer allowing for
|
|
552
|
+
* passing values whose updates can be listened to through a callback).
|
|
553
|
+
*
|
|
554
|
+
* Here, `TRefName` is the "name" of the `SharedReference` (the identifier
|
|
555
|
+
* choosen for it) and `TRefType` is the type of its value.
|
|
556
|
+
*/
|
|
557
|
+
export interface IReferenceUpdate<TRefName extends string, TRefType> {
|
|
558
|
+
type: MainThreadMessageType.ReferenceUpdate;
|
|
559
|
+
value: { name: TRefName; newVal: TRefType };
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
export type IReferenceUpdateMessage =
|
|
563
|
+
| IReferenceUpdate<"wantedBufferAhead", number>
|
|
564
|
+
| IReferenceUpdate<"maxVideoBufferSize", number>
|
|
565
|
+
| IReferenceUpdate<"maxBufferBehind", number>
|
|
566
|
+
| IReferenceUpdate<"maxBufferAhead", number>
|
|
567
|
+
| IReferenceUpdate<"limitVideoResolution", IResolutionInfo>
|
|
568
|
+
| IReferenceUpdate<"throttleVideoBitrate", number>;
|
|
569
|
+
|
|
570
|
+
export interface IPullSegmentSinkStoreInfos {
|
|
571
|
+
type: MainThreadMessageType.PullSegmentSinkStoreInfos;
|
|
572
|
+
value: { requestId: number };
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
export const enum MainThreadMessageType {
|
|
576
|
+
Init = "init",
|
|
577
|
+
PushTextDataSuccess = "add-text-success",
|
|
578
|
+
RemoveTextDataSuccess = "remove-text-success",
|
|
579
|
+
PushTextDataError = "push-text-error",
|
|
580
|
+
RemoveTextDataError = "remove-text-error",
|
|
581
|
+
CodecSupportUpdate = "codec-support-update",
|
|
582
|
+
ContentUrlsUpdate = "urls-update",
|
|
583
|
+
ConfigUpdate = "config-update",
|
|
584
|
+
DecipherabilityStatusUpdate = "decipherability-update",
|
|
585
|
+
LogLevelUpdate = "log-level-update",
|
|
586
|
+
MediaSourceReadyStateChange = "media-source-ready-state-change",
|
|
587
|
+
PlaybackObservation = "observation",
|
|
588
|
+
PrepareContent = "prepare",
|
|
589
|
+
ReferenceUpdate = "ref-update",
|
|
590
|
+
RepresentationUpdate = "rep-update",
|
|
591
|
+
MediaSourceReload = "ms-reload",
|
|
592
|
+
SourceBufferError = "sb-error",
|
|
593
|
+
SourceBufferSuccess = "sb-success",
|
|
594
|
+
StartPreparedContent = "start",
|
|
595
|
+
StopContent = "stop",
|
|
596
|
+
TrackUpdate = "track-update",
|
|
597
|
+
PullSegmentSinkStoreInfos = "pull-segment-sink-store-infos",
|
|
598
|
+
ThumbnailDataRequest = "thumbnail-request",
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
export type IMainThreadMessage =
|
|
602
|
+
| IInitMessage
|
|
603
|
+
| ILogLevelUpdateMessage
|
|
604
|
+
| IConfigUpdateMessage
|
|
605
|
+
| IPrepareContentMessage
|
|
606
|
+
| IStopContentMessage
|
|
607
|
+
| IStartPreparedContentMessage
|
|
608
|
+
| IReferenceUpdateMessage
|
|
609
|
+
| ICodecSupportUpdateMessage
|
|
610
|
+
| IPlaybackObservationMessage
|
|
611
|
+
| IDecipherabilityStatusChangedMessage
|
|
612
|
+
| IUpdateContentUrlsMessage
|
|
613
|
+
| ITriggerMediaSourceReloadMainMessage
|
|
614
|
+
| ISourceBufferErrorMainMessage
|
|
615
|
+
| ISourceBufferOperationSuccessMainMessage
|
|
616
|
+
| ITrackUpdateMessage
|
|
617
|
+
| IRepresentationUpdateMessage
|
|
618
|
+
| IPushTextDataSuccessMessage
|
|
619
|
+
| IRemoveTextDataSuccessMessage
|
|
620
|
+
| IPushTextDataErrorMessage
|
|
621
|
+
| IRemoveTextDataErrorMessage
|
|
622
|
+
| IMediaSourceReadyStateChangeMainMessage
|
|
623
|
+
| IPullSegmentSinkStoreInfos
|
|
624
|
+
| IThumbnailDataRequestMainMessage;
|
package/src/manifest/utils.ts
CHANGED
|
@@ -14,6 +14,7 @@ import arrayFind from "../utils/array_find";
|
|
|
14
14
|
import isNullOrUndefined from "../utils/is_null_or_undefined";
|
|
15
15
|
import getMonotonicTimeStamp from "../utils/monotonic_timestamp";
|
|
16
16
|
import { objectValues } from "../utils/object_values";
|
|
17
|
+
import { ManifestMetadataFormat } from "./types";
|
|
17
18
|
import type {
|
|
18
19
|
IAdaptationMetadata,
|
|
19
20
|
IManifestMetadata,
|
|
@@ -448,7 +449,9 @@ export function updateDecipherabilityFromKeyIds(
|
|
|
448
449
|
},
|
|
449
450
|
): IDecipherabilityStatusChangedElement[] {
|
|
450
451
|
const { whitelistedKeyIds, blacklistedKeyIds, delistedKeyIds } = updates;
|
|
451
|
-
|
|
452
|
+
const isDecipherable = (
|
|
453
|
+
representation: IRepresentationMetadata,
|
|
454
|
+
): boolean | undefined => {
|
|
452
455
|
if (representation.contentProtections === undefined) {
|
|
453
456
|
return representation.decipherable;
|
|
454
457
|
}
|
|
@@ -473,7 +476,14 @@ export function updateDecipherabilityFromKeyIds(
|
|
|
473
476
|
}
|
|
474
477
|
}
|
|
475
478
|
return representation.decipherable;
|
|
476
|
-
}
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
if (manifest.manifestFormat === ManifestMetadataFormat.Class) {
|
|
482
|
+
(manifest as IManifest).updateRepresentationsDeciperability(({ representation }) => {
|
|
483
|
+
return isDecipherable(representation);
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
return updateRepresentationsDeciperability(manifest, isDecipherable);
|
|
477
487
|
}
|
|
478
488
|
|
|
479
489
|
/**
|
|
@@ -486,7 +496,7 @@ export function updateDecipherabilityFromProtectionData(
|
|
|
486
496
|
manifest: IManifestMetadata,
|
|
487
497
|
initData: IProcessedProtectionData,
|
|
488
498
|
): IDecipherabilityStatusChangedElement[] {
|
|
489
|
-
|
|
499
|
+
const isDecipherable = (representation: IRepresentationMetadata) => {
|
|
490
500
|
if (representation.decipherable === false) {
|
|
491
501
|
return false;
|
|
492
502
|
}
|
|
@@ -510,7 +520,13 @@ export function updateDecipherabilityFromProtectionData(
|
|
|
510
520
|
}
|
|
511
521
|
}
|
|
512
522
|
return representation.decipherable;
|
|
513
|
-
}
|
|
523
|
+
};
|
|
524
|
+
if (manifest.manifestFormat === ManifestMetadataFormat.Class) {
|
|
525
|
+
(manifest as IManifest).updateRepresentationsDeciperability(({ representation }) => {
|
|
526
|
+
return isDecipherable(representation);
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
return updateRepresentationsDeciperability(manifest, isDecipherable);
|
|
514
530
|
}
|
|
515
531
|
|
|
516
532
|
/**
|