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
|
@@ -33,6 +33,8 @@ shaka.offline = {};
|
|
|
33
33
|
shaka.text = {};
|
|
34
34
|
/** @const */
|
|
35
35
|
shaka.util = {};
|
|
36
|
+
/** @const */
|
|
37
|
+
shaka.util.CmcdManager = {};
|
|
36
38
|
|
|
37
39
|
/**
|
|
38
40
|
* @implements {shaka.extern.Cue}
|
|
@@ -124,6 +126,14 @@ shaka.text.Cue.prototype.backgroundImage;
|
|
|
124
126
|
* @override
|
|
125
127
|
*/
|
|
126
128
|
shaka.text.Cue.prototype.border;
|
|
129
|
+
/**
|
|
130
|
+
* @override
|
|
131
|
+
*/
|
|
132
|
+
shaka.text.Cue.prototype.textStrokeColor;
|
|
133
|
+
/**
|
|
134
|
+
* @override
|
|
135
|
+
*/
|
|
136
|
+
shaka.text.Cue.prototype.textStrokeWidth;
|
|
127
137
|
/**
|
|
128
138
|
* @override
|
|
129
139
|
*/
|
|
@@ -168,6 +178,10 @@ shaka.text.Cue.prototype.id;
|
|
|
168
178
|
* @override
|
|
169
179
|
*/
|
|
170
180
|
shaka.text.Cue.prototype.nestedCues;
|
|
181
|
+
/**
|
|
182
|
+
* @override
|
|
183
|
+
*/
|
|
184
|
+
shaka.text.Cue.prototype.isContainer;
|
|
171
185
|
/**
|
|
172
186
|
* @override
|
|
173
187
|
*/
|
|
@@ -631,6 +645,7 @@ shaka.util.Error.Code = {
|
|
|
631
645
|
'MISSING_STORAGE_CELL': 9013,
|
|
632
646
|
'STORAGE_LIMIT_REACHED': 9014,
|
|
633
647
|
'DOWNLOAD_SIZE_CALLBACK_ERROR': 9015,
|
|
648
|
+
'MODIFY_OPERATION_NOT_SUPPORTED': 9016,
|
|
634
649
|
'CS_IMA_SDK_MISSING': 10000,
|
|
635
650
|
'CS_AD_MANAGER_NOT_INITIALIZED': 10001,
|
|
636
651
|
'SS_IMA_SDK_MISSING': 10002,
|
|
@@ -764,6 +779,149 @@ shaka.text.TextEngine = class {
|
|
|
764
779
|
*/
|
|
765
780
|
destroy() {}
|
|
766
781
|
};
|
|
782
|
+
/**
|
|
783
|
+
* @summary A set of language utility functions.
|
|
784
|
+
* @final
|
|
785
|
+
*/
|
|
786
|
+
shaka.util.LanguageUtils = class {
|
|
787
|
+
/**
|
|
788
|
+
* Check if |locale1| and |locale2| are locale-compatible.
|
|
789
|
+
* Locale-compatible is defined as all components in each locale match. Since
|
|
790
|
+
* we only respect the language and region components, we only check that
|
|
791
|
+
* the language and region components match.
|
|
792
|
+
* Examples:
|
|
793
|
+
* Locale A | Locale B | Locale Compatible
|
|
794
|
+
* ---------------------------------------
|
|
795
|
+
* en-US | en-US | true
|
|
796
|
+
* en | en-US | false
|
|
797
|
+
* en-US | en-CA | false
|
|
798
|
+
* @param {string} locale1
|
|
799
|
+
* @param {string} locale2
|
|
800
|
+
* @return {boolean}
|
|
801
|
+
*/
|
|
802
|
+
static areLocaleCompatible(locale1, locale2) {}
|
|
803
|
+
/**
|
|
804
|
+
* Check if |locale1| and |locale2| are language-compatible.
|
|
805
|
+
* Language compatible is when the language component of each locale matches.
|
|
806
|
+
* This means that no matter what region they have (or don't have) as long as
|
|
807
|
+
* the language components match, they are language-compatible.
|
|
808
|
+
* Examples:
|
|
809
|
+
* Locale A | Locale B | Language-Compatible
|
|
810
|
+
* -----------------------------------------
|
|
811
|
+
* en-US | en-US | true
|
|
812
|
+
* en-US | en | true
|
|
813
|
+
* en-US | en-CA | true
|
|
814
|
+
* en-CA | fr-CA | false
|
|
815
|
+
* @param {string} locale1
|
|
816
|
+
* @param {string} locale2
|
|
817
|
+
* @return {boolean}
|
|
818
|
+
*/
|
|
819
|
+
static areLanguageCompatible(locale1, locale2) {}
|
|
820
|
+
/**
|
|
821
|
+
* Check if |possibleParent| is the parent locale of |possibleChild|. Because
|
|
822
|
+
* we do not support dialects, the parent-child relationship is a lot simpler.
|
|
823
|
+
* In a parent child relationship:
|
|
824
|
+
* - The parent and child have the same language-component
|
|
825
|
+
* - The parent has no region-component
|
|
826
|
+
* - The child has a region-component
|
|
827
|
+
* Example:
|
|
828
|
+
* Locale A | Locale B | Is A The parent of B?
|
|
829
|
+
* --------------------------------------------
|
|
830
|
+
* en-US | en-US | no
|
|
831
|
+
* en-US | en | no
|
|
832
|
+
* en | en-US | yes
|
|
833
|
+
* en | en | no
|
|
834
|
+
* en | fr | no
|
|
835
|
+
* @param {string} possibleParent
|
|
836
|
+
* @param {string} possibleChild
|
|
837
|
+
* @return {boolean}
|
|
838
|
+
*/
|
|
839
|
+
static isParentOf(possibleParent, possibleChild) {}
|
|
840
|
+
/**
|
|
841
|
+
* Check if |localeA| shares the same parent with |localeB|. Since we don't
|
|
842
|
+
* support dialect, we will only look at language and region. For two locales
|
|
843
|
+
* to be siblings:
|
|
844
|
+
* - Both must have language-components
|
|
845
|
+
* - Both must have region-components
|
|
846
|
+
* - Both must have the same language-component
|
|
847
|
+
* Example:
|
|
848
|
+
* Locale A | Locale B | Siblings?
|
|
849
|
+
* --------------------------------------------
|
|
850
|
+
* en-US | en-US | yes
|
|
851
|
+
* en-US | en-CA | yes
|
|
852
|
+
* en-US | en | no
|
|
853
|
+
* en | en-US | no
|
|
854
|
+
* en | en | no
|
|
855
|
+
* en | fr | no
|
|
856
|
+
* @param {string} localeA
|
|
857
|
+
* @param {string} localeB
|
|
858
|
+
* @return {boolean}
|
|
859
|
+
*/
|
|
860
|
+
static isSiblingOf(localeA, localeB) {}
|
|
861
|
+
/**
|
|
862
|
+
* Normalize a locale. This will take a locale and canonicalize it to a state
|
|
863
|
+
* that we are prepared to work with.
|
|
864
|
+
* We only support with:
|
|
865
|
+
* - language
|
|
866
|
+
* - language-REGION
|
|
867
|
+
* If given a dialect, we will discard it. We will convert any 3-character
|
|
868
|
+
* codes to 2-character codes. We will force language codes to lowercase and
|
|
869
|
+
* region codes to uppercase.
|
|
870
|
+
* @param {string} locale
|
|
871
|
+
* @return {string}
|
|
872
|
+
*/
|
|
873
|
+
static normalize(locale) {}
|
|
874
|
+
/**
|
|
875
|
+
* Check if two language codes are siblings. Language codes are siblings if
|
|
876
|
+
* they share the same base language while neither one is the base language.
|
|
877
|
+
* For example, "en-US" and "en-CA" are siblings but "en-US" and "en" are not
|
|
878
|
+
* siblings.
|
|
879
|
+
* @param {string} a
|
|
880
|
+
* @param {string} b
|
|
881
|
+
* @return {boolean}
|
|
882
|
+
*/
|
|
883
|
+
static areSiblings(a, b) {}
|
|
884
|
+
/**
|
|
885
|
+
* Compute a numerical relatedness for language codes. Language codes with a
|
|
886
|
+
* higher relatedness are a better match. Unrelated language codes have a
|
|
887
|
+
* relatedness score of 0.
|
|
888
|
+
* @param {string} target
|
|
889
|
+
* @param {string} candidate
|
|
890
|
+
* @return {number}
|
|
891
|
+
*/
|
|
892
|
+
static relatedness(target, candidate) {}
|
|
893
|
+
/**
|
|
894
|
+
* Get the normalized base language for a language code.
|
|
895
|
+
* @param {string} lang
|
|
896
|
+
* @return {string}
|
|
897
|
+
*/
|
|
898
|
+
static getBase(lang) {}
|
|
899
|
+
/**
|
|
900
|
+
* Get the normalized language of the given text stream. Will return 'und' if
|
|
901
|
+
* a language is not found on the text stream.
|
|
902
|
+
* This should always be used to get the language from a text stream.
|
|
903
|
+
* @param {shaka.extern.Stream} stream
|
|
904
|
+
* @return {string}
|
|
905
|
+
*/
|
|
906
|
+
static getLocaleForText(stream) {}
|
|
907
|
+
/**
|
|
908
|
+
* Get the normalized locale for the given variant. This will look through
|
|
909
|
+
* the variant to find the locale that represents the content in the variant.
|
|
910
|
+
* This will return 'und' if no language can be found.
|
|
911
|
+
* This should always be used to get the locale from a variant.
|
|
912
|
+
* @param {shaka.extern.Variant} variant
|
|
913
|
+
* @return {string}
|
|
914
|
+
*/
|
|
915
|
+
static getLocaleForVariant(variant) {}
|
|
916
|
+
/**
|
|
917
|
+
* Find the locale in |searchSpace| that comes closest to |target|. If no
|
|
918
|
+
* locale is found to be close to |target|, then |null| will be returned.
|
|
919
|
+
* @param {string} target
|
|
920
|
+
* @param {!Iterable.<string>} searchSpace
|
|
921
|
+
* @return {?string}
|
|
922
|
+
*/
|
|
923
|
+
static findClosestLocale(target, searchSpace) {}
|
|
924
|
+
};
|
|
767
925
|
/**
|
|
768
926
|
* A timer allows a single function to be executed at a later time or at
|
|
769
927
|
* regular intervals.
|
|
@@ -958,7 +1116,7 @@ shaka.util.AbortableOperation.prototype.promise;
|
|
|
958
1116
|
shaka.util.FakeEvent = class {
|
|
959
1117
|
/**
|
|
960
1118
|
* @param {string} type
|
|
961
|
-
* @param {Object
|
|
1119
|
+
* @param {Map.<string, Object>=} dict
|
|
962
1120
|
*/
|
|
963
1121
|
constructor(type, dict) {}
|
|
964
1122
|
};
|
|
@@ -1021,8 +1179,12 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
|
|
|
1021
1179
|
* @param {function(number, number)=} onProgressUpdated Called when a progress
|
|
1022
1180
|
* event is triggered. Passed the duration, in milliseconds, that the
|
|
1023
1181
|
* request took, and the number of bytes transferred.
|
|
1182
|
+
* @param {shaka.net.NetworkingEngine.OnHeadersReceived=} onHeadersReceived
|
|
1183
|
+
* Called when the headers are received for a download.
|
|
1184
|
+
* @param {shaka.net.NetworkingEngine.OnDownloadFailed=} onDownloadFailed
|
|
1185
|
+
* Called when a download fails, for any reason.
|
|
1024
1186
|
*/
|
|
1025
|
-
constructor(onProgressUpdated) {}
|
|
1187
|
+
constructor(onProgressUpdated, onHeadersReceived, onDownloadFailed) {}
|
|
1026
1188
|
/**
|
|
1027
1189
|
* @param {boolean} forceHTTPS
|
|
1028
1190
|
*/
|
|
@@ -1161,6 +1323,27 @@ shaka.net.NetworkingEngine.PluginPriority = {
|
|
|
1161
1323
|
'PREFERRED': 2,
|
|
1162
1324
|
'APPLICATION': 3
|
|
1163
1325
|
};
|
|
1326
|
+
/**
|
|
1327
|
+
* @typedef {function(
|
|
1328
|
+
* !Object.<string, string>,
|
|
1329
|
+
* !shaka.extern.Request,
|
|
1330
|
+
* !shaka.net.NetworkingEngine.RequestType)}
|
|
1331
|
+
* @description
|
|
1332
|
+
* A callback function that passes the shaka.extern.HeadersReceived along to
|
|
1333
|
+
* the player, plus some extra data.
|
|
1334
|
+
*/
|
|
1335
|
+
shaka.net.NetworkingEngine.OnHeadersReceived;
|
|
1336
|
+
/**
|
|
1337
|
+
* @typedef {function(
|
|
1338
|
+
* !shaka.extern.Request,
|
|
1339
|
+
* ?shaka.util.Error,
|
|
1340
|
+
* number,
|
|
1341
|
+
* boolean)}
|
|
1342
|
+
* @description
|
|
1343
|
+
* A callback function that notifies the player when a download fails, for any
|
|
1344
|
+
* reason (e.g. even if the download was aborted).
|
|
1345
|
+
*/
|
|
1346
|
+
shaka.net.NetworkingEngine.OnDownloadFailed;
|
|
1164
1347
|
/**
|
|
1165
1348
|
* An interface to standardize how objects release internal references
|
|
1166
1349
|
* synchronously. If an object needs to asynchronously release references, then
|
|
@@ -1459,11 +1642,13 @@ shaka.media.InitSegmentReference = class {
|
|
|
1459
1642
|
* of the resource containing the segment.
|
|
1460
1643
|
* @param {number} startByte The offset from the start of the resource to the
|
|
1461
1644
|
* start of the segment.
|
|
1462
|
-
* @param {?number} endByte The offset from the start of the resource
|
|
1463
|
-
* end of the segment, inclusive. A value of null indicates that the
|
|
1645
|
+
* @param {?number} endByte The offset from the start of the resource
|
|
1646
|
+
* to the end of the segment, inclusive. A value of null indicates that the
|
|
1464
1647
|
* segment extends to the end of the resource.
|
|
1648
|
+
* @param {null|shaka.extern.MediaQualityInfo=} mediaQuality Information about
|
|
1649
|
+
* the quality of the media associated with this init segment.
|
|
1465
1650
|
*/
|
|
1466
|
-
constructor(uris, startByte, endByte) {}
|
|
1651
|
+
constructor(uris, startByte, endByte, mediaQuality) {}
|
|
1467
1652
|
/**
|
|
1468
1653
|
* Returns the offset from the start of the resource to the
|
|
1469
1654
|
* start of the segment.
|
|
@@ -1524,8 +1709,12 @@ shaka.media.SegmentReference = class {
|
|
|
1524
1709
|
* The value is a grid-item-dimension consisting of two positive decimal
|
|
1525
1710
|
* integers in the format: column-x-row ('4x3'). It describes the
|
|
1526
1711
|
* arrangement of Images in a Grid. The minimum valid LAYOUT is '1x1'.
|
|
1712
|
+
* @param {?number=} tileDuration
|
|
1713
|
+
* The explicit duration of an individual tile within the tiles grid.
|
|
1714
|
+
* If not provided, the duration should be automatically calculated based on
|
|
1715
|
+
* the duration of the reference.
|
|
1527
1716
|
*/
|
|
1528
|
-
constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout) {}
|
|
1717
|
+
constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration) {}
|
|
1529
1718
|
/**
|
|
1530
1719
|
* Creates and returns the URIs of the resource containing the segment.
|
|
1531
1720
|
* @return {!Array.<string>}
|
|
@@ -1559,6 +1748,12 @@ shaka.media.SegmentReference = class {
|
|
|
1559
1748
|
* @return {?string}
|
|
1560
1749
|
*/
|
|
1561
1750
|
getTilesLayout() {}
|
|
1751
|
+
/**
|
|
1752
|
+
* Returns the segment's explicit tile duration.
|
|
1753
|
+
* Only defined in image segments.
|
|
1754
|
+
* @return {?number}
|
|
1755
|
+
*/
|
|
1756
|
+
getTileDuration() {}
|
|
1562
1757
|
};
|
|
1563
1758
|
/**
|
|
1564
1759
|
* PresentationTimeline.
|
|
@@ -1994,6 +2189,46 @@ shaka.text.UITextDisplayer = class {
|
|
|
1994
2189
|
*/
|
|
1995
2190
|
shaka.text.WebVttGenerator = class {
|
|
1996
2191
|
};
|
|
2192
|
+
/**
|
|
2193
|
+
* @typedef {{
|
|
2194
|
+
* type: string,
|
|
2195
|
+
* init: boolean,
|
|
2196
|
+
* duration: number,
|
|
2197
|
+
* mimeType: string,
|
|
2198
|
+
* codecs: string,
|
|
2199
|
+
* bandwidth: (number|undefined)
|
|
2200
|
+
* }}
|
|
2201
|
+
* @property {string} type
|
|
2202
|
+
* The media type
|
|
2203
|
+
* @property {boolean} init
|
|
2204
|
+
* Flag indicating whether the segment is an init segment
|
|
2205
|
+
* @property {number} duration
|
|
2206
|
+
* The duration of the segment in seconds
|
|
2207
|
+
* @property {string} mimeType
|
|
2208
|
+
* The segment's mime type
|
|
2209
|
+
* @property {string} codecs
|
|
2210
|
+
* The segment's codecs
|
|
2211
|
+
* @property {(number|undefined)} bandwidth
|
|
2212
|
+
* The segment's variation bandwidth
|
|
2213
|
+
*/
|
|
2214
|
+
shaka.util.CmcdManager.SegmentInfo;
|
|
2215
|
+
/**
|
|
2216
|
+
* @typedef {{
|
|
2217
|
+
* format: shaka.util.CmcdManager.StreamingFormat
|
|
2218
|
+
* }}
|
|
2219
|
+
* @property {shaka.util.CmcdManager.StreamingFormat} format
|
|
2220
|
+
* The manifest's stream format
|
|
2221
|
+
*/
|
|
2222
|
+
shaka.util.CmcdManager.ManifestInfo;
|
|
2223
|
+
/**
|
|
2224
|
+
* @enum {string}
|
|
2225
|
+
*/
|
|
2226
|
+
shaka.util.CmcdManager.StreamingFormat = {
|
|
2227
|
+
DASH: 'd',
|
|
2228
|
+
HLS: 'h',
|
|
2229
|
+
SMOOTH: 's',
|
|
2230
|
+
OTHER: 'o'
|
|
2231
|
+
};
|
|
1997
2232
|
/** */
|
|
1998
2233
|
shaka.util.ConfigUtils = class {
|
|
1999
2234
|
/**
|
|
@@ -2133,6 +2368,14 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
2133
2368
|
* @return {!Promise}
|
|
2134
2369
|
*/
|
|
2135
2370
|
unload(initializeMediaSource) {}
|
|
2371
|
+
/**
|
|
2372
|
+
* Provides a way to update the stream start position during the media loading
|
|
2373
|
+
* process. Can for example be called from the <code>manifestparsed</code>
|
|
2374
|
+
* event handler to update the start position based on information in the
|
|
2375
|
+
* manifest.
|
|
2376
|
+
* @param {number} startTime
|
|
2377
|
+
*/
|
|
2378
|
+
updateStartTime(startTime) {}
|
|
2136
2379
|
/**
|
|
2137
2380
|
* Tell the player to load the content at <code>assetUri</code> and start
|
|
2138
2381
|
* playback at <code>startTime</code>. Before calling <code>load</code>,
|
|
@@ -2642,6 +2885,10 @@ shaka.ads.ClientSideAd = class {
|
|
|
2642
2885
|
* @override
|
|
2643
2886
|
*/
|
|
2644
2887
|
isMuted() {}
|
|
2888
|
+
/**
|
|
2889
|
+
* @override
|
|
2890
|
+
*/
|
|
2891
|
+
isLinear() {}
|
|
2645
2892
|
/**
|
|
2646
2893
|
* @override
|
|
2647
2894
|
*/
|
|
@@ -2724,6 +2971,10 @@ shaka.ads.ServerSideAd = class {
|
|
|
2724
2971
|
* @override
|
|
2725
2972
|
*/
|
|
2726
2973
|
isMuted() {}
|
|
2974
|
+
/**
|
|
2975
|
+
* @override
|
|
2976
|
+
*/
|
|
2977
|
+
isLinear() {}
|
|
2727
2978
|
/**
|
|
2728
2979
|
* @override
|
|
2729
2980
|
*/
|
|
@@ -3194,9 +3445,11 @@ shaka.net.HttpFetchPlugin = class {
|
|
|
3194
3445
|
* @param {shaka.net.NetworkingEngine.RequestType} requestType
|
|
3195
3446
|
* @param {shaka.extern.ProgressUpdated} progressUpdated Called when a
|
|
3196
3447
|
* progress event happened.
|
|
3448
|
+
* @param {shaka.extern.HeadersReceived} headersReceived Called when the
|
|
3449
|
+
* headers for the download are received, but before the body is.
|
|
3197
3450
|
* @return {!shaka.extern.IAbortableOperation.<shaka.extern.Response>}
|
|
3198
3451
|
*/
|
|
3199
|
-
static parse(uri, request, requestType, progressUpdated) {}
|
|
3452
|
+
static parse(uri, request, requestType, progressUpdated, headersReceived) {}
|
|
3200
3453
|
/**
|
|
3201
3454
|
* Determine if the Fetch API is supported in the browser. Note: this is
|
|
3202
3455
|
* deliberately exposed as a method to allow the client app to use the same
|
|
@@ -3215,9 +3468,11 @@ shaka.net.HttpXHRPlugin = class {
|
|
|
3215
3468
|
* @param {shaka.net.NetworkingEngine.RequestType} requestType
|
|
3216
3469
|
* @param {shaka.extern.ProgressUpdated} progressUpdated Called when a
|
|
3217
3470
|
* progress event happened.
|
|
3471
|
+
* @param {shaka.extern.HeadersReceived} headersReceived Called when the
|
|
3472
|
+
* headers for the download are received, but before the body is.
|
|
3218
3473
|
* @return {!shaka.extern.IAbortableOperation.<shaka.extern.Response>}
|
|
3219
3474
|
*/
|
|
3220
|
-
static parse(uri, request, requestType, progressUpdated) {}
|
|
3475
|
+
static parse(uri, request, requestType, progressUpdated, headersReceived) {}
|
|
3221
3476
|
};
|
|
3222
3477
|
/**
|
|
3223
3478
|
* StorageMuxer is responsible for managing StorageMechanisms and addressing
|
|
@@ -3469,6 +3724,13 @@ shaka.polyfill.MediaCapabilities = class {
|
|
|
3469
3724
|
*/
|
|
3470
3725
|
static install() {}
|
|
3471
3726
|
};
|
|
3727
|
+
/**
|
|
3728
|
+
* A copy of the MediaCapabilities instance, to prevent Safari from
|
|
3729
|
+
* garbage-collecting the polyfilled method on it. We make it public and export
|
|
3730
|
+
* it to ensure that it is not stripped out by the compiler.
|
|
3731
|
+
* @type {MediaCapabilities}
|
|
3732
|
+
*/
|
|
3733
|
+
shaka.polyfill.MediaCapabilities.originalMcap;
|
|
3472
3734
|
/**
|
|
3473
3735
|
* @summary A polyfill to patch MSE bugs.
|
|
3474
3736
|
*/
|
|
@@ -3544,6 +3806,15 @@ shaka.polyfill.PiPWebkit = class {
|
|
|
3544
3806
|
*/
|
|
3545
3807
|
static install() {}
|
|
3546
3808
|
};
|
|
3809
|
+
/**
|
|
3810
|
+
* @summary A polyfill to provide window.crypto.randomUUID in all browsers.
|
|
3811
|
+
*/
|
|
3812
|
+
shaka.polyfill.RandomUUID = class {
|
|
3813
|
+
/**
|
|
3814
|
+
* Install the polyfill if needed.
|
|
3815
|
+
*/
|
|
3816
|
+
static install() {}
|
|
3817
|
+
};
|
|
3547
3818
|
/**
|
|
3548
3819
|
* @summary A polyfill to provide navigator.storage.estimate in old
|
|
3549
3820
|
* webkit browsers.
|