rx-player 4.5.0-dev.2026033100 → 4.5.0-dev.2026041501
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 +22 -5
- 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/can_patch_out_pssh.d.ts +42 -0
- package/dist/commonjs/compat/can_patch_out_pssh.d.ts.map +1 -0
- package/dist/commonjs/compat/can_patch_out_pssh.js +53 -0
- package/dist/commonjs/compat/env_detector.d.ts +2 -0
- package/dist/commonjs/compat/env_detector.d.ts.map +1 -1
- package/dist/commonjs/compat/env_detector.js +5 -0
- package/dist/commonjs/core/adaptive/network_analyzer.d.ts +1 -2
- package/dist/commonjs/core/adaptive/network_analyzer.d.ts.map +1 -1
- package/dist/commonjs/core/adaptive/network_analyzer.js +3 -3
- package/dist/commonjs/core/adaptive/utils/representation_score_calculator.js +2 -2
- package/dist/commonjs/core/cmcd/cmcd_data_builder.d.ts.map +1 -1
- package/dist/commonjs/core/cmcd/cmcd_data_builder.js +9 -3
- package/dist/commonjs/core/entry/content_preparer.d.ts.map +1 -1
- package/dist/commonjs/core/entry/content_preparer.js +5 -7
- package/dist/commonjs/core/entry/core_entry.d.ts.map +1 -1
- package/dist/commonjs/core/entry/core_entry.js +6 -2
- package/dist/commonjs/core/entry/core_text_displayer_interface.js +3 -3
- package/dist/commonjs/core/fetchers/manifest/manifest_fetcher.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/manifest/manifest_fetcher.js +12 -0
- package/dist/commonjs/core/fetchers/thumbnails/thumbnail_fetcher.js +1 -1
- package/dist/commonjs/core/fetchers/utils/schedule_request.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/utils/schedule_request.js +4 -3
- package/dist/commonjs/core/segment_sinks/garbage_collector.d.ts +0 -2
- package/dist/commonjs/core/segment_sinks/garbage_collector.d.ts.map +1 -1
- package/dist/commonjs/core/segment_sinks/garbage_collector.js +0 -3
- package/dist/commonjs/core/segment_sinks/implementations/text/text_segment_sink.d.ts +1 -1
- package/dist/commonjs/core/segment_sinks/implementations/text/text_segment_sink.d.ts.map +1 -1
- package/dist/commonjs/core/segment_sinks/implementations/text/text_segment_sink.js +2 -2
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.js +6 -6
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +37 -40
- package/dist/commonjs/default_config.d.ts +5 -0
- package/dist/commonjs/default_config.d.ts.map +1 -1
- package/dist/commonjs/default_config.js +5 -0
- package/dist/commonjs/main_thread/api/public_api.d.ts.map +1 -1
- package/dist/commonjs/main_thread/api/public_api.js +23 -16
- package/dist/commonjs/main_thread/decrypt/content_decryptor.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/content_decryptor.js +4 -1
- package/dist/commonjs/main_thread/decrypt/session_events_listener.js +1 -1
- package/dist/commonjs/main_thread/decrypt/set_server_certificate.d.ts +2 -0
- package/dist/commonjs/main_thread/decrypt/set_server_certificate.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/set_server_certificate.js +4 -0
- package/dist/commonjs/main_thread/init/media_source_content_initializer.d.ts +0 -8
- 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 +58 -50
- package/dist/commonjs/main_thread/init/utils/stream_events_emitter/stream_events_emitter.d.ts +35 -5
- package/dist/commonjs/main_thread/init/utils/stream_events_emitter/stream_events_emitter.d.ts.map +1 -1
- package/dist/commonjs/main_thread/init/utils/stream_events_emitter/stream_events_emitter.js +60 -19
- package/dist/commonjs/main_thread/render_thumbnail.d.ts.map +1 -1
- package/dist/commonjs/main_thread/render_thumbnail.js +4 -0
- package/dist/commonjs/main_thread/tracks_store/media_element_tracks_store.d.ts.map +1 -1
- package/dist/commonjs/main_thread/tracks_store/media_element_tracks_store.js +1 -0
- package/dist/commonjs/main_thread/tracks_store/tracks_store.d.ts +1 -1
- package/dist/commonjs/main_thread/tracks_store/tracks_store.js +1 -1
- package/dist/{es2017/parsers/containers/isobmff/take_pssh_out.d.ts → commonjs/parsers/containers/isobmff/extract_pssh.d.ts} +6 -4
- package/dist/commonjs/parsers/containers/isobmff/extract_pssh.d.ts.map +1 -0
- package/dist/commonjs/parsers/containers/isobmff/{take_pssh_out.js → extract_pssh.js} +22 -17
- package/dist/commonjs/parsers/containers/isobmff/index.d.ts +2 -2
- package/dist/commonjs/parsers/containers/isobmff/index.d.ts.map +1 -1
- package/dist/commonjs/parsers/containers/isobmff/index.js +4 -4
- package/dist/commonjs/playback_observer/core_playback_observer.d.ts +4 -4
- package/dist/commonjs/playback_observer/core_playback_observer.d.ts.map +1 -1
- package/dist/commonjs/playback_observer/media_element_playback_observer.d.ts +1 -2
- package/dist/commonjs/playback_observer/media_element_playback_observer.d.ts.map +1 -1
- package/dist/commonjs/transports/dash/segment_parser.js +1 -1
- package/dist/commonjs/transports/local/segment_parser.js +1 -1
- package/dist/commonjs/utils/test-utils.d.ts +30 -0
- package/dist/commonjs/utils/test-utils.d.ts.map +1 -0
- package/dist/commonjs/utils/test-utils.js +79 -0
- 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/can_patch_out_pssh.d.ts +42 -0
- package/dist/es2017/compat/can_patch_out_pssh.d.ts.map +1 -0
- package/dist/es2017/compat/can_patch_out_pssh.js +50 -0
- package/dist/es2017/compat/env_detector.d.ts +2 -0
- package/dist/es2017/compat/env_detector.d.ts.map +1 -1
- package/dist/es2017/compat/env_detector.js +5 -0
- package/dist/es2017/core/adaptive/network_analyzer.d.ts +1 -2
- package/dist/es2017/core/adaptive/network_analyzer.d.ts.map +1 -1
- package/dist/es2017/core/adaptive/network_analyzer.js +3 -3
- package/dist/es2017/core/adaptive/utils/representation_score_calculator.js +2 -2
- package/dist/es2017/core/cmcd/cmcd_data_builder.d.ts.map +1 -1
- package/dist/es2017/core/cmcd/cmcd_data_builder.js +9 -3
- package/dist/es2017/core/entry/content_preparer.d.ts.map +1 -1
- package/dist/es2017/core/entry/content_preparer.js +3 -5
- package/dist/es2017/core/entry/core_entry.d.ts.map +1 -1
- package/dist/es2017/core/entry/core_entry.js +6 -2
- package/dist/es2017/core/entry/core_text_displayer_interface.js +3 -3
- package/dist/es2017/core/fetchers/manifest/manifest_fetcher.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/manifest/manifest_fetcher.js +12 -0
- package/dist/es2017/core/fetchers/thumbnails/thumbnail_fetcher.js +1 -1
- package/dist/es2017/core/fetchers/utils/schedule_request.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/utils/schedule_request.js +2 -3
- package/dist/es2017/core/segment_sinks/garbage_collector.d.ts +0 -2
- package/dist/es2017/core/segment_sinks/garbage_collector.d.ts.map +1 -1
- package/dist/es2017/core/segment_sinks/garbage_collector.js +0 -3
- package/dist/es2017/core/segment_sinks/implementations/text/text_segment_sink.d.ts +1 -1
- package/dist/es2017/core/segment_sinks/implementations/text/text_segment_sink.d.ts.map +1 -1
- package/dist/es2017/core/segment_sinks/implementations/text/text_segment_sink.js +2 -2
- package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/adaptation/adaptation_stream.js +6 -6
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.js +40 -39
- package/dist/es2017/default_config.d.ts +5 -0
- package/dist/es2017/default_config.d.ts.map +1 -1
- package/dist/es2017/default_config.js +5 -0
- package/dist/es2017/main_thread/api/public_api.d.ts.map +1 -1
- package/dist/es2017/main_thread/api/public_api.js +20 -13
- package/dist/es2017/main_thread/decrypt/content_decryptor.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/content_decryptor.js +4 -1
- package/dist/es2017/main_thread/decrypt/session_events_listener.js +1 -1
- package/dist/es2017/main_thread/decrypt/set_server_certificate.d.ts +2 -0
- package/dist/es2017/main_thread/decrypt/set_server_certificate.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/set_server_certificate.js +4 -0
- package/dist/es2017/main_thread/init/media_source_content_initializer.d.ts +0 -8
- 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 +58 -50
- package/dist/es2017/main_thread/init/utils/stream_events_emitter/stream_events_emitter.d.ts +35 -5
- package/dist/es2017/main_thread/init/utils/stream_events_emitter/stream_events_emitter.d.ts.map +1 -1
- package/dist/es2017/main_thread/init/utils/stream_events_emitter/stream_events_emitter.js +60 -19
- package/dist/es2017/main_thread/render_thumbnail.d.ts.map +1 -1
- package/dist/es2017/main_thread/render_thumbnail.js +4 -0
- package/dist/es2017/main_thread/tracks_store/media_element_tracks_store.d.ts.map +1 -1
- package/dist/es2017/main_thread/tracks_store/media_element_tracks_store.js +1 -0
- package/dist/es2017/main_thread/tracks_store/tracks_store.d.ts +1 -1
- package/dist/es2017/main_thread/tracks_store/tracks_store.js +1 -1
- package/dist/{commonjs/parsers/containers/isobmff/take_pssh_out.d.ts → es2017/parsers/containers/isobmff/extract_pssh.d.ts} +6 -4
- package/dist/es2017/parsers/containers/isobmff/extract_pssh.d.ts.map +1 -0
- package/dist/es2017/parsers/containers/isobmff/{take_pssh_out.js → extract_pssh.js} +21 -16
- package/dist/es2017/parsers/containers/isobmff/index.d.ts +2 -2
- package/dist/es2017/parsers/containers/isobmff/index.d.ts.map +1 -1
- package/dist/es2017/parsers/containers/isobmff/index.js +2 -2
- package/dist/es2017/playback_observer/core_playback_observer.d.ts +4 -4
- package/dist/es2017/playback_observer/core_playback_observer.d.ts.map +1 -1
- package/dist/es2017/playback_observer/media_element_playback_observer.d.ts +1 -2
- package/dist/es2017/playback_observer/media_element_playback_observer.d.ts.map +1 -1
- package/dist/es2017/transports/dash/segment_parser.js +2 -2
- package/dist/es2017/transports/local/segment_parser.js +2 -2
- package/dist/es2017/utils/test-utils.d.ts +30 -0
- package/dist/es2017/utils/test-utils.d.ts.map +1 -0
- package/dist/es2017/utils/test-utils.js +36 -0
- package/dist/mpd-parser.wasm +0 -0
- package/dist/worker.js +6 -6
- package/package.json +4 -2
- package/src/README.md +7 -7
- package/src/__GENERATED_CODE/embedded_dash_wasm.ts +1 -1
- package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
- package/src/compat/__tests__/can_patch_out_pssh.test.ts +40 -0
- package/src/compat/can_patch_out_pssh.ts +53 -0
- package/src/compat/env_detector.ts +4 -0
- package/src/core/README.md +1 -1
- package/src/core/adaptive/README.md +3 -3
- package/src/core/adaptive/__tests__/adaptive_representation_selector.test.ts +181 -110
- package/src/core/adaptive/__tests__/guess_based_chooser.test.ts +229 -123
- package/src/core/adaptive/__tests__/mocks.ts +100 -0
- package/src/core/adaptive/__tests__/network_analyzer.test.ts +152 -59
- package/src/core/adaptive/network_analyzer.ts +4 -4
- package/src/core/adaptive/utils/__tests__/filter_by_bitrate.test.ts +11 -19
- package/src/core/adaptive/utils/__tests__/filter_by_resolution.test.ts +12 -12
- package/src/core/adaptive/utils/__tests__/last_estimate_storage.test.ts +25 -12
- package/src/core/adaptive/utils/__tests__/pending_requests_store.test.ts +13 -9
- package/src/core/adaptive/utils/__tests__/representation_score_calculator.test.ts +11 -11
- package/src/core/adaptive/utils/__tests__/select_optimal_representation.test.ts +13 -23
- package/src/core/adaptive/utils/representation_score_calculator.ts +2 -2
- package/src/core/cmcd/__tests__/cmcd_data_builder.test.ts +60 -15
- package/src/core/cmcd/cmcd_data_builder.ts +9 -3
- package/src/core/entry/README.md +2 -2
- package/src/core/entry/__tests__/core_text_displayer_interface.test.ts +20 -0
- package/src/core/entry/content_preparer.ts +2 -5
- package/src/core/entry/core_entry.ts +6 -2
- package/src/core/entry/core_text_displayer_interface.ts +3 -3
- package/src/core/fetchers/manifest/__tests__/manifest_fetcher.test.ts +52 -3
- package/src/core/fetchers/manifest/manifest_fetcher.ts +12 -0
- package/src/core/fetchers/thumbnails/__tests__/thumbnail_fetcher.test.ts +70 -0
- package/src/core/fetchers/thumbnails/thumbnail_fetcher.ts +1 -1
- package/src/core/fetchers/utils/schedule_request.ts +5 -3
- package/src/core/segment_sinks/__tests__/garbage_collector.test.ts +434 -0
- package/src/core/segment_sinks/__tests__/mocks.ts +49 -0
- package/src/core/segment_sinks/garbage_collector.ts +0 -3
- package/src/core/segment_sinks/implementations/text/__tests__/text_segment_sink.test.ts +177 -0
- package/src/core/segment_sinks/implementations/text/text_segment_sink.ts +2 -2
- package/src/core/segment_sinks/inventory/__tests__/buffered_history.test.ts +215 -0
- package/src/core/segment_sinks/inventory/__tests__/segment_inventory.test.ts +448 -0
- package/src/core/stream/adaptation/__tests__/adaptation_stream.test.ts +973 -0
- package/src/core/stream/adaptation/__tests__/get_representations_switch_strategy.test.ts +283 -374
- package/src/core/stream/adaptation/adaptation_stream.ts +6 -8
- package/src/core/stream/orchestrator/README.md +4 -4
- package/src/core/stream/orchestrator/__tests__/stream_orchestrator.test.ts +707 -0
- package/src/core/stream/orchestrator/stream_orchestrator.ts +41 -46
- package/src/core/stream/period/utils/__tests__/get_adaptation_switch_strategy.test.ts +290 -220
- package/src/core/stream/representation/__tests__/encryption_data_notifier.test.ts +93 -63
- package/src/core/stream/representation/utils/__tests__/append_segment_to_buffer.test.ts +106 -63
- package/src/core/stream/representation/utils/__tests__/check_for_discontinuity.test.ts +179 -204
- package/src/core/stream/representation/utils/__tests__/get_segment_priority.test.ts +7 -7
- package/src/core/stream/representation/utils/__tests__/push_init_segment.test.ts +103 -60
- package/src/core/stream/representation/utils/__tests__/push_media_segment.test.ts +231 -165
- package/src/default_config.ts +6 -0
- package/src/experimental/README.md +1 -1
- package/src/features/README.md +3 -3
- package/src/main_thread/api/README.md +6 -7
- package/src/main_thread/api/public_api.ts +16 -10
- package/src/main_thread/decrypt/README.md +4 -4
- package/src/main_thread/decrypt/__tests__/__global__/content_decryptor.test.ts +135 -0
- package/src/main_thread/decrypt/__tests__/__global__/get_license.test.ts +70 -0
- package/src/main_thread/decrypt/__tests__/__global__/server_certificate.test.ts +44 -0
- package/src/main_thread/decrypt/__tests__/__global__/utils.ts +2 -2
- package/src/main_thread/decrypt/content_decryptor.ts +6 -1
- package/src/main_thread/decrypt/session_events_listener.ts +1 -1
- package/src/main_thread/decrypt/set_server_certificate.ts +5 -0
- package/src/main_thread/init/media_source_content_initializer.ts +69 -55
- package/src/main_thread/init/utils/__tests__/stream_events_emitter.test.ts +175 -0
- package/src/main_thread/init/utils/stream_events_emitter/stream_events_emitter.ts +90 -26
- package/src/main_thread/render_thumbnail.ts +4 -0
- package/src/main_thread/tracks_store/README.md +12 -0
- package/src/main_thread/tracks_store/__tests__/media_element_tracks_store.test.ts +25 -18
- package/src/main_thread/tracks_store/media_element_tracks_store.ts +1 -0
- package/src/main_thread/tracks_store/tracks_store.ts +1 -1
- package/src/manifest/classes/__tests__/mocks.ts +202 -0
- package/src/parsers/containers/isobmff/__tests__/extract_pssh.test.ts +199 -0
- package/src/parsers/containers/isobmff/{take_pssh_out.ts → extract_pssh.ts} +21 -17
- package/src/parsers/containers/isobmff/index.ts +2 -2
- package/src/parsers/manifest/dash/wasm-parser/README.md +9 -9
- package/src/playback_observer/__tests__/mocks.ts +152 -0
- package/src/playback_observer/core_playback_observer.ts +4 -4
- package/src/playback_observer/media_element_playback_observer.ts +1 -1
- package/src/tools/README.md +2 -2
- package/src/transports/README.md +5 -5
- package/src/transports/dash/segment_parser.ts +2 -2
- package/src/transports/local/segment_parser.ts +2 -2
- package/src/transports/metaplaylist/README.md +4 -4
- package/src/utils/README.md +3 -3
- package/src/utils/test-utils.ts +50 -0
- package/dist/commonjs/core/entry/synchronize_sinks_on_observation.d.ts +0 -11
- package/dist/commonjs/core/entry/synchronize_sinks_on_observation.d.ts.map +0 -1
- package/dist/commonjs/core/entry/synchronize_sinks_on_observation.js +0 -20
- package/dist/commonjs/parsers/containers/isobmff/take_pssh_out.d.ts.map +0 -1
- package/dist/es2017/core/entry/synchronize_sinks_on_observation.d.ts +0 -11
- package/dist/es2017/core/entry/synchronize_sinks_on_observation.d.ts.map +0 -1
- package/dist/es2017/core/entry/synchronize_sinks_on_observation.js +0 -17
- package/dist/es2017/parsers/containers/isobmff/take_pssh_out.d.ts.map +0 -1
- package/src/core/adaptive/utils/__tests__/bandwith_estimator.test.ts +0 -117
- package/src/core/entry/synchronize_sinks_on_observation.ts +0 -22
|
@@ -1,84 +1,104 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
|
-
import
|
|
1
|
+
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
|
2
|
+
import configHandler from "../../../../../config";
|
|
3
|
+
import {
|
|
4
|
+
DummyRepresentation,
|
|
5
|
+
DummyManifest,
|
|
6
|
+
DummyPeriod,
|
|
7
|
+
DummyAdaptation,
|
|
8
|
+
createSegment,
|
|
9
|
+
} from "../../../../../manifest/classes/__tests__/mocks";
|
|
10
|
+
import {
|
|
11
|
+
DummyObservationPosition,
|
|
12
|
+
makeReadyOnlyPlaybackObserver,
|
|
13
|
+
} from "../../../../../playback_observer/__tests__/mocks";
|
|
14
|
+
import type { IRange } from "../../../../../utils/ranges";
|
|
15
|
+
import SharedReference from "../../../../../utils/reference";
|
|
16
|
+
import TaskCanceller from "../../../../../utils/task_canceller";
|
|
17
|
+
import { DummySegmentSink } from "../../../../segment_sinks/__tests__/mocks";
|
|
18
|
+
import type { IRepresentationStreamPlaybackObservation } from "../../types";
|
|
3
19
|
import pushMediaSegment from "../push_media_segment";
|
|
4
20
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// Mock dependencies with vi.hoisted
|
|
10
|
-
const mockGetCurrent = vi.hoisted(() => vi.fn());
|
|
11
|
-
const mockObjectAssign = vi.hoisted(() => vi.fn());
|
|
12
|
-
const mockAppendSegmentToBuffer = vi.hoisted(() => vi.fn());
|
|
13
|
-
|
|
14
|
-
vi.mock("../../../../../config", () => ({
|
|
15
|
-
default: {
|
|
16
|
-
getCurrent: mockGetCurrent,
|
|
17
|
-
},
|
|
18
|
-
}));
|
|
19
|
-
|
|
20
|
-
vi.mock("../../../../../utils/object_assign", () => ({
|
|
21
|
-
default: mockObjectAssign,
|
|
22
|
-
}));
|
|
23
|
-
|
|
21
|
+
const mockAppendSegmentToBuffer = vi.hoisted(() =>
|
|
22
|
+
vi.fn((): Promise<IRange[]> => Promise.resolve([])),
|
|
23
|
+
);
|
|
24
24
|
vi.mock("../append_segment_to_buffer.ts", () => ({
|
|
25
25
|
default: mockAppendSegmentToBuffer,
|
|
26
26
|
}));
|
|
27
27
|
|
|
28
28
|
describe("pushMediaSegment", () => {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
const mockedPlaybackObserver =
|
|
30
|
+
makeReadyOnlyPlaybackObserver<IRepresentationStreamPlaybackObservation>({
|
|
31
|
+
position: new DummyObservationPosition({
|
|
32
|
+
getWanted: vi.fn(() => 10),
|
|
33
|
+
}),
|
|
34
|
+
paused: {
|
|
35
|
+
last: false,
|
|
36
|
+
pending: undefined,
|
|
37
|
+
},
|
|
38
|
+
speed: 1,
|
|
39
|
+
canStream: true,
|
|
40
|
+
});
|
|
41
|
+
const mockGetCurrent = vi.spyOn(configHandler, "getCurrent");
|
|
42
|
+
|
|
43
|
+
let mockBufferGoal: SharedReference<number>;
|
|
44
|
+
let mockCanceller: TaskCanceller;
|
|
45
|
+
const mockSegmentSink = new DummySegmentSink();
|
|
33
46
|
|
|
34
47
|
const mockContent = {
|
|
35
|
-
adaptation:
|
|
36
|
-
manifest:
|
|
37
|
-
period:
|
|
38
|
-
representation: {
|
|
48
|
+
adaptation: new DummyAdaptation(),
|
|
49
|
+
manifest: new DummyManifest(),
|
|
50
|
+
period: new DummyPeriod(),
|
|
51
|
+
representation: new DummyRepresentation({
|
|
39
52
|
getMimeTypeString: vi.fn(() => 'video/mp4; codecs="avc1.42E01E"'),
|
|
40
|
-
}
|
|
53
|
+
}),
|
|
41
54
|
};
|
|
42
55
|
|
|
43
|
-
const mockSegment = {
|
|
56
|
+
const mockSegment = createSegment({
|
|
44
57
|
time: 10,
|
|
45
58
|
duration: 5,
|
|
46
|
-
|
|
59
|
+
end: 15,
|
|
60
|
+
});
|
|
47
61
|
|
|
48
62
|
beforeEach(() => {
|
|
49
63
|
vi.resetAllMocks();
|
|
64
|
+
mockBufferGoal = new SharedReference<number>(30);
|
|
65
|
+
mockCanceller = new TaskCanceller("pushInitSegment tests");
|
|
50
66
|
mockGetCurrent.mockReturnValue({
|
|
67
|
+
...configHandler.getCurrent(),
|
|
51
68
|
APPEND_WINDOW_SECURITIES: {
|
|
52
69
|
START: 0.1,
|
|
53
70
|
END: 0.2,
|
|
54
71
|
},
|
|
55
72
|
});
|
|
56
|
-
mockObjectAssign.mockImplementation((target, ...sources) =>
|
|
57
|
-
// eslint-disable-next-line no-restricted-properties
|
|
58
|
-
Object.assign(target, ...sources),
|
|
59
|
-
);
|
|
60
73
|
});
|
|
61
74
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
appendWindow: [undefined, undefined] as [number | undefined, number | undefined],
|
|
69
|
-
};
|
|
75
|
+
afterEach(() => {
|
|
76
|
+
mockedPlaybackObserver.reset();
|
|
77
|
+
mockBufferGoal.finish();
|
|
78
|
+
mockCanceller.cancel("test end");
|
|
79
|
+
vi.resetModules();
|
|
80
|
+
});
|
|
70
81
|
|
|
82
|
+
it("should return null when chunkData is null", async () => {
|
|
71
83
|
const result = await pushMediaSegment(
|
|
72
84
|
{
|
|
73
|
-
playbackObserver:
|
|
85
|
+
playbackObserver: mockedPlaybackObserver.observer,
|
|
74
86
|
bufferGoal: mockBufferGoal,
|
|
75
87
|
content: mockContent,
|
|
76
88
|
initSegmentUniqueId: "init-123",
|
|
77
|
-
parsedSegment
|
|
89
|
+
parsedSegment: {
|
|
90
|
+
chunkData: null,
|
|
91
|
+
chunkInfos: null,
|
|
92
|
+
chunkOffset: 0,
|
|
93
|
+
chunkSize: 0,
|
|
94
|
+
appendWindow: [undefined, undefined],
|
|
95
|
+
segmentType: "media",
|
|
96
|
+
protectionData: [],
|
|
97
|
+
},
|
|
78
98
|
segment: mockSegment,
|
|
79
99
|
segmentSink: mockSegmentSink,
|
|
80
100
|
},
|
|
81
|
-
|
|
101
|
+
mockCanceller.signal,
|
|
82
102
|
);
|
|
83
103
|
|
|
84
104
|
expect(result).toBeNull();
|
|
@@ -87,32 +107,33 @@ describe("pushMediaSegment", () => {
|
|
|
87
107
|
|
|
88
108
|
it("should append segment with basic data when chunkData is present", async () => {
|
|
89
109
|
const mockChunkData = new Uint8Array([1, 2, 3]);
|
|
90
|
-
const parsedSegment: any = {
|
|
91
|
-
chunkData: mockChunkData,
|
|
92
|
-
chunkInfos: null,
|
|
93
|
-
chunkOffset: 2.5,
|
|
94
|
-
chunkSize: 1024,
|
|
95
|
-
appendWindow: [undefined, undefined] as [number | undefined, number | undefined],
|
|
96
|
-
};
|
|
97
110
|
|
|
98
111
|
const mockBuffered = [{ start: 10, end: 15 }];
|
|
99
112
|
mockAppendSegmentToBuffer.mockResolvedValue(mockBuffered);
|
|
100
113
|
|
|
101
114
|
const result = await pushMediaSegment(
|
|
102
115
|
{
|
|
103
|
-
playbackObserver:
|
|
116
|
+
playbackObserver: mockedPlaybackObserver.observer,
|
|
104
117
|
bufferGoal: mockBufferGoal,
|
|
105
118
|
content: mockContent,
|
|
106
119
|
initSegmentUniqueId: "init-123",
|
|
107
|
-
parsedSegment
|
|
120
|
+
parsedSegment: {
|
|
121
|
+
chunkData: mockChunkData,
|
|
122
|
+
chunkInfos: null,
|
|
123
|
+
chunkOffset: 2.5,
|
|
124
|
+
chunkSize: 1024,
|
|
125
|
+
appendWindow: [undefined, undefined],
|
|
126
|
+
segmentType: "media",
|
|
127
|
+
protectionData: [],
|
|
128
|
+
},
|
|
108
129
|
segment: mockSegment,
|
|
109
130
|
segmentSink: mockSegmentSink,
|
|
110
131
|
},
|
|
111
|
-
|
|
132
|
+
mockCanceller.signal,
|
|
112
133
|
);
|
|
113
134
|
|
|
114
135
|
expect(mockAppendSegmentToBuffer).toHaveBeenCalledWith(
|
|
115
|
-
|
|
136
|
+
mockedPlaybackObserver.observer,
|
|
116
137
|
mockSegmentSink,
|
|
117
138
|
{
|
|
118
139
|
data: {
|
|
@@ -122,15 +143,16 @@ describe("pushMediaSegment", () => {
|
|
|
122
143
|
appendWindow: [undefined, undefined],
|
|
123
144
|
codec: 'video/mp4; codecs="avc1.42E01E"',
|
|
124
145
|
},
|
|
125
|
-
inventoryInfos:
|
|
146
|
+
inventoryInfos: {
|
|
147
|
+
...mockContent,
|
|
126
148
|
segment: mockSegment,
|
|
127
149
|
chunkSize: 1024,
|
|
128
|
-
start:
|
|
129
|
-
end:
|
|
130
|
-
}
|
|
150
|
+
start: mockSegment.time,
|
|
151
|
+
end: mockSegment.end,
|
|
152
|
+
},
|
|
131
153
|
},
|
|
132
154
|
mockBufferGoal,
|
|
133
|
-
|
|
155
|
+
mockCanceller.signal,
|
|
134
156
|
);
|
|
135
157
|
|
|
136
158
|
expect(result).toEqual({
|
|
@@ -142,202 +164,246 @@ describe("pushMediaSegment", () => {
|
|
|
142
164
|
|
|
143
165
|
it("should use chunkInfos for time calculations when available", async () => {
|
|
144
166
|
const mockChunkData = new Uint8Array([1, 2, 3]);
|
|
145
|
-
const parsedSegment: any = {
|
|
146
|
-
chunkData: mockChunkData,
|
|
147
|
-
chunkInfos: { time: 20, duration: 8 },
|
|
148
|
-
chunkOffset: 0,
|
|
149
|
-
chunkSize: 2048,
|
|
150
|
-
appendWindow: [undefined, undefined] as [number | undefined, number | undefined],
|
|
151
|
-
};
|
|
152
|
-
|
|
153
167
|
mockAppendSegmentToBuffer.mockResolvedValue([]);
|
|
154
168
|
|
|
155
169
|
await pushMediaSegment(
|
|
156
170
|
{
|
|
157
|
-
playbackObserver:
|
|
171
|
+
playbackObserver: mockedPlaybackObserver.observer,
|
|
158
172
|
bufferGoal: mockBufferGoal,
|
|
159
173
|
content: mockContent,
|
|
160
174
|
initSegmentUniqueId: null,
|
|
161
|
-
parsedSegment
|
|
175
|
+
parsedSegment: {
|
|
176
|
+
chunkData: mockChunkData,
|
|
177
|
+
chunkInfos: { time: 20, duration: 8 },
|
|
178
|
+
chunkOffset: 0,
|
|
179
|
+
chunkSize: 2048,
|
|
180
|
+
appendWindow: [undefined, undefined],
|
|
181
|
+
segmentType: "media",
|
|
182
|
+
protectionData: [],
|
|
183
|
+
},
|
|
162
184
|
segment: mockSegment,
|
|
163
185
|
segmentSink: mockSegmentSink,
|
|
164
186
|
},
|
|
165
|
-
|
|
187
|
+
mockCanceller.signal,
|
|
166
188
|
);
|
|
167
189
|
|
|
168
190
|
expect(mockAppendSegmentToBuffer).toHaveBeenCalledWith(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
191
|
+
mockedPlaybackObserver.observer,
|
|
192
|
+
mockSegmentSink,
|
|
193
|
+
{
|
|
194
|
+
data: {
|
|
195
|
+
appendWindow: [undefined, undefined],
|
|
196
|
+
chunk: mockChunkData,
|
|
197
|
+
codec: 'video/mp4; codecs="avc1.42E01E"',
|
|
198
|
+
initSegmentUniqueId: null,
|
|
199
|
+
timestampOffset: 0,
|
|
200
|
+
},
|
|
201
|
+
inventoryInfos: {
|
|
202
|
+
...mockContent,
|
|
203
|
+
segment: mockSegment,
|
|
173
204
|
start: 20,
|
|
174
205
|
end: 28,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
206
|
+
chunkSize: 2048,
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
mockBufferGoal,
|
|
210
|
+
mockCanceller.signal,
|
|
179
211
|
);
|
|
180
212
|
});
|
|
181
213
|
|
|
182
214
|
it("should apply append window securities to start window", async () => {
|
|
183
215
|
const mockChunkData = new Uint8Array([1, 2, 3]);
|
|
184
|
-
const parsedSegment: any = {
|
|
185
|
-
chunkData: mockChunkData,
|
|
186
|
-
chunkInfos: null,
|
|
187
|
-
chunkOffset: 0,
|
|
188
|
-
chunkSize: 1024,
|
|
189
|
-
appendWindow: [5, undefined] as [number | undefined, number | undefined],
|
|
190
|
-
};
|
|
191
|
-
|
|
192
216
|
mockAppendSegmentToBuffer.mockResolvedValue([]);
|
|
193
|
-
|
|
194
217
|
await pushMediaSegment(
|
|
195
218
|
{
|
|
196
|
-
playbackObserver:
|
|
219
|
+
playbackObserver: mockedPlaybackObserver.observer,
|
|
197
220
|
bufferGoal: mockBufferGoal,
|
|
198
221
|
content: mockContent,
|
|
199
222
|
initSegmentUniqueId: "init-123",
|
|
200
|
-
parsedSegment
|
|
223
|
+
parsedSegment: {
|
|
224
|
+
chunkData: mockChunkData,
|
|
225
|
+
chunkInfos: null,
|
|
226
|
+
chunkOffset: 0,
|
|
227
|
+
chunkSize: 1024,
|
|
228
|
+
appendWindow: [5, undefined],
|
|
229
|
+
segmentType: "media",
|
|
230
|
+
protectionData: [],
|
|
231
|
+
},
|
|
201
232
|
segment: mockSegment,
|
|
202
233
|
segmentSink: mockSegmentSink,
|
|
203
234
|
},
|
|
204
|
-
|
|
235
|
+
mockCanceller.signal,
|
|
205
236
|
);
|
|
206
237
|
|
|
207
238
|
expect(mockAppendSegmentToBuffer).toHaveBeenCalledWith(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
data:
|
|
239
|
+
{},
|
|
240
|
+
mockSegmentSink,
|
|
241
|
+
{
|
|
242
|
+
data: {
|
|
243
|
+
chunk: mockChunkData,
|
|
244
|
+
initSegmentUniqueId: "init-123",
|
|
245
|
+
timestampOffset: 0,
|
|
212
246
|
appendWindow: [4.9, undefined], // 5 - 0.1
|
|
213
|
-
|
|
214
|
-
|
|
247
|
+
codec: 'video/mp4; codecs="avc1.42E01E"',
|
|
248
|
+
},
|
|
249
|
+
inventoryInfos: {
|
|
250
|
+
...mockContent,
|
|
215
251
|
start: 10, // max(10, 4.9)
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
252
|
+
end: mockSegment.end,
|
|
253
|
+
chunkSize: 1024,
|
|
254
|
+
segment: mockSegment,
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
mockBufferGoal,
|
|
258
|
+
mockCanceller.signal,
|
|
220
259
|
);
|
|
221
260
|
});
|
|
222
261
|
|
|
223
262
|
it("should apply append window securities to end window", async () => {
|
|
224
263
|
const mockChunkData = new Uint8Array([1, 2, 3]);
|
|
225
|
-
const parsedSegment: any = {
|
|
226
|
-
chunkData: mockChunkData,
|
|
227
|
-
chunkInfos: null,
|
|
228
|
-
chunkOffset: 0,
|
|
229
|
-
chunkSize: 1024,
|
|
230
|
-
appendWindow: [undefined, 20] as [number | undefined, number | undefined],
|
|
231
|
-
};
|
|
232
|
-
|
|
233
264
|
mockAppendSegmentToBuffer.mockResolvedValue([]);
|
|
234
265
|
|
|
235
266
|
await pushMediaSegment(
|
|
236
267
|
{
|
|
237
|
-
playbackObserver:
|
|
268
|
+
playbackObserver: mockedPlaybackObserver.observer,
|
|
238
269
|
bufferGoal: mockBufferGoal,
|
|
239
270
|
content: mockContent,
|
|
240
271
|
initSegmentUniqueId: "init-123",
|
|
241
|
-
parsedSegment
|
|
272
|
+
parsedSegment: {
|
|
273
|
+
chunkData: mockChunkData,
|
|
274
|
+
chunkInfos: null,
|
|
275
|
+
chunkOffset: 0,
|
|
276
|
+
chunkSize: 1024,
|
|
277
|
+
appendWindow: [undefined, 20],
|
|
278
|
+
segmentType: "media",
|
|
279
|
+
protectionData: [],
|
|
280
|
+
},
|
|
242
281
|
segment: mockSegment,
|
|
243
282
|
segmentSink: mockSegmentSink,
|
|
244
283
|
},
|
|
245
|
-
|
|
284
|
+
mockCanceller.signal,
|
|
246
285
|
);
|
|
247
286
|
|
|
248
287
|
expect(mockAppendSegmentToBuffer).toHaveBeenCalledWith(
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
data:
|
|
288
|
+
mockedPlaybackObserver.observer,
|
|
289
|
+
mockSegmentSink,
|
|
290
|
+
{
|
|
291
|
+
data: {
|
|
292
|
+
initSegmentUniqueId: "init-123",
|
|
293
|
+
chunk: mockChunkData,
|
|
294
|
+
timestampOffset: 0,
|
|
295
|
+
codec: 'video/mp4; codecs="avc1.42E01E"',
|
|
253
296
|
appendWindow: [undefined, 20.2], // 20 + 0.2
|
|
254
|
-
}
|
|
255
|
-
inventoryInfos:
|
|
297
|
+
},
|
|
298
|
+
inventoryInfos: {
|
|
299
|
+
...mockContent,
|
|
300
|
+
segment: mockSegment,
|
|
256
301
|
end: 15, // min(15, 20.2)
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
302
|
+
chunkSize: 1024,
|
|
303
|
+
start: mockSegment.time,
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
mockBufferGoal,
|
|
307
|
+
mockCanceller.signal,
|
|
261
308
|
);
|
|
262
309
|
});
|
|
263
310
|
|
|
264
311
|
it("should apply both start and end append windows", async () => {
|
|
265
312
|
const mockChunkData = new Uint8Array([1, 2, 3]);
|
|
266
|
-
const parsedSegment: any = {
|
|
267
|
-
chunkData: mockChunkData,
|
|
268
|
-
chunkInfos: { time: 8, duration: 4 },
|
|
269
|
-
chunkOffset: 0,
|
|
270
|
-
chunkSize: 1024,
|
|
271
|
-
appendWindow: [9, 11] as [number | undefined, number | undefined],
|
|
272
|
-
};
|
|
273
|
-
|
|
274
313
|
mockAppendSegmentToBuffer.mockResolvedValue([]);
|
|
275
314
|
|
|
276
315
|
await pushMediaSegment(
|
|
277
316
|
{
|
|
278
|
-
playbackObserver:
|
|
317
|
+
playbackObserver: mockedPlaybackObserver.observer,
|
|
279
318
|
bufferGoal: mockBufferGoal,
|
|
280
319
|
content: mockContent,
|
|
281
320
|
initSegmentUniqueId: "init-123",
|
|
282
|
-
parsedSegment
|
|
321
|
+
parsedSegment: {
|
|
322
|
+
chunkData: mockChunkData,
|
|
323
|
+
chunkInfos: { time: 8, duration: 4 },
|
|
324
|
+
chunkOffset: 0,
|
|
325
|
+
chunkSize: 1024,
|
|
326
|
+
appendWindow: [9, 11],
|
|
327
|
+
segmentType: "media",
|
|
328
|
+
protectionData: [],
|
|
329
|
+
},
|
|
283
330
|
segment: mockSegment,
|
|
284
331
|
segmentSink: mockSegmentSink,
|
|
285
332
|
},
|
|
286
|
-
|
|
333
|
+
mockCanceller.signal,
|
|
287
334
|
);
|
|
288
335
|
|
|
289
336
|
expect(mockAppendSegmentToBuffer).toHaveBeenCalledWith(
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
data:
|
|
337
|
+
mockedPlaybackObserver.observer,
|
|
338
|
+
mockSegmentSink,
|
|
339
|
+
{
|
|
340
|
+
data: {
|
|
294
341
|
appendWindow: [8.9, 11.2], // [9 - 0.1, 11 + 0.2]
|
|
295
|
-
|
|
296
|
-
|
|
342
|
+
initSegmentUniqueId: "init-123",
|
|
343
|
+
chunk: mockChunkData,
|
|
344
|
+
timestampOffset: 0,
|
|
345
|
+
codec: 'video/mp4; codecs="avc1.42E01E"',
|
|
346
|
+
},
|
|
347
|
+
inventoryInfos: {
|
|
297
348
|
start: 8.9, // max(8, 8.9)
|
|
298
349
|
end: 11.2, // min(12, 11.2)
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
350
|
+
...mockContent,
|
|
351
|
+
segment: mockSegment,
|
|
352
|
+
chunkSize: 1024,
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
mockBufferGoal,
|
|
356
|
+
mockCanceller.signal,
|
|
303
357
|
);
|
|
304
358
|
});
|
|
305
359
|
|
|
306
360
|
it("should not go below 0 for start append window", async () => {
|
|
307
361
|
const mockChunkData = new Uint8Array([1, 2, 3]);
|
|
308
|
-
const parsedSegment: any = {
|
|
309
|
-
chunkData: mockChunkData,
|
|
310
|
-
chunkInfos: null,
|
|
311
|
-
chunkOffset: 0,
|
|
312
|
-
chunkSize: 1024,
|
|
313
|
-
appendWindow: [0.05, undefined] as [number | undefined, number | undefined],
|
|
314
|
-
};
|
|
315
|
-
|
|
316
362
|
mockAppendSegmentToBuffer.mockResolvedValue([]);
|
|
317
363
|
|
|
318
364
|
await pushMediaSegment(
|
|
319
365
|
{
|
|
320
|
-
playbackObserver:
|
|
366
|
+
playbackObserver: mockedPlaybackObserver.observer,
|
|
321
367
|
bufferGoal: mockBufferGoal,
|
|
322
368
|
content: mockContent,
|
|
323
369
|
initSegmentUniqueId: "init-123",
|
|
324
|
-
parsedSegment
|
|
370
|
+
parsedSegment: {
|
|
371
|
+
chunkData: mockChunkData,
|
|
372
|
+
chunkInfos: null,
|
|
373
|
+
chunkOffset: 0,
|
|
374
|
+
chunkSize: 1024,
|
|
375
|
+
appendWindow: [0.05, undefined],
|
|
376
|
+
segmentType: "media",
|
|
377
|
+
protectionData: [],
|
|
378
|
+
},
|
|
325
379
|
segment: mockSegment,
|
|
326
380
|
segmentSink: mockSegmentSink,
|
|
327
381
|
},
|
|
328
|
-
|
|
382
|
+
mockCanceller.signal,
|
|
329
383
|
);
|
|
330
384
|
|
|
331
385
|
expect(mockAppendSegmentToBuffer).toHaveBeenCalledWith(
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
data:
|
|
386
|
+
mockedPlaybackObserver.observer,
|
|
387
|
+
mockSegmentSink,
|
|
388
|
+
{
|
|
389
|
+
data: {
|
|
336
390
|
appendWindow: [0, undefined], // max(0, 0.05 - 0.1)
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
391
|
+
|
|
392
|
+
initSegmentUniqueId: "init-123",
|
|
393
|
+
chunk: mockChunkData,
|
|
394
|
+
timestampOffset: 0,
|
|
395
|
+
codec: 'video/mp4; codecs="avc1.42E01E"',
|
|
396
|
+
},
|
|
397
|
+
inventoryInfos: {
|
|
398
|
+
...mockContent,
|
|
399
|
+
segment: mockSegment,
|
|
400
|
+
chunkSize: 1024,
|
|
401
|
+
start: mockSegment.time,
|
|
402
|
+
end: mockSegment.end,
|
|
403
|
+
},
|
|
404
|
+
},
|
|
405
|
+
mockBufferGoal,
|
|
406
|
+
mockCanceller.signal,
|
|
341
407
|
);
|
|
342
408
|
});
|
|
343
409
|
});
|
package/src/default_config.ts
CHANGED
|
@@ -1262,6 +1262,12 @@ const DEFAULT_CONFIG = {
|
|
|
1262
1262
|
|
|
1263
1263
|
// Compatibility toggles:
|
|
1264
1264
|
|
|
1265
|
+
/**
|
|
1266
|
+
* If set to `true`, we will not patch out a `pssh` box if found in an
|
|
1267
|
+
* ISOBMFF segment.
|
|
1268
|
+
*/
|
|
1269
|
+
PREVENT_PSSH_PATCHING: false,
|
|
1270
|
+
|
|
1265
1271
|
/**
|
|
1266
1272
|
* If set to `true`, we'll always try to check thoroughly that a
|
|
1267
1273
|
* `MediaKeySystemAccess` can be relied on.
|
|
@@ -15,5 +15,5 @@ is mainly to confine the "library path" of that feature to the
|
|
|
15
15
|
`rx-player/experimental/features` subdirectory.
|
|
16
16
|
|
|
17
17
|
Note that tools NEED to be declared in their own directory inside a `./tools/<TOOL_NAME>`
|
|
18
|
-
directory, with their inner `index.
|
|
18
|
+
directory, with their inner `index.ts` file exporting them, as that's a requirement from
|
|
19
19
|
our exporting strategy.
|
package/src/features/README.md
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
This directory regroups the code importing all the "features" of the RxPlayer piece by
|
|
4
4
|
piece.
|
|
5
5
|
|
|
6
|
-
It is mostly used for allowing a library user to only
|
|
7
|
-
|
|
6
|
+
It is mostly used for allowing a library user to import only some features of the RxPlayer
|
|
7
|
+
without importing others.
|
|
8
8
|
|
|
9
9
|
How this is technically done is through a global `features` Object, which will have added
|
|
10
10
|
properties (which corresponds to those features' code) each time a new feature is added.
|
|
@@ -12,4 +12,4 @@ properties (which corresponds to those features' code) each time a new feature i
|
|
|
12
12
|
## For workers
|
|
13
13
|
|
|
14
14
|
The `worker` directory contains features intended for the worker-side that will then be
|
|
15
|
-
exported through the RxPlayer's `worker/features` path.
|
|
15
|
+
exported through the RxPlayer's `experimental/worker/features` path.
|
|
@@ -20,13 +20,12 @@ As such, its main roles are to:
|
|
|
20
20
|
|
|
21
21
|
To facilitate those actions, the API relies on multiple building blocks:
|
|
22
22
|
|
|
23
|
-
- **the `PlaybackObserver` (./playback_observer.ts)**
|
|
24
|
-
|
|
25
|
-
Provide multiple methods allowing to monitor the current playback conditions (e.g. the
|
|
26
|
-
current position and/or the current playback rate). Many RxPlayer modules rely on this
|
|
27
|
-
PlaybackObserver.
|
|
28
|
-
|
|
29
23
|
- **the `option utils` (./option_utils.ts)**
|
|
30
24
|
|
|
31
25
|
Parse options given to some RxPlayer API calls, to add default parameters and provide
|
|
32
|
-
|
|
26
|
+
intelligible warnings/errors
|
|
27
|
+
|
|
28
|
+
- **the `debug` directory (./debug/)**
|
|
29
|
+
|
|
30
|
+
Contains the logic for the debug overlay API, (e.g. that can be rendered through the
|
|
31
|
+
`createDebugElement` RxPlayer API)
|