shaka-player 3.2.1 → 3.3.1
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/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
- package/.github/ISSUE_TEMPLATE/feature_request.md +1 -1
- package/.github/ISSUE_TEMPLATE/question.md +1 -1
- package/AUTHORS +9 -5
- package/CHANGELOG.md +358 -0
- package/CONTRIBUTORS +7 -2
- package/build/conformance.textproto +183 -169
- package/build/generateExterns.js +1 -1
- package/build/types/core +3 -0
- package/build/types/offline +1 -0
- package/build/types/polyfill +1 -0
- package/build/types/ui +2 -0
- package/demo/common/assets.js +19 -1
- package/demo/common/message_ids.js +13 -1
- package/demo/config.js +31 -1
- package/demo/index.html +1 -1
- package/demo/locales/en.json +12 -0
- package/demo/locales/source.json +48 -0
- package/dist/controls.css +26 -2
- package/dist/controls.css.map +1 -1
- package/dist/demo.compiled.debug.js +20 -17
- package/dist/demo.compiled.debug.map +3 -3
- package/dist/demo.compiled.js +20 -17
- package/dist/demo.compiled.map +3 -3
- package/dist/deps.js +19 -12
- package/dist/locales.js +39 -37
- package/dist/receiver.compiled.debug.js +12 -10
- package/dist/receiver.compiled.debug.map +3 -3
- package/dist/receiver.compiled.js +12 -10
- package/dist/receiver.compiled.map +3 -3
- package/dist/shaka-player.compiled.d.ts +231 -18
- package/dist/shaka-player.compiled.debug.d.ts +231 -18
- package/dist/shaka-player.compiled.debug.externs.js +279 -8
- package/dist/shaka-player.compiled.debug.js +512 -449
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +279 -8
- package/dist/shaka-player.compiled.js +854 -821
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +247 -19
- package/dist/shaka-player.ui.debug.d.ts +247 -19
- package/dist/shaka-player.ui.debug.externs.js +307 -9
- package/dist/shaka-player.ui.debug.js +662 -580
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +307 -9
- package/dist/shaka-player.ui.js +1047 -1000
- package/dist/shaka-player.ui.map +4 -4
- package/docs/design/bg-fetch-after.gv +29 -0
- package/docs/design/bg-fetch-after.gv.png +0 -0
- package/docs/design/bg-fetch-before.gv +18 -0
- package/docs/design/bg-fetch-before.gv.png +0 -0
- package/docs/design/bg-fetch.md +134 -0
- package/docs/tutorials/blob-url.md +15 -0
- package/docs/tutorials/fairplay.md +1 -1
- package/docs/tutorials/index.json +1 -0
- package/docs/tutorials/ui-customization.md +66 -0
- package/docs/tutorials/ui.md +5 -5
- package/externs/cmcd.js +186 -0
- package/externs/ima.js +3 -0
- package/externs/shaka/ads.js +5 -0
- package/externs/shaka/manifest.js +12 -1
- package/externs/shaka/manifest_parser.js +10 -1
- package/externs/shaka/net.js +20 -4
- package/externs/shaka/offline.js +31 -2
- package/externs/shaka/player.js +138 -5
- package/externs/shaka/text.js +24 -0
- package/externs/webcrypto.js +18 -0
- package/karma.conf.js +1 -0
- package/lib/abr/ewma.js +14 -0
- package/lib/abr/ewma_bandwidth_estimator.js +16 -2
- package/lib/abr/simple_abr_manager.js +6 -0
- package/lib/ads/client_side_ad.js +8 -0
- package/lib/ads/client_side_ad_manager.js +54 -90
- package/lib/ads/server_side_ad.js +7 -0
- package/lib/ads/server_side_ad_manager.js +7 -10
- package/lib/cast/cast_proxy.js +3 -2
- package/lib/cast/cast_receiver.js +2 -1
- package/lib/cast/cast_sender.js +2 -2
- package/lib/cast/cast_utils.js +1 -0
- package/lib/dash/dash_parser.js +141 -16
- package/lib/dash/segment_base.js +25 -1
- package/lib/dash/segment_list.js +19 -10
- package/lib/dash/segment_template.js +24 -11
- package/lib/hls/hls_parser.js +146 -40
- package/lib/media/drm_engine.js +7 -0
- package/lib/media/gap_jumping_controller.js +4 -2
- package/lib/media/media_source_engine.js +1 -2
- package/lib/media/quality_observer.js +291 -0
- package/lib/media/segment_index.js +8 -1
- package/lib/media/segment_reference.js +37 -4
- package/lib/media/streaming_engine.js +49 -7
- package/lib/net/http_fetch_plugin.js +31 -11
- package/lib/net/http_plugin_utils.js +1 -0
- package/lib/net/http_xhr_plugin.js +40 -14
- package/lib/net/networking_engine.js +83 -19
- package/lib/offline/download_info.js +68 -0
- package/lib/offline/download_manager.js +13 -5
- package/lib/offline/indexeddb/base_storage_cell.js +35 -0
- package/lib/offline/indexeddb/storage_mechanism.js +1 -1
- package/lib/offline/indexeddb/v5_storage_cell.js +5 -0
- package/lib/offline/storage.js +393 -284
- package/lib/offline/stored_content_utils.js +2 -0
- package/lib/player.js +249 -43
- package/lib/polyfill/media_capabilities.js +36 -15
- package/lib/polyfill/mediasource.js +6 -0
- package/lib/polyfill/orientation.js +1 -1
- package/lib/polyfill/patchedmediakeys_apple.js +4 -4
- package/lib/polyfill/patchedmediakeys_ms.js +4 -4
- package/lib/polyfill/patchedmediakeys_webkit.js +4 -4
- package/lib/polyfill/random_uuid.js +52 -0
- package/lib/text/cue.js +18 -0
- package/lib/text/mp4_ttml_parser.js +3 -0
- package/lib/text/text_engine.js +14 -2
- package/lib/text/ttml_text_parser.js +114 -60
- package/lib/text/ui_text_displayer.js +95 -41
- package/lib/util/cmcd_manager.js +672 -0
- package/lib/util/error.js +6 -0
- package/lib/util/fake_event.js +53 -7
- package/lib/util/language_utils.js +12 -0
- package/lib/util/mutex.js +52 -0
- package/lib/util/periods.js +102 -65
- package/lib/util/platform.js +13 -1
- package/lib/util/player_configuration.js +18 -0
- package/lib/util/stream_utils.js +99 -10
- package/lib/util/xml_utils.js +19 -0
- package/package.json +2 -2
- package/shaka-player.uncompiled.js +3 -0
- package/test/cast/cast_proxy_unit.js +12 -6
- package/test/cast/cast_utils_unit.js +1 -1
- package/test/dash/dash_parser_content_protection_unit.js +2 -0
- package/test/dash/dash_parser_live_unit.js +101 -1
- package/test/dash/dash_parser_manifest_unit.js +222 -2
- package/test/dash/dash_parser_segment_base_unit.js +2 -0
- package/test/dash/dash_parser_segment_list_unit.js +2 -1
- package/test/dash/dash_parser_segment_template_unit.js +2 -1
- package/test/hls/hls_live_unit.js +2 -0
- package/test/hls/hls_parser_unit.js +7 -1
- package/test/media/closed_caption_parser_unit.js +6 -1
- package/test/media/drm_engine_unit.js +47 -3
- package/test/media/quality_observer_unit.js +139 -0
- package/test/media/segment_reference_unit.js +16 -1
- package/test/media/streaming_engine_integration.js +4 -2
- package/test/media/streaming_engine_unit.js +147 -0
- package/test/net/http_plugin_unit.js +20 -15
- package/test/offline/storage_integration.js +108 -4
- package/test/player_integration.js +178 -8
- package/test/player_src_equals_integration.js +41 -8
- package/test/player_unit.js +19 -9
- package/test/test/assets/3675/chunk-stream0-00001.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00002.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00003.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00004.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00005.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00006.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00007.m4s +0 -0
- package/test/test/assets/3675/dash_0.mpd +30 -0
- package/test/test/assets/3675/dash_1.mpd +30 -0
- package/test/test/assets/3675/dash_2.mpd +30 -0
- package/test/test/assets/3675/dash_3.mpd +30 -0
- package/test/test/assets/3675/dash_4.mpd +30 -0
- package/test/test/assets/3675/dash_5.mpd +26 -0
- package/test/test/assets/3675/init-stream0.m4s +0 -0
- package/test/test/assets/chapters.vtt +2 -2
- package/test/test/assets/chapters2.vtt +10 -0
- package/test/test/util/dash_parser_util.js +4 -0
- package/test/test/util/fake_ad.js +7 -0
- package/test/test/util/fake_ad_manager.js +1 -1
- package/test/test/util/fake_drm_engine.js +9 -2
- package/test/test/util/manifest_generator.js +3 -2
- package/test/test/util/test_scheme.js +14 -1
- package/test/test/util/ttml_utils.js +81 -0
- package/test/text/mp4_ttml_parser_unit.js +11 -18
- package/test/text/ttml_text_parser_unit.js +552 -227
- package/test/text/ui_text_displayer_unit.js +29 -17
- package/test/ui/localization_unit.js +15 -14
- package/test/ui/text_displayer_layout_unit.js +13 -1
- package/test/ui/ui_unit.js +250 -0
- package/test/util/cmcd_manager_unit.js +291 -0
- package/test/util/stream_utils_unit.js +45 -4
- package/third_party/closure-uri/uri.js +21 -0
- package/ui/airplay_button.js +1 -0
- package/ui/audio_language_selection.js +7 -0
- package/ui/cast_button.js +3 -3
- package/ui/context_menu.js +109 -0
- package/ui/controls.js +45 -13
- package/ui/controls.less +1 -0
- package/ui/enums.js +4 -0
- package/ui/externs/ui.js +28 -1
- package/ui/fast_forward_button.js +14 -5
- package/ui/fullscreen_button.js +1 -0
- package/ui/less/buttons.less +0 -4
- package/ui/less/containers.less +77 -7
- package/ui/less/overflow_menu.less +0 -10
- package/ui/less/tooltip.less +97 -0
- package/ui/locales/en.json +1 -0
- package/ui/locales/ru.json +6 -6
- package/ui/locales/source.json +4 -0
- package/ui/localization.js +28 -51
- package/ui/loop_button.js +5 -0
- package/ui/mute_button.js +2 -1
- package/ui/overflow_menu.js +5 -25
- package/ui/pip_button.js +7 -3
- package/ui/play_button.js +2 -2
- package/ui/playback_rate_selection.js +8 -9
- package/ui/resolution_selection.js +7 -0
- package/ui/rewind_button.js +15 -6
- package/ui/seek_bar.js +4 -2
- package/ui/settings_menu.js +36 -4
- package/ui/small_play_button.js +1 -0
- package/ui/statistics_button.js +253 -0
- package/ui/text_selection.js +12 -4
- package/ui/ui.js +30 -0
- package/ui/volume_bar.js +1 -1
- package/externs/media_capabilities.js +0 -16
|
@@ -32,9 +32,11 @@ shaka.offline = {};
|
|
|
32
32
|
/** @const */
|
|
33
33
|
shaka.text = {};
|
|
34
34
|
/** @const */
|
|
35
|
+
shaka.ui = {};
|
|
36
|
+
/** @const */
|
|
35
37
|
shaka.util = {};
|
|
36
38
|
/** @const */
|
|
37
|
-
shaka.
|
|
39
|
+
shaka.util.CmcdManager = {};
|
|
38
40
|
|
|
39
41
|
/**
|
|
40
42
|
* @summary Create an Event work-alike object based on the provided dictionary.
|
|
@@ -44,7 +46,7 @@ shaka.ui = {};
|
|
|
44
46
|
shaka.util.FakeEvent = class {
|
|
45
47
|
/**
|
|
46
48
|
* @param {string} type
|
|
47
|
-
* @param {Object
|
|
49
|
+
* @param {Map.<string, Object>=} dict
|
|
48
50
|
*/
|
|
49
51
|
constructor(type, dict) {}
|
|
50
52
|
};
|
|
@@ -287,12 +289,156 @@ shaka.util.Error.Code = {
|
|
|
287
289
|
'MISSING_STORAGE_CELL': 9013,
|
|
288
290
|
'STORAGE_LIMIT_REACHED': 9014,
|
|
289
291
|
'DOWNLOAD_SIZE_CALLBACK_ERROR': 9015,
|
|
292
|
+
'MODIFY_OPERATION_NOT_SUPPORTED': 9016,
|
|
290
293
|
'CS_IMA_SDK_MISSING': 10000,
|
|
291
294
|
'CS_AD_MANAGER_NOT_INITIALIZED': 10001,
|
|
292
295
|
'SS_IMA_SDK_MISSING': 10002,
|
|
293
296
|
'SS_AD_MANAGER_NOT_INITIALIZED': 10003,
|
|
294
297
|
'CURRENT_DAI_REQUEST_NOT_FINISHED': 10004
|
|
295
298
|
};
|
|
299
|
+
/**
|
|
300
|
+
* @summary A set of language utility functions.
|
|
301
|
+
* @final
|
|
302
|
+
*/
|
|
303
|
+
shaka.util.LanguageUtils = class {
|
|
304
|
+
/**
|
|
305
|
+
* Check if |locale1| and |locale2| are locale-compatible.
|
|
306
|
+
* Locale-compatible is defined as all components in each locale match. Since
|
|
307
|
+
* we only respect the language and region components, we only check that
|
|
308
|
+
* the language and region components match.
|
|
309
|
+
* Examples:
|
|
310
|
+
* Locale A | Locale B | Locale Compatible
|
|
311
|
+
* ---------------------------------------
|
|
312
|
+
* en-US | en-US | true
|
|
313
|
+
* en | en-US | false
|
|
314
|
+
* en-US | en-CA | false
|
|
315
|
+
* @param {string} locale1
|
|
316
|
+
* @param {string} locale2
|
|
317
|
+
* @return {boolean}
|
|
318
|
+
*/
|
|
319
|
+
static areLocaleCompatible(locale1, locale2) {}
|
|
320
|
+
/**
|
|
321
|
+
* Check if |locale1| and |locale2| are language-compatible.
|
|
322
|
+
* Language compatible is when the language component of each locale matches.
|
|
323
|
+
* This means that no matter what region they have (or don't have) as long as
|
|
324
|
+
* the language components match, they are language-compatible.
|
|
325
|
+
* Examples:
|
|
326
|
+
* Locale A | Locale B | Language-Compatible
|
|
327
|
+
* -----------------------------------------
|
|
328
|
+
* en-US | en-US | true
|
|
329
|
+
* en-US | en | true
|
|
330
|
+
* en-US | en-CA | true
|
|
331
|
+
* en-CA | fr-CA | false
|
|
332
|
+
* @param {string} locale1
|
|
333
|
+
* @param {string} locale2
|
|
334
|
+
* @return {boolean}
|
|
335
|
+
*/
|
|
336
|
+
static areLanguageCompatible(locale1, locale2) {}
|
|
337
|
+
/**
|
|
338
|
+
* Check if |possibleParent| is the parent locale of |possibleChild|. Because
|
|
339
|
+
* we do not support dialects, the parent-child relationship is a lot simpler.
|
|
340
|
+
* In a parent child relationship:
|
|
341
|
+
* - The parent and child have the same language-component
|
|
342
|
+
* - The parent has no region-component
|
|
343
|
+
* - The child has a region-component
|
|
344
|
+
* Example:
|
|
345
|
+
* Locale A | Locale B | Is A The parent of B?
|
|
346
|
+
* --------------------------------------------
|
|
347
|
+
* en-US | en-US | no
|
|
348
|
+
* en-US | en | no
|
|
349
|
+
* en | en-US | yes
|
|
350
|
+
* en | en | no
|
|
351
|
+
* en | fr | no
|
|
352
|
+
* @param {string} possibleParent
|
|
353
|
+
* @param {string} possibleChild
|
|
354
|
+
* @return {boolean}
|
|
355
|
+
*/
|
|
356
|
+
static isParentOf(possibleParent, possibleChild) {}
|
|
357
|
+
/**
|
|
358
|
+
* Check if |localeA| shares the same parent with |localeB|. Since we don't
|
|
359
|
+
* support dialect, we will only look at language and region. For two locales
|
|
360
|
+
* to be siblings:
|
|
361
|
+
* - Both must have language-components
|
|
362
|
+
* - Both must have region-components
|
|
363
|
+
* - Both must have the same language-component
|
|
364
|
+
* Example:
|
|
365
|
+
* Locale A | Locale B | Siblings?
|
|
366
|
+
* --------------------------------------------
|
|
367
|
+
* en-US | en-US | yes
|
|
368
|
+
* en-US | en-CA | yes
|
|
369
|
+
* en-US | en | no
|
|
370
|
+
* en | en-US | no
|
|
371
|
+
* en | en | no
|
|
372
|
+
* en | fr | no
|
|
373
|
+
* @param {string} localeA
|
|
374
|
+
* @param {string} localeB
|
|
375
|
+
* @return {boolean}
|
|
376
|
+
*/
|
|
377
|
+
static isSiblingOf(localeA, localeB) {}
|
|
378
|
+
/**
|
|
379
|
+
* Normalize a locale. This will take a locale and canonicalize it to a state
|
|
380
|
+
* that we are prepared to work with.
|
|
381
|
+
* We only support with:
|
|
382
|
+
* - language
|
|
383
|
+
* - language-REGION
|
|
384
|
+
* If given a dialect, we will discard it. We will convert any 3-character
|
|
385
|
+
* codes to 2-character codes. We will force language codes to lowercase and
|
|
386
|
+
* region codes to uppercase.
|
|
387
|
+
* @param {string} locale
|
|
388
|
+
* @return {string}
|
|
389
|
+
*/
|
|
390
|
+
static normalize(locale) {}
|
|
391
|
+
/**
|
|
392
|
+
* Check if two language codes are siblings. Language codes are siblings if
|
|
393
|
+
* they share the same base language while neither one is the base language.
|
|
394
|
+
* For example, "en-US" and "en-CA" are siblings but "en-US" and "en" are not
|
|
395
|
+
* siblings.
|
|
396
|
+
* @param {string} a
|
|
397
|
+
* @param {string} b
|
|
398
|
+
* @return {boolean}
|
|
399
|
+
*/
|
|
400
|
+
static areSiblings(a, b) {}
|
|
401
|
+
/**
|
|
402
|
+
* Compute a numerical relatedness for language codes. Language codes with a
|
|
403
|
+
* higher relatedness are a better match. Unrelated language codes have a
|
|
404
|
+
* relatedness score of 0.
|
|
405
|
+
* @param {string} target
|
|
406
|
+
* @param {string} candidate
|
|
407
|
+
* @return {number}
|
|
408
|
+
*/
|
|
409
|
+
static relatedness(target, candidate) {}
|
|
410
|
+
/**
|
|
411
|
+
* Get the normalized base language for a language code.
|
|
412
|
+
* @param {string} lang
|
|
413
|
+
* @return {string}
|
|
414
|
+
*/
|
|
415
|
+
static getBase(lang) {}
|
|
416
|
+
/**
|
|
417
|
+
* Get the normalized language of the given text stream. Will return 'und' if
|
|
418
|
+
* a language is not found on the text stream.
|
|
419
|
+
* This should always be used to get the language from a text stream.
|
|
420
|
+
* @param {shaka.extern.Stream} stream
|
|
421
|
+
* @return {string}
|
|
422
|
+
*/
|
|
423
|
+
static getLocaleForText(stream) {}
|
|
424
|
+
/**
|
|
425
|
+
* Get the normalized locale for the given variant. This will look through
|
|
426
|
+
* the variant to find the locale that represents the content in the variant.
|
|
427
|
+
* This will return 'und' if no language can be found.
|
|
428
|
+
* This should always be used to get the locale from a variant.
|
|
429
|
+
* @param {shaka.extern.Variant} variant
|
|
430
|
+
* @return {string}
|
|
431
|
+
*/
|
|
432
|
+
static getLocaleForVariant(variant) {}
|
|
433
|
+
/**
|
|
434
|
+
* Find the locale in |searchSpace| that comes closest to |target|. If no
|
|
435
|
+
* locale is found to be close to |target|, then |null| will be returned.
|
|
436
|
+
* @param {string} target
|
|
437
|
+
* @param {!Iterable.<string>} searchSpace
|
|
438
|
+
* @return {?string}
|
|
439
|
+
*/
|
|
440
|
+
static findClosestLocale(target, searchSpace) {}
|
|
441
|
+
};
|
|
296
442
|
/**
|
|
297
443
|
* Localization system provided by the shaka ui library.
|
|
298
444
|
* It can be used to store the various localized forms of
|
|
@@ -497,6 +643,14 @@ shaka.text.Cue.prototype.backgroundImage;
|
|
|
497
643
|
* @override
|
|
498
644
|
*/
|
|
499
645
|
shaka.text.Cue.prototype.border;
|
|
646
|
+
/**
|
|
647
|
+
* @override
|
|
648
|
+
*/
|
|
649
|
+
shaka.text.Cue.prototype.textStrokeColor;
|
|
650
|
+
/**
|
|
651
|
+
* @override
|
|
652
|
+
*/
|
|
653
|
+
shaka.text.Cue.prototype.textStrokeWidth;
|
|
500
654
|
/**
|
|
501
655
|
* @override
|
|
502
656
|
*/
|
|
@@ -541,6 +695,10 @@ shaka.text.Cue.prototype.id;
|
|
|
541
695
|
* @override
|
|
542
696
|
*/
|
|
543
697
|
shaka.text.Cue.prototype.nestedCues;
|
|
698
|
+
/**
|
|
699
|
+
* @override
|
|
700
|
+
*/
|
|
701
|
+
shaka.text.Cue.prototype.isContainer;
|
|
544
702
|
/**
|
|
545
703
|
* @override
|
|
546
704
|
*/
|
|
@@ -1137,8 +1295,12 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
|
|
|
1137
1295
|
* @param {function(number, number)=} onProgressUpdated Called when a progress
|
|
1138
1296
|
* event is triggered. Passed the duration, in milliseconds, that the
|
|
1139
1297
|
* request took, and the number of bytes transferred.
|
|
1298
|
+
* @param {shaka.net.NetworkingEngine.OnHeadersReceived=} onHeadersReceived
|
|
1299
|
+
* Called when the headers are received for a download.
|
|
1300
|
+
* @param {shaka.net.NetworkingEngine.OnDownloadFailed=} onDownloadFailed
|
|
1301
|
+
* Called when a download fails, for any reason.
|
|
1140
1302
|
*/
|
|
1141
|
-
constructor(onProgressUpdated) {}
|
|
1303
|
+
constructor(onProgressUpdated, onHeadersReceived, onDownloadFailed) {}
|
|
1142
1304
|
/**
|
|
1143
1305
|
* @param {boolean} forceHTTPS
|
|
1144
1306
|
*/
|
|
@@ -1277,6 +1439,27 @@ shaka.net.NetworkingEngine.PluginPriority = {
|
|
|
1277
1439
|
'PREFERRED': 2,
|
|
1278
1440
|
'APPLICATION': 3
|
|
1279
1441
|
};
|
|
1442
|
+
/**
|
|
1443
|
+
* @typedef {function(
|
|
1444
|
+
* !Object.<string, string>,
|
|
1445
|
+
* !shaka.extern.Request,
|
|
1446
|
+
* !shaka.net.NetworkingEngine.RequestType)}
|
|
1447
|
+
* @description
|
|
1448
|
+
* A callback function that passes the shaka.extern.HeadersReceived along to
|
|
1449
|
+
* the player, plus some extra data.
|
|
1450
|
+
*/
|
|
1451
|
+
shaka.net.NetworkingEngine.OnHeadersReceived;
|
|
1452
|
+
/**
|
|
1453
|
+
* @typedef {function(
|
|
1454
|
+
* !shaka.extern.Request,
|
|
1455
|
+
* ?shaka.util.Error,
|
|
1456
|
+
* number,
|
|
1457
|
+
* boolean)}
|
|
1458
|
+
* @description
|
|
1459
|
+
* A callback function that notifies the player when a download fails, for any
|
|
1460
|
+
* reason (e.g. even if the download was aborted).
|
|
1461
|
+
*/
|
|
1462
|
+
shaka.net.NetworkingEngine.OnDownloadFailed;
|
|
1280
1463
|
/**
|
|
1281
1464
|
* An interface to standardize how objects release internal references
|
|
1282
1465
|
* synchronously. If an object needs to asynchronously release references, then
|
|
@@ -1575,11 +1758,13 @@ shaka.media.InitSegmentReference = class {
|
|
|
1575
1758
|
* of the resource containing the segment.
|
|
1576
1759
|
* @param {number} startByte The offset from the start of the resource to the
|
|
1577
1760
|
* start of the segment.
|
|
1578
|
-
* @param {?number} endByte The offset from the start of the resource
|
|
1579
|
-
* end of the segment, inclusive. A value of null indicates that the
|
|
1761
|
+
* @param {?number} endByte The offset from the start of the resource
|
|
1762
|
+
* to the end of the segment, inclusive. A value of null indicates that the
|
|
1580
1763
|
* segment extends to the end of the resource.
|
|
1764
|
+
* @param {null|shaka.extern.MediaQualityInfo=} mediaQuality Information about
|
|
1765
|
+
* the quality of the media associated with this init segment.
|
|
1581
1766
|
*/
|
|
1582
|
-
constructor(uris, startByte, endByte) {}
|
|
1767
|
+
constructor(uris, startByte, endByte, mediaQuality) {}
|
|
1583
1768
|
/**
|
|
1584
1769
|
* Returns the offset from the start of the resource to the
|
|
1585
1770
|
* start of the segment.
|
|
@@ -1640,8 +1825,12 @@ shaka.media.SegmentReference = class {
|
|
|
1640
1825
|
* The value is a grid-item-dimension consisting of two positive decimal
|
|
1641
1826
|
* integers in the format: column-x-row ('4x3'). It describes the
|
|
1642
1827
|
* arrangement of Images in a Grid. The minimum valid LAYOUT is '1x1'.
|
|
1828
|
+
* @param {?number=} tileDuration
|
|
1829
|
+
* The explicit duration of an individual tile within the tiles grid.
|
|
1830
|
+
* If not provided, the duration should be automatically calculated based on
|
|
1831
|
+
* the duration of the reference.
|
|
1643
1832
|
*/
|
|
1644
|
-
constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout) {}
|
|
1833
|
+
constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration) {}
|
|
1645
1834
|
/**
|
|
1646
1835
|
* Creates and returns the URIs of the resource containing the segment.
|
|
1647
1836
|
* @return {!Array.<string>}
|
|
@@ -1675,6 +1864,12 @@ shaka.media.SegmentReference = class {
|
|
|
1675
1864
|
* @return {?string}
|
|
1676
1865
|
*/
|
|
1677
1866
|
getTilesLayout() {}
|
|
1867
|
+
/**
|
|
1868
|
+
* Returns the segment's explicit tile duration.
|
|
1869
|
+
* Only defined in image segments.
|
|
1870
|
+
* @return {?number}
|
|
1871
|
+
*/
|
|
1872
|
+
getTileDuration() {}
|
|
1678
1873
|
};
|
|
1679
1874
|
/**
|
|
1680
1875
|
* PresentationTimeline.
|
|
@@ -2110,6 +2305,46 @@ shaka.text.UITextDisplayer = class {
|
|
|
2110
2305
|
*/
|
|
2111
2306
|
shaka.text.WebVttGenerator = class {
|
|
2112
2307
|
};
|
|
2308
|
+
/**
|
|
2309
|
+
* @typedef {{
|
|
2310
|
+
* type: string,
|
|
2311
|
+
* init: boolean,
|
|
2312
|
+
* duration: number,
|
|
2313
|
+
* mimeType: string,
|
|
2314
|
+
* codecs: string,
|
|
2315
|
+
* bandwidth: (number|undefined)
|
|
2316
|
+
* }}
|
|
2317
|
+
* @property {string} type
|
|
2318
|
+
* The media type
|
|
2319
|
+
* @property {boolean} init
|
|
2320
|
+
* Flag indicating whether the segment is an init segment
|
|
2321
|
+
* @property {number} duration
|
|
2322
|
+
* The duration of the segment in seconds
|
|
2323
|
+
* @property {string} mimeType
|
|
2324
|
+
* The segment's mime type
|
|
2325
|
+
* @property {string} codecs
|
|
2326
|
+
* The segment's codecs
|
|
2327
|
+
* @property {(number|undefined)} bandwidth
|
|
2328
|
+
* The segment's variation bandwidth
|
|
2329
|
+
*/
|
|
2330
|
+
shaka.util.CmcdManager.SegmentInfo;
|
|
2331
|
+
/**
|
|
2332
|
+
* @typedef {{
|
|
2333
|
+
* format: shaka.util.CmcdManager.StreamingFormat
|
|
2334
|
+
* }}
|
|
2335
|
+
* @property {shaka.util.CmcdManager.StreamingFormat} format
|
|
2336
|
+
* The manifest's stream format
|
|
2337
|
+
*/
|
|
2338
|
+
shaka.util.CmcdManager.ManifestInfo;
|
|
2339
|
+
/**
|
|
2340
|
+
* @enum {string}
|
|
2341
|
+
*/
|
|
2342
|
+
shaka.util.CmcdManager.StreamingFormat = {
|
|
2343
|
+
DASH: 'd',
|
|
2344
|
+
HLS: 'h',
|
|
2345
|
+
SMOOTH: 's',
|
|
2346
|
+
OTHER: 'o'
|
|
2347
|
+
};
|
|
2113
2348
|
/** */
|
|
2114
2349
|
shaka.util.ConfigUtils = class {
|
|
2115
2350
|
/**
|
|
@@ -2249,6 +2484,14 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
2249
2484
|
* @return {!Promise}
|
|
2250
2485
|
*/
|
|
2251
2486
|
unload(initializeMediaSource) {}
|
|
2487
|
+
/**
|
|
2488
|
+
* Provides a way to update the stream start position during the media loading
|
|
2489
|
+
* process. Can for example be called from the <code>manifestparsed</code>
|
|
2490
|
+
* event handler to update the start position based on information in the
|
|
2491
|
+
* manifest.
|
|
2492
|
+
* @param {number} startTime
|
|
2493
|
+
*/
|
|
2494
|
+
updateStartTime(startTime) {}
|
|
2252
2495
|
/**
|
|
2253
2496
|
* Tell the player to load the content at <code>assetUri</code> and start
|
|
2254
2497
|
* playback at <code>startTime</code>. Before calling <code>load</code>,
|
|
@@ -2758,6 +3001,10 @@ shaka.ads.ClientSideAd = class {
|
|
|
2758
3001
|
* @override
|
|
2759
3002
|
*/
|
|
2760
3003
|
isMuted() {}
|
|
3004
|
+
/**
|
|
3005
|
+
* @override
|
|
3006
|
+
*/
|
|
3007
|
+
isLinear() {}
|
|
2761
3008
|
/**
|
|
2762
3009
|
* @override
|
|
2763
3010
|
*/
|
|
@@ -2840,6 +3087,10 @@ shaka.ads.ServerSideAd = class {
|
|
|
2840
3087
|
* @override
|
|
2841
3088
|
*/
|
|
2842
3089
|
isMuted() {}
|
|
3090
|
+
/**
|
|
3091
|
+
* @override
|
|
3092
|
+
*/
|
|
3093
|
+
isLinear() {}
|
|
2843
3094
|
/**
|
|
2844
3095
|
* @override
|
|
2845
3096
|
*/
|
|
@@ -3310,9 +3561,11 @@ shaka.net.HttpFetchPlugin = class {
|
|
|
3310
3561
|
* @param {shaka.net.NetworkingEngine.RequestType} requestType
|
|
3311
3562
|
* @param {shaka.extern.ProgressUpdated} progressUpdated Called when a
|
|
3312
3563
|
* progress event happened.
|
|
3564
|
+
* @param {shaka.extern.HeadersReceived} headersReceived Called when the
|
|
3565
|
+
* headers for the download are received, but before the body is.
|
|
3313
3566
|
* @return {!shaka.extern.IAbortableOperation.<shaka.extern.Response>}
|
|
3314
3567
|
*/
|
|
3315
|
-
static parse(uri, request, requestType, progressUpdated) {}
|
|
3568
|
+
static parse(uri, request, requestType, progressUpdated, headersReceived) {}
|
|
3316
3569
|
/**
|
|
3317
3570
|
* Determine if the Fetch API is supported in the browser. Note: this is
|
|
3318
3571
|
* deliberately exposed as a method to allow the client app to use the same
|
|
@@ -3331,9 +3584,11 @@ shaka.net.HttpXHRPlugin = class {
|
|
|
3331
3584
|
* @param {shaka.net.NetworkingEngine.RequestType} requestType
|
|
3332
3585
|
* @param {shaka.extern.ProgressUpdated} progressUpdated Called when a
|
|
3333
3586
|
* progress event happened.
|
|
3587
|
+
* @param {shaka.extern.HeadersReceived} headersReceived Called when the
|
|
3588
|
+
* headers for the download are received, but before the body is.
|
|
3334
3589
|
* @return {!shaka.extern.IAbortableOperation.<shaka.extern.Response>}
|
|
3335
3590
|
*/
|
|
3336
|
-
static parse(uri, request, requestType, progressUpdated) {}
|
|
3591
|
+
static parse(uri, request, requestType, progressUpdated, headersReceived) {}
|
|
3337
3592
|
};
|
|
3338
3593
|
/**
|
|
3339
3594
|
* StorageMuxer is responsible for managing StorageMechanisms and addressing
|
|
@@ -3585,6 +3840,13 @@ shaka.polyfill.MediaCapabilities = class {
|
|
|
3585
3840
|
*/
|
|
3586
3841
|
static install() {}
|
|
3587
3842
|
};
|
|
3843
|
+
/**
|
|
3844
|
+
* A copy of the MediaCapabilities instance, to prevent Safari from
|
|
3845
|
+
* garbage-collecting the polyfilled method on it. We make it public and export
|
|
3846
|
+
* it to ensure that it is not stripped out by the compiler.
|
|
3847
|
+
* @type {MediaCapabilities}
|
|
3848
|
+
*/
|
|
3849
|
+
shaka.polyfill.MediaCapabilities.originalMcap;
|
|
3588
3850
|
/**
|
|
3589
3851
|
* @summary A polyfill to patch MSE bugs.
|
|
3590
3852
|
*/
|
|
@@ -3660,6 +3922,15 @@ shaka.polyfill.PiPWebkit = class {
|
|
|
3660
3922
|
*/
|
|
3661
3923
|
static install() {}
|
|
3662
3924
|
};
|
|
3925
|
+
/**
|
|
3926
|
+
* @summary A polyfill to provide window.crypto.randomUUID in all browsers.
|
|
3927
|
+
*/
|
|
3928
|
+
shaka.polyfill.RandomUUID = class {
|
|
3929
|
+
/**
|
|
3930
|
+
* Install the polyfill if needed.
|
|
3931
|
+
*/
|
|
3932
|
+
static install() {}
|
|
3933
|
+
};
|
|
3663
3934
|
/**
|
|
3664
3935
|
* @summary A polyfill to provide navigator.storage.estimate in old
|
|
3665
3936
|
* webkit browsers.
|
|
@@ -3909,6 +4180,22 @@ shaka.ui.BigPlayButton = class extends shaka.ui.PlayButton {
|
|
|
3909
4180
|
*/
|
|
3910
4181
|
constructor(parent, controls) {}
|
|
3911
4182
|
};
|
|
4183
|
+
/**
|
|
4184
|
+
* @extends {shaka.ui.Element}
|
|
4185
|
+
* @final
|
|
4186
|
+
*/
|
|
4187
|
+
shaka.ui.ContextMenu = class extends shaka.ui.Element {
|
|
4188
|
+
/**
|
|
4189
|
+
* @param {!HTMLElement} parent
|
|
4190
|
+
* @param {!shaka.ui.Controls} controls
|
|
4191
|
+
*/
|
|
4192
|
+
constructor(parent, controls) {}
|
|
4193
|
+
/**
|
|
4194
|
+
* @param {string} name
|
|
4195
|
+
* @param {!shaka.extern.IUIElement.Factory} factory
|
|
4196
|
+
*/
|
|
4197
|
+
static registerElement(name, factory) {}
|
|
4198
|
+
};
|
|
3912
4199
|
/**
|
|
3913
4200
|
* A range element, built to work across browsers.
|
|
3914
4201
|
* In particular, getting styles to work right on IE requires a specific
|
|
@@ -4372,6 +4659,17 @@ shaka.ui.Spacer = class extends shaka.ui.Element {
|
|
|
4372
4659
|
*/
|
|
4373
4660
|
constructor(parent, controls) {}
|
|
4374
4661
|
};
|
|
4662
|
+
/**
|
|
4663
|
+
* @extends {shaka.ui.Element}
|
|
4664
|
+
* @final
|
|
4665
|
+
*/
|
|
4666
|
+
shaka.ui.StatisticsButton = class extends shaka.ui.Element {
|
|
4667
|
+
/**
|
|
4668
|
+
* @param {!HTMLElement} parent
|
|
4669
|
+
* @param {!shaka.ui.Controls} controls
|
|
4670
|
+
*/
|
|
4671
|
+
constructor(parent, controls) {}
|
|
4672
|
+
};
|
|
4375
4673
|
/**
|
|
4376
4674
|
* @extends {shaka.ui.SettingsMenu}
|
|
4377
4675
|
* @final
|