shaka-player 3.2.2 → 3.3.2
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/.github/workflows/build_and_test.yaml +73 -0
- package/.github/workflows/release.yaml +53 -0
- package/AUTHORS +6 -5
- package/CHANGELOG.md +314 -1
- package/CONTRIBUTORS +4 -2
- package/build/checkversion.py +1 -1
- package/build/conformance.textproto +183 -169
- package/build/test.py +6 -0
- 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 +18 -0
- 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 +19 -16
- package/dist/demo.compiled.debug.map +3 -3
- package/dist/demo.compiled.js +19 -16
- package/dist/demo.compiled.map +3 -3
- package/dist/deps.js +21 -14
- package/dist/locales.js +31 -29
- package/dist/receiver.compiled.debug.js +11 -9
- package/dist/receiver.compiled.debug.map +3 -3
- package/dist/receiver.compiled.js +11 -9
- package/dist/receiver.compiled.map +3 -3
- package/dist/shaka-player.compiled.d.ts +232 -18
- package/dist/shaka-player.compiled.debug.d.ts +232 -18
- package/dist/shaka-player.compiled.debug.externs.js +293 -17
- package/dist/shaka-player.compiled.debug.js +481 -422
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +293 -17
- package/dist/shaka-player.compiled.js +846 -817
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +250 -30
- package/dist/shaka-player.ui.debug.d.ts +250 -30
- package/dist/shaka-player.ui.debug.externs.js +322 -28
- package/dist/shaka-player.ui.debug.js +630 -553
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +322 -28
- package/dist/shaka-player.ui.js +1048 -1006
- 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/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 +19 -15
- 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/ad_manager.js +1 -0
- package/lib/ads/client_side_ad.js +8 -0
- package/lib/ads/client_side_ad_manager.js +8 -4
- package/lib/ads/server_side_ad.js +7 -0
- package/lib/cast/cast_proxy.js +3 -0
- package/lib/cast/cast_receiver.js +3 -0
- package/lib/cast/cast_utils.js +1 -0
- package/lib/dash/dash_parser.js +79 -33
- package/lib/dash/segment_base.js +25 -1
- package/lib/dash/segment_list.js +18 -9
- package/lib/dash/segment_template.js +23 -10
- package/lib/hls/hls_parser.js +116 -23
- package/lib/hls/manifest_text_parser.js +1 -0
- package/lib/media/quality_observer.js +274 -0
- package/lib/media/region_observer.js +39 -33
- package/lib/media/region_timeline.js +17 -19
- package/lib/media/segment_index.js +8 -1
- package/lib/media/segment_reference.js +37 -4
- package/lib/media/streaming_engine.js +47 -6
- 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 +85 -18
- 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 +401 -293
- package/lib/offline/stored_content_utils.js +2 -0
- package/lib/player.js +254 -27
- package/lib/polyfill/media_capabilities.js +30 -15
- package/lib/polyfill/random_uuid.js +52 -0
- package/lib/text/cue.js +18 -0
- package/lib/text/ttml_text_parser.js +109 -60
- package/lib/text/ui_text_displayer.js +19 -13
- package/lib/util/cmcd_manager.js +672 -0
- package/lib/util/error.js +6 -0
- package/lib/util/fake_event_target.js +21 -1
- package/lib/util/language_utils.js +12 -0
- package/lib/util/mutex.js +52 -0
- package/lib/util/periods.js +98 -64
- package/lib/util/player_configuration.js +18 -0
- package/lib/util/stream_utils.js +86 -10
- package/lib/util/xml_utils.js +19 -0
- package/package.json +3 -6
- package/shaka-player.uncompiled.js +3 -0
- package/test/dash/dash_parser_content_protection_unit.js +2 -0
- package/test/dash/dash_parser_live_unit.js +144 -1
- package/test/dash/dash_parser_manifest_unit.js +37 -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 +76 -0
- package/test/media/drm_engine_unit.js +3 -3
- package/test/media/quality_observer_unit.js +142 -0
- package/test/media/region_observer_unit.js +40 -5
- package/test/media/region_timeline_unit.js +40 -22
- 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 +140 -8
- package/test/player_src_equals_integration.js +41 -8
- package/test/player_unit.js +19 -9
- 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_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/test/util/util.js +10 -7
- package/test/text/mp4_ttml_parser_unit.js +11 -18
- package/test/text/ttml_text_parser_unit.js +544 -228
- package/test/ui/text_displayer_layout_unit.js +8 -7
- package/test/ui/ui_unit.js +250 -0
- package/test/util/cmcd_manager_unit.js +291 -0
- package/test/util/stream_utils_unit.js +36 -30
- 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 +1 -0
- package/ui/context_menu.js +109 -0
- package/ui/controls.js +44 -7
- 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 +74 -0
- 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/source.json +4 -0
- package/ui/localization.js +12 -36
- 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 +5 -0
- 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.
|
|
@@ -962,11 +1120,24 @@ shaka.util.FakeEvent = class {
|
|
|
962
1120
|
*/
|
|
963
1121
|
constructor(type, dict) {}
|
|
964
1122
|
};
|
|
1123
|
+
/**
|
|
1124
|
+
* An interface to standardize how objects release internal references
|
|
1125
|
+
* synchronously. If an object needs to asynchronously release references, then
|
|
1126
|
+
* it should use 'shaka.util.IDestroyable'.
|
|
1127
|
+
* @interface
|
|
1128
|
+
*/
|
|
1129
|
+
shaka.util.IReleasable = class {
|
|
1130
|
+
/**
|
|
1131
|
+
* Request that this object release all internal references.
|
|
1132
|
+
*/
|
|
1133
|
+
release() {}
|
|
1134
|
+
};
|
|
965
1135
|
/**
|
|
966
1136
|
* @summary A work-alike for EventTarget. Only DOM elements may be true
|
|
967
1137
|
* EventTargets, but this can be used as a base class to provide event dispatch
|
|
968
1138
|
* to non-DOM classes. Only FakeEvents should be dispatched.
|
|
969
1139
|
* @implements {EventTarget}
|
|
1140
|
+
* @implements {shaka.util.IReleasable}
|
|
970
1141
|
*/
|
|
971
1142
|
shaka.util.FakeEventTarget = class {
|
|
972
1143
|
/** */
|
|
@@ -1004,6 +1175,10 @@ shaka.util.FakeEventTarget = class {
|
|
|
1004
1175
|
* @override
|
|
1005
1176
|
*/
|
|
1006
1177
|
dispatchEvent(event) {}
|
|
1178
|
+
/**
|
|
1179
|
+
* @override
|
|
1180
|
+
*/
|
|
1181
|
+
release() {}
|
|
1007
1182
|
};
|
|
1008
1183
|
/**
|
|
1009
1184
|
* These are the listener types defined in the closure extern for EventTarget.
|
|
@@ -1021,8 +1196,12 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
|
|
|
1021
1196
|
* @param {function(number, number)=} onProgressUpdated Called when a progress
|
|
1022
1197
|
* event is triggered. Passed the duration, in milliseconds, that the
|
|
1023
1198
|
* request took, and the number of bytes transferred.
|
|
1199
|
+
* @param {shaka.net.NetworkingEngine.OnHeadersReceived=} onHeadersReceived
|
|
1200
|
+
* Called when the headers are received for a download.
|
|
1201
|
+
* @param {shaka.net.NetworkingEngine.OnDownloadFailed=} onDownloadFailed
|
|
1202
|
+
* Called when a download fails, for any reason.
|
|
1024
1203
|
*/
|
|
1025
|
-
constructor(onProgressUpdated) {}
|
|
1204
|
+
constructor(onProgressUpdated, onHeadersReceived, onDownloadFailed) {}
|
|
1026
1205
|
/**
|
|
1027
1206
|
* @param {boolean} forceHTTPS
|
|
1028
1207
|
*/
|
|
@@ -1162,17 +1341,26 @@ shaka.net.NetworkingEngine.PluginPriority = {
|
|
|
1162
1341
|
'APPLICATION': 3
|
|
1163
1342
|
};
|
|
1164
1343
|
/**
|
|
1165
|
-
*
|
|
1166
|
-
*
|
|
1167
|
-
*
|
|
1168
|
-
*
|
|
1344
|
+
* @typedef {function(
|
|
1345
|
+
* !Object.<string, string>,
|
|
1346
|
+
* !shaka.extern.Request,
|
|
1347
|
+
* !shaka.net.NetworkingEngine.RequestType)}
|
|
1348
|
+
* @description
|
|
1349
|
+
* A callback function that passes the shaka.extern.HeadersReceived along to
|
|
1350
|
+
* the player, plus some extra data.
|
|
1169
1351
|
*/
|
|
1170
|
-
shaka.
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1352
|
+
shaka.net.NetworkingEngine.OnHeadersReceived;
|
|
1353
|
+
/**
|
|
1354
|
+
* @typedef {function(
|
|
1355
|
+
* !shaka.extern.Request,
|
|
1356
|
+
* ?shaka.util.Error,
|
|
1357
|
+
* number,
|
|
1358
|
+
* boolean)}
|
|
1359
|
+
* @description
|
|
1360
|
+
* A callback function that notifies the player when a download fails, for any
|
|
1361
|
+
* reason (e.g. even if the download was aborted).
|
|
1362
|
+
*/
|
|
1363
|
+
shaka.net.NetworkingEngine.OnDownloadFailed;
|
|
1176
1364
|
/**
|
|
1177
1365
|
* @summary
|
|
1178
1366
|
* An EventManager maintains a collection of "event
|
|
@@ -1459,11 +1647,13 @@ shaka.media.InitSegmentReference = class {
|
|
|
1459
1647
|
* of the resource containing the segment.
|
|
1460
1648
|
* @param {number} startByte The offset from the start of the resource to the
|
|
1461
1649
|
* 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
|
|
1650
|
+
* @param {?number} endByte The offset from the start of the resource
|
|
1651
|
+
* to the end of the segment, inclusive. A value of null indicates that the
|
|
1464
1652
|
* segment extends to the end of the resource.
|
|
1653
|
+
* @param {null|shaka.extern.MediaQualityInfo=} mediaQuality Information about
|
|
1654
|
+
* the quality of the media associated with this init segment.
|
|
1465
1655
|
*/
|
|
1466
|
-
constructor(uris, startByte, endByte) {}
|
|
1656
|
+
constructor(uris, startByte, endByte, mediaQuality) {}
|
|
1467
1657
|
/**
|
|
1468
1658
|
* Returns the offset from the start of the resource to the
|
|
1469
1659
|
* start of the segment.
|
|
@@ -1524,8 +1714,12 @@ shaka.media.SegmentReference = class {
|
|
|
1524
1714
|
* The value is a grid-item-dimension consisting of two positive decimal
|
|
1525
1715
|
* integers in the format: column-x-row ('4x3'). It describes the
|
|
1526
1716
|
* arrangement of Images in a Grid. The minimum valid LAYOUT is '1x1'.
|
|
1717
|
+
* @param {?number=} tileDuration
|
|
1718
|
+
* The explicit duration of an individual tile within the tiles grid.
|
|
1719
|
+
* If not provided, the duration should be automatically calculated based on
|
|
1720
|
+
* the duration of the reference.
|
|
1527
1721
|
*/
|
|
1528
|
-
constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout) {}
|
|
1722
|
+
constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration) {}
|
|
1529
1723
|
/**
|
|
1530
1724
|
* Creates and returns the URIs of the resource containing the segment.
|
|
1531
1725
|
* @return {!Array.<string>}
|
|
@@ -1559,6 +1753,12 @@ shaka.media.SegmentReference = class {
|
|
|
1559
1753
|
* @return {?string}
|
|
1560
1754
|
*/
|
|
1561
1755
|
getTilesLayout() {}
|
|
1756
|
+
/**
|
|
1757
|
+
* Returns the segment's explicit tile duration.
|
|
1758
|
+
* Only defined in image segments.
|
|
1759
|
+
* @return {?number}
|
|
1760
|
+
*/
|
|
1761
|
+
getTileDuration() {}
|
|
1562
1762
|
};
|
|
1563
1763
|
/**
|
|
1564
1764
|
* PresentationTimeline.
|
|
@@ -1994,6 +2194,46 @@ shaka.text.UITextDisplayer = class {
|
|
|
1994
2194
|
*/
|
|
1995
2195
|
shaka.text.WebVttGenerator = class {
|
|
1996
2196
|
};
|
|
2197
|
+
/**
|
|
2198
|
+
* @typedef {{
|
|
2199
|
+
* type: string,
|
|
2200
|
+
* init: boolean,
|
|
2201
|
+
* duration: number,
|
|
2202
|
+
* mimeType: string,
|
|
2203
|
+
* codecs: string,
|
|
2204
|
+
* bandwidth: (number|undefined)
|
|
2205
|
+
* }}
|
|
2206
|
+
* @property {string} type
|
|
2207
|
+
* The media type
|
|
2208
|
+
* @property {boolean} init
|
|
2209
|
+
* Flag indicating whether the segment is an init segment
|
|
2210
|
+
* @property {number} duration
|
|
2211
|
+
* The duration of the segment in seconds
|
|
2212
|
+
* @property {string} mimeType
|
|
2213
|
+
* The segment's mime type
|
|
2214
|
+
* @property {string} codecs
|
|
2215
|
+
* The segment's codecs
|
|
2216
|
+
* @property {(number|undefined)} bandwidth
|
|
2217
|
+
* The segment's variation bandwidth
|
|
2218
|
+
*/
|
|
2219
|
+
shaka.util.CmcdManager.SegmentInfo;
|
|
2220
|
+
/**
|
|
2221
|
+
* @typedef {{
|
|
2222
|
+
* format: shaka.util.CmcdManager.StreamingFormat
|
|
2223
|
+
* }}
|
|
2224
|
+
* @property {shaka.util.CmcdManager.StreamingFormat} format
|
|
2225
|
+
* The manifest's stream format
|
|
2226
|
+
*/
|
|
2227
|
+
shaka.util.CmcdManager.ManifestInfo;
|
|
2228
|
+
/**
|
|
2229
|
+
* @enum {string}
|
|
2230
|
+
*/
|
|
2231
|
+
shaka.util.CmcdManager.StreamingFormat = {
|
|
2232
|
+
DASH: 'd',
|
|
2233
|
+
HLS: 'h',
|
|
2234
|
+
SMOOTH: 's',
|
|
2235
|
+
OTHER: 'o'
|
|
2236
|
+
};
|
|
1997
2237
|
/** */
|
|
1998
2238
|
shaka.util.ConfigUtils = class {
|
|
1999
2239
|
/**
|
|
@@ -2133,6 +2373,14 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
2133
2373
|
* @return {!Promise}
|
|
2134
2374
|
*/
|
|
2135
2375
|
unload(initializeMediaSource) {}
|
|
2376
|
+
/**
|
|
2377
|
+
* Provides a way to update the stream start position during the media loading
|
|
2378
|
+
* process. Can for example be called from the <code>manifestparsed</code>
|
|
2379
|
+
* event handler to update the start position based on information in the
|
|
2380
|
+
* manifest.
|
|
2381
|
+
* @param {number} startTime
|
|
2382
|
+
*/
|
|
2383
|
+
updateStartTime(startTime) {}
|
|
2136
2384
|
/**
|
|
2137
2385
|
* Tell the player to load the content at <code>assetUri</code> and start
|
|
2138
2386
|
* playback at <code>startTime</code>. Before calling <code>load</code>,
|
|
@@ -2642,6 +2890,10 @@ shaka.ads.ClientSideAd = class {
|
|
|
2642
2890
|
* @override
|
|
2643
2891
|
*/
|
|
2644
2892
|
isMuted() {}
|
|
2893
|
+
/**
|
|
2894
|
+
* @override
|
|
2895
|
+
*/
|
|
2896
|
+
isLinear() {}
|
|
2645
2897
|
/**
|
|
2646
2898
|
* @override
|
|
2647
2899
|
*/
|
|
@@ -2724,6 +2976,10 @@ shaka.ads.ServerSideAd = class {
|
|
|
2724
2976
|
* @override
|
|
2725
2977
|
*/
|
|
2726
2978
|
isMuted() {}
|
|
2979
|
+
/**
|
|
2980
|
+
* @override
|
|
2981
|
+
*/
|
|
2982
|
+
isLinear() {}
|
|
2727
2983
|
/**
|
|
2728
2984
|
* @override
|
|
2729
2985
|
*/
|
|
@@ -3194,9 +3450,11 @@ shaka.net.HttpFetchPlugin = class {
|
|
|
3194
3450
|
* @param {shaka.net.NetworkingEngine.RequestType} requestType
|
|
3195
3451
|
* @param {shaka.extern.ProgressUpdated} progressUpdated Called when a
|
|
3196
3452
|
* progress event happened.
|
|
3453
|
+
* @param {shaka.extern.HeadersReceived} headersReceived Called when the
|
|
3454
|
+
* headers for the download are received, but before the body is.
|
|
3197
3455
|
* @return {!shaka.extern.IAbortableOperation.<shaka.extern.Response>}
|
|
3198
3456
|
*/
|
|
3199
|
-
static parse(uri, request, requestType, progressUpdated) {}
|
|
3457
|
+
static parse(uri, request, requestType, progressUpdated, headersReceived) {}
|
|
3200
3458
|
/**
|
|
3201
3459
|
* Determine if the Fetch API is supported in the browser. Note: this is
|
|
3202
3460
|
* deliberately exposed as a method to allow the client app to use the same
|
|
@@ -3215,9 +3473,11 @@ shaka.net.HttpXHRPlugin = class {
|
|
|
3215
3473
|
* @param {shaka.net.NetworkingEngine.RequestType} requestType
|
|
3216
3474
|
* @param {shaka.extern.ProgressUpdated} progressUpdated Called when a
|
|
3217
3475
|
* progress event happened.
|
|
3476
|
+
* @param {shaka.extern.HeadersReceived} headersReceived Called when the
|
|
3477
|
+
* headers for the download are received, but before the body is.
|
|
3218
3478
|
* @return {!shaka.extern.IAbortableOperation.<shaka.extern.Response>}
|
|
3219
3479
|
*/
|
|
3220
|
-
static parse(uri, request, requestType, progressUpdated) {}
|
|
3480
|
+
static parse(uri, request, requestType, progressUpdated, headersReceived) {}
|
|
3221
3481
|
};
|
|
3222
3482
|
/**
|
|
3223
3483
|
* StorageMuxer is responsible for managing StorageMechanisms and addressing
|
|
@@ -3469,6 +3729,13 @@ shaka.polyfill.MediaCapabilities = class {
|
|
|
3469
3729
|
*/
|
|
3470
3730
|
static install() {}
|
|
3471
3731
|
};
|
|
3732
|
+
/**
|
|
3733
|
+
* A copy of the MediaCapabilities instance, to prevent Safari from
|
|
3734
|
+
* garbage-collecting the polyfilled method on it. We make it public and export
|
|
3735
|
+
* it to ensure that it is not stripped out by the compiler.
|
|
3736
|
+
* @type {MediaCapabilities}
|
|
3737
|
+
*/
|
|
3738
|
+
shaka.polyfill.MediaCapabilities.originalMcap;
|
|
3472
3739
|
/**
|
|
3473
3740
|
* @summary A polyfill to patch MSE bugs.
|
|
3474
3741
|
*/
|
|
@@ -3544,6 +3811,15 @@ shaka.polyfill.PiPWebkit = class {
|
|
|
3544
3811
|
*/
|
|
3545
3812
|
static install() {}
|
|
3546
3813
|
};
|
|
3814
|
+
/**
|
|
3815
|
+
* @summary A polyfill to provide window.crypto.randomUUID in all browsers.
|
|
3816
|
+
*/
|
|
3817
|
+
shaka.polyfill.RandomUUID = class {
|
|
3818
|
+
/**
|
|
3819
|
+
* Install the polyfill if needed.
|
|
3820
|
+
*/
|
|
3821
|
+
static install() {}
|
|
3822
|
+
};
|
|
3547
3823
|
/**
|
|
3548
3824
|
* @summary A polyfill to provide navigator.storage.estimate in old
|
|
3549
3825
|
* webkit browsers.
|