rx-player 4.5.0-dev.2026031700 → 4.5.0-dev.2026033100
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 +3 -1
- 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/compat/browser_compatibility_types.d.ts +16 -14
- package/dist/commonjs/compat/browser_compatibility_types.d.ts.map +1 -1
- package/dist/commonjs/compat/browser_compatibility_types.js +7 -4
- package/dist/commonjs/compat/browser_version.d.ts +2 -1
- package/dist/commonjs/compat/browser_version.d.ts.map +1 -1
- package/dist/commonjs/compat/browser_version.js +13 -0
- package/dist/commonjs/compat/disable_remote_playback_on_managed_media_source.d.ts.map +1 -1
- package/dist/commonjs/compat/disable_remote_playback_on_managed_media_source.js +1 -1
- package/dist/commonjs/compat/is_codec_supported.d.ts.map +1 -1
- package/dist/commonjs/compat/is_codec_supported.js +4 -3
- package/dist/commonjs/compat/should_patch_out_dolby_vision_config_data_from_mp4.d.ts +26 -0
- package/dist/commonjs/compat/should_patch_out_dolby_vision_config_data_from_mp4.d.ts.map +1 -0
- package/dist/commonjs/compat/should_patch_out_dolby_vision_config_data_from_mp4.js +45 -0
- package/dist/commonjs/core/entry/utils.js +3 -3
- package/dist/commonjs/core/fetchers/segment/segment_fetcher.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/segment/segment_fetcher.js +2 -1
- package/dist/commonjs/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.js +2 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +8 -6
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +4 -3
- package/dist/commonjs/initialize_worker.js +1 -1
- package/dist/commonjs/main_thread/api/debug/modules/segment_buffer_content.js +3 -3
- package/dist/commonjs/main_thread/api/public_api.js +2 -2
- package/dist/commonjs/main_thread/init/utils/update_manifest_codec_support.d.ts.map +1 -1
- package/dist/commonjs/main_thread/init/utils/update_manifest_codec_support.js +24 -12
- package/dist/commonjs/manifest/classes/adaptation.d.ts.map +1 -1
- package/dist/commonjs/manifest/classes/adaptation.js +3 -1
- package/dist/commonjs/manifest/classes/representation.d.ts +6 -2
- package/dist/commonjs/manifest/classes/representation.d.ts.map +1 -1
- package/dist/commonjs/manifest/classes/representation.js +45 -23
- package/dist/commonjs/manifest/types.d.ts +14 -6
- package/dist/commonjs/manifest/types.d.ts.map +1 -1
- package/dist/commonjs/manifest/utils.js +4 -4
- package/dist/commonjs/mse/main_media_source_interface.d.ts.map +1 -1
- package/dist/commonjs/mse/main_media_source_interface.js +3 -2
- package/dist/commonjs/mse/worker_media_source_interface.d.ts.map +1 -1
- package/dist/commonjs/parsers/containers/isobmff/get_box.d.ts +12 -1
- package/dist/commonjs/parsers/containers/isobmff/get_box.d.ts.map +1 -1
- package/dist/commonjs/parsers/containers/isobmff/get_box.js +16 -0
- package/dist/commonjs/parsers/containers/isobmff/index.d.ts +2 -1
- package/dist/commonjs/parsers/containers/isobmff/index.d.ts.map +1 -1
- package/dist/commonjs/parsers/containers/isobmff/index.js +3 -1
- package/dist/commonjs/parsers/containers/isobmff/remove_dolby_vision_config_data.d.ts +13 -0
- package/dist/commonjs/parsers/containers/isobmff/remove_dolby_vision_config_data.d.ts.map +1 -0
- package/dist/commonjs/parsers/containers/isobmff/remove_dolby_vision_config_data.js +180 -0
- package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.js +4 -4
- package/dist/commonjs/transports/dash/segment_parser.d.ts.map +1 -1
- package/dist/commonjs/transports/dash/segment_parser.js +6 -0
- package/dist/commonjs/transports/dash/text_parser.d.ts.map +1 -1
- package/dist/commonjs/transports/dash/text_parser.js +5 -1
- package/dist/commonjs/transports/local/text_parser.d.ts.map +1 -1
- package/dist/commonjs/transports/local/text_parser.js +5 -1
- package/dist/commonjs/transports/metaplaylist/pipelines.d.ts.map +1 -1
- package/dist/commonjs/transports/metaplaylist/pipelines.js +2 -1
- package/dist/commonjs/transports/smooth/pipelines.js +3 -3
- package/dist/commonjs/transports/types.d.ts +28 -2
- package/dist/commonjs/transports/types.d.ts.map +1 -1
- package/dist/commonjs/transports/utils/parse_text_track.d.ts +9 -2
- package/dist/commonjs/transports/utils/parse_text_track.d.ts.map +1 -1
- package/dist/commonjs/transports/utils/parse_text_track.js +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/es2017/compat/browser_compatibility_types.d.ts +16 -14
- package/dist/es2017/compat/browser_compatibility_types.d.ts.map +1 -1
- package/dist/es2017/compat/browser_compatibility_types.js +7 -1
- package/dist/es2017/compat/browser_version.d.ts +2 -1
- package/dist/es2017/compat/browser_version.d.ts.map +1 -1
- package/dist/es2017/compat/browser_version.js +13 -1
- package/dist/es2017/compat/disable_remote_playback_on_managed_media_source.d.ts.map +1 -1
- package/dist/es2017/compat/disable_remote_playback_on_managed_media_source.js +2 -2
- package/dist/es2017/compat/is_codec_supported.d.ts.map +1 -1
- package/dist/es2017/compat/is_codec_supported.js +2 -1
- package/dist/es2017/compat/should_patch_out_dolby_vision_config_data_from_mp4.d.ts +26 -0
- package/dist/es2017/compat/should_patch_out_dolby_vision_config_data_from_mp4.d.ts.map +1 -0
- package/dist/es2017/compat/should_patch_out_dolby_vision_config_data_from_mp4.js +42 -0
- package/dist/es2017/core/entry/utils.js +4 -4
- package/dist/es2017/core/fetchers/segment/segment_fetcher.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/segment/segment_fetcher.js +2 -1
- package/dist/es2017/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.js +2 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +3 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +2 -1
- package/dist/es2017/initialize_worker.js +1 -1
- package/dist/es2017/main_thread/api/debug/modules/segment_buffer_content.js +3 -3
- package/dist/es2017/main_thread/api/public_api.js +2 -2
- package/dist/es2017/main_thread/init/utils/update_manifest_codec_support.d.ts.map +1 -1
- package/dist/es2017/main_thread/init/utils/update_manifest_codec_support.js +9 -7
- package/dist/es2017/manifest/classes/adaptation.d.ts.map +1 -1
- package/dist/es2017/manifest/classes/adaptation.js +3 -1
- package/dist/es2017/manifest/classes/representation.d.ts +6 -2
- package/dist/es2017/manifest/classes/representation.d.ts.map +1 -1
- package/dist/es2017/manifest/classes/representation.js +45 -23
- package/dist/es2017/manifest/types.d.ts +14 -6
- package/dist/es2017/manifest/types.d.ts.map +1 -1
- package/dist/es2017/manifest/utils.js +4 -4
- package/dist/es2017/mse/main_media_source_interface.d.ts.map +1 -1
- package/dist/es2017/mse/main_media_source_interface.js +2 -1
- package/dist/es2017/mse/worker_media_source_interface.d.ts.map +1 -1
- package/dist/es2017/parsers/containers/isobmff/get_box.d.ts +12 -1
- package/dist/es2017/parsers/containers/isobmff/get_box.d.ts.map +1 -1
- package/dist/es2017/parsers/containers/isobmff/get_box.js +16 -1
- package/dist/es2017/parsers/containers/isobmff/index.d.ts +2 -1
- package/dist/es2017/parsers/containers/isobmff/index.d.ts.map +1 -1
- package/dist/es2017/parsers/containers/isobmff/index.js +2 -1
- package/dist/es2017/parsers/containers/isobmff/remove_dolby_vision_config_data.d.ts +13 -0
- package/dist/es2017/parsers/containers/isobmff/remove_dolby_vision_config_data.d.ts.map +1 -0
- package/dist/es2017/parsers/containers/isobmff/remove_dolby_vision_config_data.js +155 -0
- package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.js +4 -4
- package/dist/es2017/transports/dash/segment_parser.d.ts.map +1 -1
- package/dist/es2017/transports/dash/segment_parser.js +7 -1
- package/dist/es2017/transports/dash/text_parser.d.ts.map +1 -1
- package/dist/es2017/transports/dash/text_parser.js +5 -1
- package/dist/es2017/transports/local/text_parser.d.ts.map +1 -1
- package/dist/es2017/transports/local/text_parser.js +5 -1
- package/dist/es2017/transports/metaplaylist/pipelines.d.ts.map +1 -1
- package/dist/es2017/transports/metaplaylist/pipelines.js +2 -1
- package/dist/es2017/transports/smooth/pipelines.js +3 -3
- package/dist/es2017/transports/types.d.ts +28 -2
- package/dist/es2017/transports/types.d.ts.map +1 -1
- package/dist/es2017/transports/utils/parse_text_track.d.ts +9 -2
- package/dist/es2017/transports/utils/parse_text_track.d.ts.map +1 -1
- package/dist/es2017/transports/utils/parse_text_track.js +1 -1
- package/dist/worker.js +6 -6
- package/eslint.config.mjs +1 -14
- package/package.json +1 -1
- package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
- package/src/compat/__tests__/browser_compatibility_types.test.ts +15 -26
- package/src/compat/__tests__/browser_version.test.ts +57 -18
- package/src/compat/__tests__/clear_element_src.test.ts +20 -40
- package/src/compat/__tests__/is_codec_supported.test.ts +39 -44
- package/src/compat/__tests__/is_vtt_cue.test.ts +5 -8
- package/src/compat/__tests__/make_vtt_cue.test.ts +20 -31
- package/src/compat/__tests__/remove_cue.test.ts +8 -20
- package/src/compat/__tests__/should_patch_out_dolby_vision_config_data_from_mp4.test.ts +78 -0
- package/src/compat/browser_compatibility_types.ts +8 -1
- package/src/compat/browser_version.ts +17 -1
- package/src/compat/disable_remote_playback_on_managed_media_source.ts +2 -2
- package/src/compat/is_codec_supported.ts +2 -1
- package/src/compat/should_patch_out_dolby_vision_config_data_from_mp4.ts +50 -0
- package/src/core/adaptive/__tests__/adaptive_representation_selector.test.ts +68 -28
- package/src/core/adaptive/__tests__/buffer_based_chooser.test.ts +26 -84
- package/src/core/entry/__tests__/utils.test.ts +7 -1
- package/src/core/entry/utils.ts +4 -4
- package/src/core/fetchers/segment/segment_fetcher.ts +2 -1
- package/src/errors/__tests__/format_error.test.ts +23 -24
- package/src/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.ts +2 -1
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaDisplayInfos.test.ts +106 -0
- package/src/experimental/tools/mediaCapabilitiesProber/probers/__tests__/HDCPPolicy.test.ts +19 -42
- package/src/experimental/tools/mediaCapabilitiesProber/probers/__tests__/decodingInfo.test.ts +33 -40
- package/src/experimental/tools/mediaCapabilitiesProber/probers/__tests__/defaultCodecsFinder.test.ts +44 -68
- package/src/experimental/tools/mediaCapabilitiesProber/probers/__tests__/mediaContentType.test.ts +45 -80
- package/src/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.ts +3 -1
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.ts +2 -1
- package/src/features/__tests__/add_features.test.ts +12 -27
- package/src/initialize_worker.ts +1 -1
- package/src/main_thread/api/__tests__/option_utils.test.ts +38 -67
- package/src/main_thread/api/__tests__/public_api.test.ts +56 -138
- package/src/main_thread/api/debug/modules/segment_buffer_content.ts +3 -3
- package/src/main_thread/api/public_api.ts +2 -2
- package/src/main_thread/decrypt/__tests__/__global__/find_key_system.test.ts +46 -28
- package/src/main_thread/decrypt/__tests__/__global__/get_license.test.ts +40 -10
- package/src/main_thread/decrypt/__tests__/__global__/init_data.test.ts +112 -129
- package/src/main_thread/decrypt/__tests__/__global__/media_key_system_access.test.ts +282 -377
- package/src/main_thread/decrypt/__tests__/__global__/media_keys.test.ts +70 -63
- package/src/main_thread/decrypt/__tests__/__global__/server_certificate.test.ts +73 -54
- package/src/main_thread/decrypt/__tests__/__global__/utils.ts +43 -83
- package/src/main_thread/decrypt/__tests__/find_key_system.test.ts +36 -17
- package/src/main_thread/decrypt/utils/__tests__/clean_old_stored_persistent_info.test.ts +44 -48
- package/src/main_thread/init/utils/__tests__/are_same_stream_events.test.ts +7 -22
- package/src/main_thread/init/utils/__tests__/refresh_scheduled_events_list.test.ts +3 -6
- package/src/main_thread/init/utils/__tests__/update_manifest_codec_support.test.ts +42 -19
- package/src/main_thread/init/utils/update_manifest_codec_support.ts +8 -6
- package/src/manifest/classes/__tests__/adaptation.test.ts +69 -125
- package/src/manifest/classes/__tests__/manifest.test.ts +88 -95
- package/src/manifest/classes/__tests__/period.test.ts +167 -117
- package/src/manifest/classes/__tests__/representation.test.ts +84 -25
- package/src/manifest/classes/__tests__/update_periods.test.ts +96 -225
- package/src/manifest/classes/adaptation.ts +4 -1
- package/src/manifest/classes/representation.ts +59 -27
- package/src/manifest/types.ts +14 -6
- package/src/manifest/utils.ts +4 -4
- package/src/mse/__tests__/main_media_source_interface.test.ts +3 -1
- package/src/mse/__tests__/worker_media_source_interface.test.ts +608 -0
- package/src/mse/main_media_source_interface.ts +2 -1
- package/src/mse/worker_media_source_interface.ts +2 -2
- package/src/parsers/containers/isobmff/__tests__/get_box.test.ts +449 -0
- package/src/parsers/containers/isobmff/__tests__/remove_dolby_vision_config_data.test.ts +282 -0
- package/src/parsers/containers/isobmff/get_box.ts +17 -0
- package/src/parsers/containers/isobmff/index.ts +8 -1
- package/src/parsers/containers/isobmff/remove_dolby_vision_config_data.ts +179 -0
- package/src/parsers/manifest/dash/common/__tests__/get_clock_offset.test.ts +19 -25
- package/src/parsers/manifest/dash/common/__tests__/get_http_utc-timing_url.test.ts +7 -19
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/ContentProtection.test.ts +26 -37
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/Initialization.test.ts +24 -53
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/SegmentURL.test.ts +31 -78
- package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +6 -4
- package/src/parsers/manifest/utils/__tests__/update_segment_timeline.test.ts +79 -87
- package/src/parsers/texttracks/ttml/__tests__/resolve_styles_inheritance.test.ts +20 -26
- package/src/parsers/texttracks/ttml/html/__tests__/__global__/html_ttml_parser.test.ts +2 -7
- package/src/parsers/texttracks/webvtt/__tests__/parse_cue_block.test.ts +33 -30
- package/src/parsers/texttracks/webvtt/__tests__/parse_style_block.test.ts +33 -100
- package/src/parsers/texttracks/webvtt/html/__tests__/convert_payload_to_html.test.ts +16 -18
- package/src/parsers/texttracks/webvtt/html/__tests__/parse_webvtt_to_div.test.ts +73 -78
- package/src/parsers/texttracks/webvtt/html/__tests__/to_html.test.ts +36 -37
- package/src/transports/dash/segment_parser.ts +13 -0
- package/src/transports/dash/text_parser.ts +5 -1
- package/src/transports/local/text_parser.ts +5 -1
- package/src/transports/metaplaylist/pipelines.ts +2 -1
- package/src/transports/smooth/isobmff/__tests__/create_boxes.test.ts +150 -127
- package/src/transports/smooth/pipelines.ts +3 -3
- package/src/transports/types.ts +28 -2
- package/src/transports/utils/__tests__/check_isobmff_integrity.test.ts +49 -75
- package/src/transports/utils/parse_text_track.ts +10 -3
- package/src/utils/__tests__/object_assign.test.ts +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { MockInstance } from "vitest";
|
|
1
|
+
import type { Mock, MockInstance } from "vitest";
|
|
2
2
|
import { vi } from "vitest";
|
|
3
3
|
import type { IMediaElement } from "../../../../compat/browser_compatibility_types";
|
|
4
|
-
import type {
|
|
4
|
+
import type { IEncryptedEventData, IEmeApiImplementation } from "../../../../compat/eme";
|
|
5
5
|
import type { IKeySystemOption } from "../../../../public_types";
|
|
6
6
|
import { base64ToBytes, bytesToBase64 } from "../../../../utils/base64";
|
|
7
7
|
import EventEmitter from "../../../../utils/event_emitter";
|
|
@@ -276,15 +276,15 @@ class MockedDecryptorEventEmitter extends EventEmitter<{
|
|
|
276
276
|
/**
|
|
277
277
|
* Mock functions coming from the compat directory.
|
|
278
278
|
*/
|
|
279
|
-
export function mockCompat(
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
) {
|
|
279
|
+
export function mockCompat(mocks: {
|
|
280
|
+
canReuseMediaKeys: Mock;
|
|
281
|
+
shouldRenewMediaKeySystemAccess: Mock;
|
|
282
|
+
onEncrypted: Mock;
|
|
283
|
+
requestMediaKeySystemAccess: Mock;
|
|
284
|
+
setMediaKeys: Mock;
|
|
285
|
+
getInitData: Mock;
|
|
286
|
+
generateKeyRequest: Mock;
|
|
287
|
+
}) {
|
|
288
288
|
const ee = new MockedDecryptorEventEmitter();
|
|
289
289
|
const mockEvents: Record<string, MockInstance> = {
|
|
290
290
|
onKeyMessage: vi
|
|
@@ -349,80 +349,44 @@ export function mockCompat(
|
|
|
349
349
|
),
|
|
350
350
|
};
|
|
351
351
|
|
|
352
|
-
const mockOnEncrypted =
|
|
353
|
-
presets.onEncrypted ??
|
|
354
|
-
vi
|
|
355
|
-
.fn()
|
|
356
|
-
.mockImplementation(
|
|
357
|
-
(elt: IMediaElement, fn: (x: unknown) => void, signal: CancellationSignal) => {
|
|
358
|
-
elt.addEventListener("encrypted", fn);
|
|
359
|
-
signal.register(() => {
|
|
360
|
-
elt.removeEventListener("encrypted", fn);
|
|
361
|
-
});
|
|
362
|
-
ee.addEventListener(
|
|
363
|
-
"encrypted",
|
|
364
|
-
(evt) => {
|
|
365
|
-
if (evt.elt === elt) {
|
|
366
|
-
fn(evt.value);
|
|
367
|
-
}
|
|
368
|
-
},
|
|
369
|
-
signal,
|
|
370
|
-
);
|
|
371
|
-
},
|
|
372
|
-
);
|
|
373
|
-
const mockRmksa =
|
|
374
|
-
presets.requestMediaKeySystemAccess ??
|
|
375
|
-
vi.fn().mockImplementation(requestMediaKeySystemAccessImpl);
|
|
376
|
-
const mockSetMediaKeys =
|
|
377
|
-
presets.setMediaKeys ?? vi.fn().mockImplementation(() => Promise.resolve());
|
|
378
|
-
const mockGenerateKeyRequest = vi
|
|
352
|
+
const mockOnEncrypted = vi
|
|
379
353
|
.fn()
|
|
380
354
|
.mockImplementation(
|
|
381
|
-
(
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
355
|
+
(elt: IMediaElement, fn: (x: unknown) => void, signal: CancellationSignal) => {
|
|
356
|
+
elt.addEventListener("encrypted", fn);
|
|
357
|
+
signal.register(() => {
|
|
358
|
+
elt.removeEventListener("encrypted", fn);
|
|
359
|
+
});
|
|
360
|
+
ee.addEventListener(
|
|
361
|
+
"encrypted",
|
|
362
|
+
(evt) => {
|
|
363
|
+
if (evt.elt === elt) {
|
|
364
|
+
fn(evt.value);
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
signal,
|
|
368
|
+
);
|
|
387
369
|
},
|
|
388
370
|
);
|
|
371
|
+
const mockRmksa = requestMediaKeySystemAccessImpl;
|
|
372
|
+
const mockSetMediaKeys = () => Promise.resolve();
|
|
373
|
+
const mockGenerateKeyRequest = (
|
|
374
|
+
mks: MediaKeySessionImpl,
|
|
375
|
+
initializationDataType: string,
|
|
376
|
+
initializationData: BufferSource,
|
|
377
|
+
) => {
|
|
378
|
+
return mks.generateRequest(initializationDataType, initializationData);
|
|
379
|
+
};
|
|
389
380
|
|
|
390
|
-
const mockGetInitData =
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
return encryptedEvent;
|
|
394
|
-
});
|
|
395
|
-
|
|
396
|
-
if (presets.shouldRenewMediaKeySystemAccess === undefined) {
|
|
397
|
-
vi.doMock("../../../../compat/should_renew_media_key_system_access", () => ({
|
|
398
|
-
default: vi.fn().mockImplementation(() => false),
|
|
399
|
-
}));
|
|
400
|
-
} else {
|
|
401
|
-
vi.doMock("../../../../compat/should_renew_media_key_system_access", () => ({
|
|
402
|
-
default: presets.shouldRenewMediaKeySystemAccess,
|
|
403
|
-
}));
|
|
404
|
-
}
|
|
405
|
-
if (presets.canReuseMediaKeys === undefined) {
|
|
406
|
-
vi.doMock("../../../../compat/can_reuse_media_keys", () => ({
|
|
407
|
-
default: vi.fn().mockImplementation(() => true),
|
|
408
|
-
}));
|
|
409
|
-
} else {
|
|
410
|
-
vi.doMock("../../../../compat/can_reuse_media_keys", () => ({
|
|
411
|
-
default: presets.canReuseMediaKeys,
|
|
412
|
-
}));
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
const emeImplementation = {
|
|
416
|
-
onEncrypted: mockOnEncrypted,
|
|
417
|
-
requestMediaKeySystemAccess: mockRmksa,
|
|
418
|
-
setMediaKeys: mockSetMediaKeys,
|
|
419
|
-
} as unknown as IEmeApiImplementation;
|
|
381
|
+
const mockGetInitData = (encryptedEvent: IEncryptedEventData) => {
|
|
382
|
+
return encryptedEvent;
|
|
383
|
+
};
|
|
420
384
|
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
385
|
+
mocks.onEncrypted.mockImplementation(mockOnEncrypted);
|
|
386
|
+
mocks.requestMediaKeySystemAccess.mockImplementation(mockRmksa);
|
|
387
|
+
mocks.setMediaKeys.mockImplementation(mockSetMediaKeys);
|
|
388
|
+
mocks.getInitData.mockImplementation(mockGetInitData);
|
|
389
|
+
mocks.generateKeyRequest.mockImplementation(mockGenerateKeyRequest);
|
|
426
390
|
|
|
427
391
|
return {
|
|
428
392
|
mockEvents,
|
|
@@ -440,10 +404,6 @@ export function mockCompat(
|
|
|
440
404
|
ee.triggerKeyStatusesChange(session, value);
|
|
441
405
|
},
|
|
442
406
|
},
|
|
443
|
-
mockRequestMediaKeySystemAccess: mockRmksa,
|
|
444
|
-
mockGetInitData,
|
|
445
|
-
mockSetMediaKeys,
|
|
446
|
-
mockGenerateKeyRequest,
|
|
447
407
|
};
|
|
448
408
|
}
|
|
449
409
|
|
|
@@ -1,24 +1,39 @@
|
|
|
1
|
-
import type { MockInstance } from "vitest";
|
|
2
1
|
import { describe, beforeEach, it, expect, vi, afterEach } from "vitest";
|
|
3
|
-
import type { IEmeApiImplementation } from "../../../compat/eme";
|
|
4
2
|
import getEmeApiImplementation from "../../../compat/eme";
|
|
3
|
+
import type { IEmeApiImplementation } from "../../../compat/eme";
|
|
5
4
|
import type { IKeySystemOption } from "../../../public_types";
|
|
6
5
|
import TaskCanceller from "../../../utils/task_canceller";
|
|
7
6
|
import getMediaKeySystemAccess from "../find_key_system";
|
|
8
7
|
import LoadedSessionsStore from "../utils/loaded_sessions_store";
|
|
9
8
|
import mediaKeysAttacher from "../utils/media_keys_attacher";
|
|
10
9
|
|
|
10
|
+
const mocks = vi.hoisted(() => {
|
|
11
|
+
return {
|
|
12
|
+
requestMediaKeySystemAccess: vi.fn(),
|
|
13
|
+
};
|
|
14
|
+
});
|
|
15
|
+
vi.mock("../../../compat/eme", () => ({
|
|
16
|
+
default: () => ({
|
|
17
|
+
onEncrypted: vi.fn(),
|
|
18
|
+
requestMediaKeySystemAccess: mocks.requestMediaKeySystemAccess,
|
|
19
|
+
setMediaKeys: vi.fn(() => Promise.resolve()),
|
|
20
|
+
}),
|
|
21
|
+
getInitData: vi.fn(),
|
|
22
|
+
generateKeyRequest: vi.fn(),
|
|
23
|
+
closeSession: vi.fn(),
|
|
24
|
+
loadSession: vi.fn(),
|
|
25
|
+
}));
|
|
26
|
+
|
|
11
27
|
describe("find_key_systems - ", () => {
|
|
12
28
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
13
29
|
const oldRequestMediaKeySystemAccess = navigator.requestMediaKeySystemAccess;
|
|
14
30
|
let eme: IEmeApiImplementation;
|
|
15
|
-
let requestMediaKeySystemAccessMock: MockInstance;
|
|
16
31
|
|
|
17
32
|
beforeEach(() => {
|
|
18
33
|
// NOTE: We prefer resetting `navigator.requestMediaKeySystemAccess` as DOM
|
|
19
34
|
// implementations often forget to implement it.
|
|
20
35
|
navigator.requestMediaKeySystemAccess = vi.fn();
|
|
21
|
-
|
|
36
|
+
mocks.requestMediaKeySystemAccess.mockReset();
|
|
22
37
|
const implem = getEmeApiImplementation("auto");
|
|
23
38
|
if (implem === null) {
|
|
24
39
|
throw new Error("Could not initialize EME implementation");
|
|
@@ -30,6 +45,7 @@ describe("find_key_systems - ", () => {
|
|
|
30
45
|
navigator.requestMediaKeySystemAccess = oldRequestMediaKeySystemAccess;
|
|
31
46
|
vi.resetModules();
|
|
32
47
|
vi.restoreAllMocks();
|
|
48
|
+
mocks.requestMediaKeySystemAccess.mockReset();
|
|
33
49
|
});
|
|
34
50
|
|
|
35
51
|
const baseEmeConfiguration: MediaKeySystemConfiguration = {
|
|
@@ -164,13 +180,14 @@ describe("find_key_systems - ", () => {
|
|
|
164
180
|
};
|
|
165
181
|
|
|
166
182
|
it("should create a media key the first time and then reuse the previous one if it's the same configuration", async () => {
|
|
167
|
-
|
|
183
|
+
mocks.requestMediaKeySystemAccess.mockImplementation(() => {
|
|
168
184
|
return {
|
|
169
185
|
keySystem: "com.widevine.alpha",
|
|
170
186
|
createMediaKeys: () => ({
|
|
171
187
|
createSession: () => ({
|
|
172
|
-
|
|
173
|
-
|
|
188
|
+
generateRequest: () => {
|
|
189
|
+
/* noop */
|
|
190
|
+
},
|
|
174
191
|
}),
|
|
175
192
|
}),
|
|
176
193
|
getConfiguration: () => {
|
|
@@ -217,19 +234,20 @@ describe("find_key_systems - ", () => {
|
|
|
217
234
|
});
|
|
218
235
|
|
|
219
236
|
it("should create a media key the first time and then create another one if the previous is not compatible.", async () => {
|
|
220
|
-
|
|
221
|
-
return {
|
|
237
|
+
mocks.requestMediaKeySystemAccess.mockImplementation(() => {
|
|
238
|
+
return Promise.resolve({
|
|
222
239
|
keySystem: "com.widevine.alpha",
|
|
223
240
|
createMediaKeys: () => ({
|
|
224
241
|
createSession: () => ({
|
|
225
|
-
|
|
226
|
-
|
|
242
|
+
generateRequest: () => {
|
|
243
|
+
/* noop */
|
|
244
|
+
},
|
|
227
245
|
}),
|
|
228
246
|
}),
|
|
229
247
|
getConfiguration: () => {
|
|
230
248
|
return baseEmeConfiguration;
|
|
231
249
|
},
|
|
232
|
-
};
|
|
250
|
+
});
|
|
233
251
|
});
|
|
234
252
|
const mediaElement = document.createElement("video");
|
|
235
253
|
const keySystemOptionsA: IKeySystemOption[] = [
|
|
@@ -278,19 +296,20 @@ describe("find_key_systems - ", () => {
|
|
|
278
296
|
});
|
|
279
297
|
|
|
280
298
|
it("should create a media key the first time and then reuse the previous one if it's a different configuration but it's a compatible configuration.", async () => {
|
|
281
|
-
|
|
282
|
-
return {
|
|
299
|
+
mocks.requestMediaKeySystemAccess.mockImplementation(() => {
|
|
300
|
+
return Promise.resolve({
|
|
283
301
|
keySystem: "com.widevine.alpha",
|
|
284
302
|
createMediaKeys: () => ({
|
|
285
303
|
createSession: () => ({
|
|
286
|
-
|
|
287
|
-
|
|
304
|
+
generateRequest: () => {
|
|
305
|
+
/* noop */
|
|
306
|
+
},
|
|
288
307
|
}),
|
|
289
308
|
}),
|
|
290
309
|
getConfiguration: () => {
|
|
291
310
|
return baseEmeConfiguration;
|
|
292
311
|
},
|
|
293
|
-
};
|
|
312
|
+
});
|
|
294
313
|
});
|
|
295
314
|
const mediaElement = document.createElement("video");
|
|
296
315
|
const keySystemOptionsA: IKeySystemOption[] = [
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { describe, it, expect, vi } from "vitest";
|
|
2
|
-
import
|
|
1
|
+
import { describe, it, expect, vi, afterEach } from "vitest";
|
|
2
|
+
import log from "../../../../log";
|
|
3
|
+
import cleanOldStoredPersistentInfo from "../clean_old_stored_persistent_info";
|
|
3
4
|
import type PersistentSessionsStore from "../persistent_sessions_store";
|
|
4
5
|
|
|
6
|
+
const logInfo = vi.spyOn(log, "info").mockImplementation(() => {
|
|
7
|
+
/* noop */
|
|
8
|
+
});
|
|
9
|
+
|
|
5
10
|
function createPersistentSessionsStore(): PersistentSessionsStore {
|
|
6
11
|
return {
|
|
7
12
|
getLength(): number {
|
|
@@ -31,21 +36,15 @@ const emptyPersistentSessionsStore = {
|
|
|
31
36
|
* @param {Object} persistentSessionsStore
|
|
32
37
|
* @param {number} limit
|
|
33
38
|
*/
|
|
34
|
-
|
|
39
|
+
function checkNothingHappen(
|
|
35
40
|
persistentSessionsStore: PersistentSessionsStore,
|
|
36
41
|
limit: number,
|
|
37
42
|
) {
|
|
43
|
+
logInfo.mockClear();
|
|
38
44
|
const mockDeleteLast = vi.spyOn(persistentSessionsStore, "deleteOldSessions");
|
|
39
|
-
const mockLogInfo = vi.fn();
|
|
40
|
-
vi.doMock("../../../../log", () => ({
|
|
41
|
-
default: { info: mockLogInfo },
|
|
42
|
-
}));
|
|
43
|
-
const cleanOldStoredPersistentInfo = (
|
|
44
|
-
await vi.importActual("../clean_old_stored_persistent_info")
|
|
45
|
-
).default as typeof ICleanOldStoredPersistentInfo;
|
|
46
45
|
cleanOldStoredPersistentInfo(persistentSessionsStore, limit);
|
|
47
46
|
expect(mockDeleteLast).not.toHaveBeenCalled();
|
|
48
|
-
expect(
|
|
47
|
+
expect(logInfo).not.toHaveBeenCalled();
|
|
49
48
|
vi.resetModules();
|
|
50
49
|
}
|
|
51
50
|
|
|
@@ -56,24 +55,18 @@ async function checkNothingHappen(
|
|
|
56
55
|
* @param {number} limit
|
|
57
56
|
* @param {number} numberToRemove
|
|
58
57
|
*/
|
|
59
|
-
|
|
58
|
+
function checkRemoved(
|
|
60
59
|
persistentSessionsStore: PersistentSessionsStore,
|
|
61
60
|
limit: number,
|
|
62
61
|
numberToRemove: number,
|
|
63
62
|
) {
|
|
63
|
+
logInfo.mockClear();
|
|
64
64
|
const mockDeleteLast = vi.spyOn(persistentSessionsStore, "deleteOldSessions");
|
|
65
|
-
const mockLogInfo = vi.fn();
|
|
66
|
-
vi.doMock("../../../../log", () => ({
|
|
67
|
-
default: { info: mockLogInfo },
|
|
68
|
-
}));
|
|
69
|
-
const cleanOldStoredPersistentInfo = (
|
|
70
|
-
await vi.importActual("../clean_old_stored_persistent_info")
|
|
71
|
-
).default as typeof ICleanOldStoredPersistentInfo;
|
|
72
65
|
cleanOldStoredPersistentInfo(persistentSessionsStore, limit);
|
|
73
66
|
expect(mockDeleteLast).toHaveBeenCalledTimes(1);
|
|
74
67
|
expect(mockDeleteLast).toHaveBeenCalledWith(numberToRemove);
|
|
75
|
-
expect(
|
|
76
|
-
expect(
|
|
68
|
+
expect(logInfo).toHaveBeenCalledTimes(1);
|
|
69
|
+
expect(logInfo).toHaveBeenCalledWith(
|
|
77
70
|
"DRM",
|
|
78
71
|
"Too many stored persistent sessions, removing some.",
|
|
79
72
|
{
|
|
@@ -85,44 +78,47 @@ async function checkRemoved(
|
|
|
85
78
|
}
|
|
86
79
|
|
|
87
80
|
describe("decrypt - cleanOldStoredPersistentInfo", () => {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
81
|
+
afterEach(() => {
|
|
82
|
+
logInfo.mockClear();
|
|
83
|
+
});
|
|
84
|
+
it("should do nothing with a negative limit", () => {
|
|
85
|
+
checkNothingHappen(createPersistentSessionsStore(), -1);
|
|
86
|
+
checkNothingHappen(createPersistentSessionsStore(), -20);
|
|
87
|
+
checkNothingHappen(emptyPersistentSessionsStore, -20);
|
|
92
88
|
});
|
|
93
89
|
|
|
94
|
-
it("should do nothing with a limit equal to NaN",
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
it("should do nothing with a limit equal to NaN", () => {
|
|
91
|
+
checkNothingHappen(createPersistentSessionsStore(), NaN);
|
|
92
|
+
checkNothingHappen(emptyPersistentSessionsStore, NaN);
|
|
97
93
|
});
|
|
98
94
|
|
|
99
|
-
it("should do nothing with a limit equal to -infinity",
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
it("should do nothing with a limit equal to -infinity", () => {
|
|
96
|
+
checkNothingHappen(createPersistentSessionsStore(), -Infinity);
|
|
97
|
+
checkNothingHappen(emptyPersistentSessionsStore, -Infinity);
|
|
102
98
|
});
|
|
103
99
|
|
|
104
|
-
it("should do nothing if the limit is superior to the current length",
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
100
|
+
it("should do nothing if the limit is superior to the current length", () => {
|
|
101
|
+
checkNothingHappen(createPersistentSessionsStore(), 4);
|
|
102
|
+
checkNothingHappen(createPersistentSessionsStore(), 5);
|
|
103
|
+
checkNothingHappen(createPersistentSessionsStore(), 6);
|
|
104
|
+
checkNothingHappen(createPersistentSessionsStore(), +Infinity);
|
|
105
|
+
checkNothingHappen(emptyPersistentSessionsStore, 1);
|
|
106
|
+
checkNothingHappen(emptyPersistentSessionsStore, 2);
|
|
107
|
+
checkNothingHappen(emptyPersistentSessionsStore, 1000);
|
|
108
|
+
checkNothingHappen(emptyPersistentSessionsStore, +Infinity);
|
|
113
109
|
});
|
|
114
110
|
|
|
115
|
-
it("should do nothing if the limit is equal to the current length",
|
|
116
|
-
|
|
117
|
-
|
|
111
|
+
it("should do nothing if the limit is equal to the current length", () => {
|
|
112
|
+
checkNothingHappen(createPersistentSessionsStore(), 3);
|
|
113
|
+
checkNothingHappen(emptyPersistentSessionsStore, 0);
|
|
118
114
|
});
|
|
119
115
|
|
|
120
|
-
it("should remove some if the limit is inferior to the current length",
|
|
121
|
-
|
|
122
|
-
|
|
116
|
+
it("should remove some if the limit is inferior to the current length", () => {
|
|
117
|
+
checkRemoved(createPersistentSessionsStore(), 1, 2);
|
|
118
|
+
checkRemoved(createPersistentSessionsStore(), 2, 1);
|
|
123
119
|
});
|
|
124
120
|
|
|
125
|
-
it("should remove all if the limit is equal to 0",
|
|
126
|
-
|
|
121
|
+
it("should remove all if the limit is equal to 0", () => {
|
|
122
|
+
checkRemoved(createPersistentSessionsStore(), 0, 3);
|
|
127
123
|
});
|
|
128
124
|
});
|
|
@@ -1,49 +1,34 @@
|
|
|
1
|
-
import { describe, it, expect
|
|
2
|
-
import
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import areSameStreamEvents from "../stream_events_emitter/are_same_stream_events";
|
|
3
3
|
|
|
4
4
|
describe("init - areSameStreamEvents", () => {
|
|
5
|
-
it("should consider two events to be the same with defined ends",
|
|
5
|
+
it("should consider two events to be the same with defined ends", () => {
|
|
6
6
|
const evt1 = { start: 0, end: 10, id: "1" };
|
|
7
7
|
const evt2 = { start: 0, end: 10, id: "1" };
|
|
8
|
-
const areSameStreamEvents = (
|
|
9
|
-
await vi.importActual("../stream_events_emitter/are_same_stream_events.ts")
|
|
10
|
-
).default as typeof IAreSameStreamEvents;
|
|
11
8
|
const result = areSameStreamEvents(evt1, evt2);
|
|
12
9
|
expect(result).toBe(true);
|
|
13
10
|
});
|
|
14
|
-
it("should consider two events to be the same with undefined ends",
|
|
11
|
+
it("should consider two events to be the same with undefined ends", () => {
|
|
15
12
|
const evt1 = { start: 0, end: undefined, id: "1" };
|
|
16
13
|
const evt2 = { start: 0, end: undefined, id: "1" };
|
|
17
|
-
const areSameStreamEvents = (
|
|
18
|
-
await vi.importActual("../stream_events_emitter/are_same_stream_events.ts")
|
|
19
|
-
).default as typeof IAreSameStreamEvents;
|
|
20
14
|
const result = areSameStreamEvents(evt1, evt2);
|
|
21
15
|
expect(result).toBe(true);
|
|
22
16
|
});
|
|
23
|
-
it("should consider two events not to be the same - different ids",
|
|
17
|
+
it("should consider two events not to be the same - different ids", () => {
|
|
24
18
|
const evt1 = { start: 0, end: undefined, id: "1" };
|
|
25
19
|
const evt2 = { start: 0, end: undefined, id: "2" };
|
|
26
|
-
const areSameStreamEvents = (
|
|
27
|
-
await vi.importActual("../stream_events_emitter/are_same_stream_events.ts")
|
|
28
|
-
).default as typeof IAreSameStreamEvents;
|
|
29
20
|
const result = areSameStreamEvents(evt1, evt2);
|
|
30
21
|
expect(result).toBe(false);
|
|
31
22
|
});
|
|
32
|
-
it("should consider two events not to be the same - different starts",
|
|
23
|
+
it("should consider two events not to be the same - different starts", () => {
|
|
33
24
|
const evt1 = { start: 0, end: undefined, id: "1" };
|
|
34
25
|
const evt2 = { start: 10, end: undefined, id: "1" };
|
|
35
|
-
const areSameStreamEvents = (
|
|
36
|
-
await vi.importActual("../stream_events_emitter/are_same_stream_events.ts")
|
|
37
|
-
).default as typeof IAreSameStreamEvents;
|
|
38
26
|
const result = areSameStreamEvents(evt1, evt2);
|
|
39
27
|
expect(result).toBe(false);
|
|
40
28
|
});
|
|
41
|
-
it("should consider two events not to be the same - different end",
|
|
29
|
+
it("should consider two events not to be the same - different end", () => {
|
|
42
30
|
const evt1 = { start: 0, end: 10, id: "1" };
|
|
43
31
|
const evt2 = { start: 0, end: 30, id: "1" };
|
|
44
|
-
const areSameStreamEvents = (
|
|
45
|
-
await vi.importActual("../stream_events_emitter/are_same_stream_events.ts")
|
|
46
|
-
).default as typeof IAreSameStreamEvents;
|
|
47
32
|
const result = areSameStreamEvents(evt1, evt2);
|
|
48
33
|
expect(result).toBe(false);
|
|
49
34
|
});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { describe, it, expect
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
2
|
import type { IManifest } from "../../../../manifest";
|
|
3
3
|
import type { IParsedStreamEventData } from "../../../../parsers/manifest";
|
|
4
4
|
import type { IStreamEventData } from "../../../../public_types";
|
|
5
|
-
import
|
|
5
|
+
import refreshScheduledEventsList from "../stream_events_emitter/refresh_scheduled_events_list";
|
|
6
6
|
import type {
|
|
7
7
|
INonFiniteStreamEventPayload,
|
|
8
8
|
IStreamEventPayload,
|
|
9
9
|
} from "../stream_events_emitter/types";
|
|
10
10
|
|
|
11
11
|
describe("init - refreshScheduledEventsList", () => {
|
|
12
|
-
it("should correctly refresh scheduled events",
|
|
12
|
+
it("should correctly refresh scheduled events", () => {
|
|
13
13
|
function generateInputEventData(): IParsedStreamEventData {
|
|
14
14
|
return {
|
|
15
15
|
type: "dash-event-stream",
|
|
@@ -81,9 +81,6 @@ describe("init - refreshScheduledEventsList", () => {
|
|
|
81
81
|
},
|
|
82
82
|
},
|
|
83
83
|
];
|
|
84
|
-
const refreshScheduledEventsList = (
|
|
85
|
-
await vi.importActual("../stream_events_emitter/refresh_scheduled_events_list.ts")
|
|
86
|
-
).default as typeof IRefreshScheduledEventsList;
|
|
87
84
|
|
|
88
85
|
const scheduledEvents = refreshScheduledEventsList(oldScheduledEvents, manifest);
|
|
89
86
|
expect(scheduledEvents).toEqual([
|
|
@@ -77,12 +77,22 @@ function generateFakeManifestWithRepresentations(
|
|
|
77
77
|
beforeAll(() => {
|
|
78
78
|
// Mock MediaSource APIs
|
|
79
79
|
vi.mock("../../../../compat/browser_compatibility_types", () => ({
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
default: {
|
|
81
|
+
READY_STATES: {
|
|
82
|
+
HAVE_NOTHING: 0,
|
|
83
|
+
HAVE_METADATA: 1,
|
|
84
|
+
HAVE_CURRENT_DATA: 2,
|
|
85
|
+
HAVE_FUTURE_DATA: 3,
|
|
86
|
+
HAVE_ENOUGH_DATA: 4,
|
|
87
|
+
},
|
|
88
|
+
isManagedMediaSource: false,
|
|
89
|
+
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
90
|
+
MediaSource_: class {
|
|
91
|
+
static isTypeSupported(type: string) {
|
|
92
|
+
// Mocked behavior: return true for all codecs and return false for vp9 codec
|
|
93
|
+
return type.indexOf("vp9") === -1;
|
|
94
|
+
}
|
|
95
|
+
},
|
|
86
96
|
},
|
|
87
97
|
}));
|
|
88
98
|
|
|
@@ -139,7 +149,8 @@ describe("init - utils - updateManifestCodecSupport", () => {
|
|
|
139
149
|
bitrate: 1000,
|
|
140
150
|
id: "representation1",
|
|
141
151
|
uniqueId: "representation1",
|
|
142
|
-
|
|
152
|
+
baseCodecs: ["avc1.4d401e"],
|
|
153
|
+
chosenCodec: "avc1.4d401e",
|
|
143
154
|
mimeType: "video/mp4",
|
|
144
155
|
isSupported: undefined,
|
|
145
156
|
};
|
|
@@ -148,7 +159,8 @@ describe("init - utils - updateManifestCodecSupport", () => {
|
|
|
148
159
|
bitrate: 2000,
|
|
149
160
|
id: "representation2",
|
|
150
161
|
uniqueId: "representation2",
|
|
151
|
-
|
|
162
|
+
baseCodecs: ["hvc1.2.4.L153.B0"],
|
|
163
|
+
chosenCodec: "hvc1.2.4.L153.B0",
|
|
152
164
|
mimeType: "video/mp4",
|
|
153
165
|
isSupported: undefined,
|
|
154
166
|
};
|
|
@@ -157,7 +169,8 @@ describe("init - utils - updateManifestCodecSupport", () => {
|
|
|
157
169
|
bitrate: 3000,
|
|
158
170
|
id: "representation3",
|
|
159
171
|
uniqueId: "representation3",
|
|
160
|
-
|
|
172
|
+
baseCodecs: ["vp9"],
|
|
173
|
+
chosenCodec: "vp9",
|
|
161
174
|
mimeType: "video/mp4",
|
|
162
175
|
isSupported: undefined,
|
|
163
176
|
};
|
|
@@ -166,7 +179,8 @@ describe("init - utils - updateManifestCodecSupport", () => {
|
|
|
166
179
|
bitrate: 1000,
|
|
167
180
|
id: "representation4",
|
|
168
181
|
uniqueId: "representation4",
|
|
169
|
-
|
|
182
|
+
baseCodecs: ["mp4a.40.2"],
|
|
183
|
+
chosenCodec: "mp4a.40.2",
|
|
170
184
|
mimeType: "audio/mp4",
|
|
171
185
|
isSupported: undefined,
|
|
172
186
|
};
|
|
@@ -175,7 +189,8 @@ describe("init - utils - updateManifestCodecSupport", () => {
|
|
|
175
189
|
bitrate: 2000,
|
|
176
190
|
id: "representation5",
|
|
177
191
|
uniqueId: "representation5",
|
|
178
|
-
|
|
192
|
+
baseCodecs: ["ec-3"],
|
|
193
|
+
chosenCodec: "ec-3",
|
|
179
194
|
mimeType: "audio/mp4",
|
|
180
195
|
isSupported: undefined,
|
|
181
196
|
};
|
|
@@ -222,7 +237,8 @@ describe("init - utils - updateManifestCodecSupport", () => {
|
|
|
222
237
|
bitrate: 1000,
|
|
223
238
|
id: "representation1",
|
|
224
239
|
uniqueId: "representation1",
|
|
225
|
-
|
|
240
|
+
baseCodecs: ["avc1.4d401e"],
|
|
241
|
+
chosenCodec: "avc1.4d401e",
|
|
226
242
|
mimeType: "video/mp4",
|
|
227
243
|
contentProtections: fakeContentProtection,
|
|
228
244
|
};
|
|
@@ -231,7 +247,8 @@ describe("init - utils - updateManifestCodecSupport", () => {
|
|
|
231
247
|
bitrate: 2000,
|
|
232
248
|
id: "representation2",
|
|
233
249
|
uniqueId: "representation2",
|
|
234
|
-
|
|
250
|
+
baseCodecs: ["hvc1.2.4.L153.B0"],
|
|
251
|
+
chosenCodec: "hvc1.2.4.L153.B0",
|
|
235
252
|
mimeType: "video/mp4",
|
|
236
253
|
contentProtections: fakeContentProtection,
|
|
237
254
|
};
|
|
@@ -240,7 +257,8 @@ describe("init - utils - updateManifestCodecSupport", () => {
|
|
|
240
257
|
bitrate: 2000,
|
|
241
258
|
id: "representation3",
|
|
242
259
|
uniqueId: "representation3",
|
|
243
|
-
|
|
260
|
+
baseCodecs: ["vp9"],
|
|
261
|
+
chosenCodec: "vp9",
|
|
244
262
|
mimeType: "video/mp4",
|
|
245
263
|
contentProtections: fakeContentProtection,
|
|
246
264
|
};
|
|
@@ -249,7 +267,8 @@ describe("init - utils - updateManifestCodecSupport", () => {
|
|
|
249
267
|
bitrate: 1000,
|
|
250
268
|
id: "representation4",
|
|
251
269
|
uniqueId: "representation4",
|
|
252
|
-
|
|
270
|
+
baseCodecs: ["mp4a.40.2"],
|
|
271
|
+
chosenCodec: "mp4a.40.2",
|
|
253
272
|
mimeType: "audio/mp4",
|
|
254
273
|
contentProtections: fakeContentProtection,
|
|
255
274
|
};
|
|
@@ -258,7 +277,8 @@ describe("init - utils - updateManifestCodecSupport", () => {
|
|
|
258
277
|
bitrate: 2000,
|
|
259
278
|
id: "representation5",
|
|
260
279
|
uniqueId: "representation5",
|
|
261
|
-
|
|
280
|
+
baseCodecs: ["ec-3"],
|
|
281
|
+
chosenCodec: "ec-3",
|
|
262
282
|
mimeType: "audio/mp4",
|
|
263
283
|
contentProtections: fakeContentProtection,
|
|
264
284
|
};
|
|
@@ -303,7 +323,8 @@ describe("init - utils - updateManifestCodecSupport", () => {
|
|
|
303
323
|
bitrate: 1000,
|
|
304
324
|
id: "representation1",
|
|
305
325
|
uniqueId: "representation1",
|
|
306
|
-
|
|
326
|
+
baseCodecs: ["avc1.4d401e"],
|
|
327
|
+
chosenCodec: "avc1.4d401e",
|
|
307
328
|
mimeType: "video/mp4",
|
|
308
329
|
isSupported: undefined,
|
|
309
330
|
isCodecSupportedInWebWorker: undefined,
|
|
@@ -312,7 +333,8 @@ describe("init - utils - updateManifestCodecSupport", () => {
|
|
|
312
333
|
bitrate: 2000,
|
|
313
334
|
id: "representation2",
|
|
314
335
|
uniqueId: "representation2",
|
|
315
|
-
|
|
336
|
+
baseCodecs: ["hvc1.2.4.L153.B0"],
|
|
337
|
+
chosenCodec: "hvc1.2.4.L153.B0",
|
|
316
338
|
mimeType: "video/mp4",
|
|
317
339
|
isSupported: undefined,
|
|
318
340
|
isCodecSupportedInWebWorker: false,
|
|
@@ -322,7 +344,8 @@ describe("init - utils - updateManifestCodecSupport", () => {
|
|
|
322
344
|
bitrate: 1000,
|
|
323
345
|
id: "representation4",
|
|
324
346
|
uniqueId: "representation4",
|
|
325
|
-
|
|
347
|
+
baseCodecs: ["mp4a.40.2"],
|
|
348
|
+
chosenCodec: "mp4a.40.2",
|
|
326
349
|
mimeType: "audio/mp4",
|
|
327
350
|
isSupported: undefined,
|
|
328
351
|
isCodecSupportedInWebWorker: true,
|