shaka-player 4.12.8 → 4.13.0
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/AUTHORS +1 -0
- package/CONTRIBUTORS +4 -0
- package/README.md +22 -21
- package/cspell.config.yaml +18 -0
- package/dist/controls.css +1 -1
- package/dist/controls.css.map +1 -1
- package/dist/deps.js +29 -24
- package/dist/locales.js +33 -33
- package/dist/shaka-player.compiled.d.ts +138 -36
- package/dist/shaka-player.compiled.debug.d.ts +138 -36
- package/dist/shaka-player.compiled.debug.externs.js +367 -107
- package/dist/shaka-player.compiled.debug.js +828 -765
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +367 -107
- package/dist/shaka-player.compiled.js +1451 -1416
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +172 -38
- package/dist/shaka-player.ui.debug.d.ts +172 -38
- package/dist/shaka-player.ui.debug.externs.js +406 -113
- package/dist/shaka-player.ui.debug.js +842 -766
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +406 -113
- package/dist/shaka-player.ui.js +1670 -1628
- package/dist/shaka-player.ui.map +4 -4
- package/eslint.config.mjs +343 -0
- package/externs/airplay.js +1 -1
- package/externs/audiotrack.js +1 -1
- package/externs/awesomplete.js +1 -1
- package/externs/cast-sdk-v2.js +2 -2
- package/externs/cmcd.js +16 -1
- package/externs/device_sensor_event.js +1 -1
- package/externs/ima.js +8 -8
- package/externs/isoboxer.js +31 -31
- package/externs/jwk_set.js +1 -1
- package/externs/lcevc.js +8 -8
- package/externs/mediakeys.js +1 -1
- package/externs/mediasession.js +3 -2
- package/externs/mediatailor.js +18 -18
- package/externs/pictureinpicture.js +41 -1
- package/externs/playstation.js +2 -2
- package/externs/prefixed_eme.js +1 -1
- package/externs/shaka/abortable.js +4 -4
- package/externs/shaka/abr_manager.js +1 -1
- package/externs/shaka/ads.js +45 -6
- package/externs/shaka/cea.js +2 -2
- package/externs/shaka/codecs.js +4 -4
- package/externs/shaka/drm_info.js +6 -6
- package/externs/shaka/error.js +5 -5
- package/externs/shaka/manifest.js +51 -56
- package/externs/shaka/manifest_parser.js +3 -9
- package/externs/shaka/net.js +23 -20
- package/externs/shaka/offline.js +37 -37
- package/externs/shaka/offline_compat_v1.js +10 -10
- package/externs/shaka/offline_compat_v2.js +10 -10
- package/externs/shaka/player.js +139 -109
- package/externs/shaka/text.js +10 -3
- package/externs/shaka/transmuxer.js +1 -1
- package/externs/videotrack.js +1 -1
- package/lib/abr/ewma.js +1 -1
- package/lib/abr/simple_abr_manager.js +70 -22
- package/lib/ads/ad_manager.js +43 -18
- package/lib/ads/ad_utils.js +160 -58
- package/lib/ads/ads_stats.js +1 -1
- package/lib/ads/client_side_ad_manager.js +2 -2
- package/lib/ads/interstitial_ad.js +16 -11
- package/lib/ads/interstitial_ad_manager.js +419 -72
- package/lib/ads/interstitial_static_ad.js +299 -0
- package/lib/ads/media_tailor_ad.js +1 -0
- package/lib/ads/media_tailor_ad_manager.js +37 -36
- package/lib/ads/server_side_ad_manager.js +7 -6
- package/lib/cast/cast_receiver.js +5 -3
- package/lib/cast/cast_sender.js +2 -2
- package/lib/cast/cast_utils.js +20 -13
- package/lib/cea/cea608_data_channel.js +53 -53
- package/lib/cea/cea708_service.js +42 -40
- package/lib/cea/cea708_window.js +5 -2
- package/lib/cea/cea_decoder.js +5 -7
- package/lib/cea/mp4_cea_parser.js +1 -1
- package/lib/cea/sei_processor.js +1 -1
- package/lib/dash/content_protection.js +62 -192
- package/lib/dash/dash_parser.js +119 -119
- package/lib/dash/mpd_utils.js +14 -13
- package/lib/dash/segment_base.js +5 -5
- package/lib/dash/segment_list.js +10 -10
- package/lib/dash/segment_template.js +55 -53
- package/lib/debug/log.js +2 -2
- package/lib/dependencies/all.js +2 -1
- package/lib/{media → drm}/drm_engine.js +274 -143
- package/lib/{util → drm}/drm_utils.js +20 -11
- package/lib/drm/playready.js +233 -0
- package/lib/hls/hls_classes.js +14 -14
- package/lib/hls/hls_parser.js +257 -196
- package/lib/hls/hls_utils.js +14 -14
- package/lib/hls/manifest_text_parser.js +10 -10
- package/lib/media/adaptation_set.js +6 -5
- package/lib/media/adaptation_set_criteria.js +51 -379
- package/lib/media/buffering_observer.js +5 -4
- package/lib/media/closed_caption_parser.js +2 -2
- package/lib/media/content_workarounds.js +2 -2
- package/lib/media/example_based_criteria.js +69 -0
- package/lib/media/gap_jumping_controller.js +14 -1
- package/lib/media/manifest_filterer.js +8 -8
- package/lib/media/manifest_parser.js +2 -2
- package/lib/media/media_source_capabilities.js +20 -1
- package/lib/media/media_source_engine.js +84 -35
- package/lib/media/mp4_segment_index_parser.js +5 -5
- package/lib/media/playhead.js +2 -8
- package/lib/media/playhead_observer.js +1 -1
- package/lib/media/preference_based_criteria.js +333 -0
- package/lib/media/preload_manager.js +53 -37
- package/lib/media/presentation_timeline.js +2 -2
- package/lib/media/quality_observer.js +35 -35
- package/lib/media/region_observer.js +2 -2
- package/lib/media/region_timeline.js +3 -3
- package/lib/media/segment_index.js +14 -14
- package/lib/media/segment_prefetch.js +17 -13
- package/lib/media/segment_reference.js +7 -7
- package/lib/media/segment_utils.js +9 -9
- package/lib/media/streaming_engine.js +77 -38
- package/lib/media/time_ranges_utils.js +1 -1
- package/lib/media/video_wrapper.js +1 -1
- package/lib/media/webm_segment_index_parser.js +4 -4
- package/lib/mss/content_protection.js +17 -222
- package/lib/mss/mss_parser.js +23 -24
- package/lib/net/data_uri_plugin.js +1 -0
- package/lib/net/http_fetch_plugin.js +8 -7
- package/lib/net/http_plugin_utils.js +5 -2
- package/lib/net/http_xhr_plugin.js +4 -3
- package/lib/net/networking_engine.js +72 -17
- package/lib/net/networking_utils.js +5 -2
- package/lib/offline/download_info.js +5 -1
- package/lib/offline/download_manager.js +15 -4
- package/lib/offline/download_progress_estimator.js +1 -1
- package/lib/offline/indexeddb/base_storage_cell.js +9 -9
- package/lib/offline/indexeddb/db_connection.js +1 -1
- package/lib/offline/indexeddb/db_operation.js +2 -2
- package/lib/offline/indexeddb/eme_session_storage_cell.js +1 -1
- package/lib/offline/indexeddb/storage_mechanism.js +1 -1
- package/lib/offline/indexeddb/v1_storage_cell.js +3 -3
- package/lib/offline/indexeddb/v2_storage_cell.js +2 -2
- package/lib/offline/manifest_converter.js +11 -12
- package/lib/offline/offline_scheme.js +8 -4
- package/lib/offline/session_deleter.js +11 -11
- package/lib/offline/storage.js +137 -88
- package/lib/offline/storage_muxer.js +8 -8
- package/lib/offline/stored_content_utils.js +3 -3
- package/lib/offline/stream_bandwidth_estimator.js +1 -1
- package/lib/player.js +291 -207
- package/lib/polyfill/all.js +1 -1
- package/lib/polyfill/media_capabilities.js +5 -5
- package/lib/polyfill/patchedmediakeys_apple.js +6 -6
- package/lib/polyfill/patchedmediakeys_webkit.js +8 -8
- package/lib/polyfill/video_play_promise.js +0 -1
- package/lib/text/cue.js +3 -2
- package/lib/text/lrc_text_parser.js +1 -1
- package/lib/text/mp4_ttml_parser.js +1 -1
- package/lib/text/mp4_vtt_parser.js +3 -3
- package/lib/text/sbv_text_parser.js +1 -1
- package/lib/text/simple_text_displayer.js +37 -10
- package/lib/text/ssa_text_parser.js +3 -1
- package/lib/text/stub_text_displayer.js +12 -5
- package/lib/text/text_engine.js +5 -4
- package/lib/text/text_utils.js +4 -4
- package/lib/text/ttml_text_parser.js +21 -20
- package/lib/text/ui_text_displayer.js +20 -13
- package/lib/text/vtt_text_parser.js +10 -10
- package/lib/text/web_vtt_generator.js +2 -2
- package/lib/transmuxer/aac_transmuxer.js +2 -2
- package/lib/transmuxer/ac3_transmuxer.js +2 -2
- package/lib/transmuxer/adts.js +2 -0
- package/lib/transmuxer/ec3.js +3 -3
- package/lib/transmuxer/ec3_transmuxer.js +2 -2
- package/lib/transmuxer/h264.js +5 -5
- package/lib/transmuxer/h265.js +3 -3
- package/lib/transmuxer/mp3_transmuxer.js +2 -2
- package/lib/transmuxer/mpeg_audio.js +6 -6
- package/lib/transmuxer/mss_transmuxer.js +2 -0
- package/lib/transmuxer/transmuxer_engine.js +1 -1
- package/lib/transmuxer/ts_transmuxer.js +10 -10
- package/lib/util/abortable_operation.js +10 -10
- package/lib/util/array_utils.js +6 -6
- package/lib/util/cmcd_manager.js +149 -18
- package/lib/util/cmsd_manager.js +11 -11
- package/lib/util/config_utils.js +3 -3
- package/lib/util/content_steering_manager.js +17 -17
- package/lib/util/data_view_reader.js +3 -3
- package/lib/util/ebml_parser.js +1 -1
- package/lib/util/error.js +11 -6
- package/lib/util/event_manager.js +1 -1
- package/lib/util/exp_golomb.js +1 -1
- package/lib/util/fairplay_utils.js +6 -1
- package/lib/util/fake_event.js +3 -2
- package/lib/util/fake_event_target.js +1 -1
- package/lib/util/functional.js +8 -8
- package/lib/util/id3_utils.js +1 -1
- package/lib/util/iterables.js +6 -6
- package/lib/util/language_utils.js +17 -17
- package/lib/util/manifest_parser_utils.js +13 -13
- package/lib/util/map_utils.js +6 -6
- package/lib/util/media_ready_state_utils.js +1 -1
- package/lib/util/mime_utils.js +15 -4
- package/lib/util/mp4_box_parsers.js +5 -5
- package/lib/util/mp4_generator.js +31 -30
- package/lib/util/mp4_parser.js +2 -2
- package/lib/util/multi_map.js +5 -5
- package/lib/util/mutex.js +1 -1
- package/lib/util/networking.js +1 -1
- package/lib/util/object_utils.js +5 -1
- package/lib/util/operation_manager.js +1 -1
- package/lib/util/periods.js +24 -24
- package/lib/util/platform.js +8 -4
- package/lib/util/player_configuration.js +50 -17
- package/lib/util/pssh.js +34 -6
- package/lib/util/public_promise.js +2 -2
- package/lib/util/state_history.js +2 -2
- package/lib/util/stream_utils.js +138 -120
- package/lib/util/string_utils.js +4 -3
- package/lib/util/switch_history.js +2 -2
- package/lib/util/tXml.js +22 -17
- package/lib/util/text_parser.js +2 -2
- package/lib/util/timer.js +1 -1
- package/lib/util/ts_parser.js +22 -22
- package/lib/util/xml_utils.js +1 -0
- package/package.json +7 -4
- package/project-words.txt +485 -0
- package/shaka-player.uncompiled.js +1 -1
- package/third_party/closure-uri/uri.js +2 -2
- package/third_party/closure-uri/utils.js +2 -2
- package/third_party/language-mapping-list/language-mapping-list.js +1 -1
- package/ui/ad_statistics_button.js +9 -5
- package/ui/airplay_button.js +1 -0
- package/ui/audio_language_selection.js +2 -1
- package/ui/context_menu.js +2 -2
- package/ui/controls.js +7 -7
- package/ui/externs/ui.js +29 -21
- package/ui/externs/watermark.js +64 -0
- package/ui/fast_forward_button.js +1 -1
- package/ui/gl_matrix/matrix_4x4.js +11 -5
- package/ui/hidden_fast_forward_button.js +1 -1
- package/ui/hidden_seek_button.js +1 -1
- package/ui/language_utils.js +27 -26
- package/ui/less/buttons.less +2 -2
- package/ui/localization.js +21 -21
- package/ui/loop_button.js +2 -2
- package/ui/overflow_menu.js +2 -2
- package/ui/playback_rate_selection.js +1 -1
- package/ui/presentation_time.js +4 -1
- package/ui/range_element.js +2 -2
- package/ui/resolution_selection.js +42 -6
- package/ui/rewind_button.js +1 -1
- package/ui/seek_bar.js +5 -5
- package/ui/statistics_button.js +8 -4
- package/ui/text_selection.js +3 -2
- package/ui/ui.js +32 -2
- package/ui/vr_manager.js +3 -3
- package/ui/vr_utils.js +14 -14
- package/ui/vr_webgl.js +5 -5
- package/ui/watermark.js +313 -0
- package/.eslintignore +0 -4
- package/.eslintrc.js +0 -310
- package/lib/polyfill/patchedmediakeys_nop.js +0 -148
package/lib/util/functional.js
CHANGED
|
@@ -19,9 +19,9 @@ shaka.util.Functional = class {
|
|
|
19
19
|
* e.g.:
|
|
20
20
|
* Promise.reject().catch(callback(array[0])).catch(callback(array[1]));
|
|
21
21
|
*
|
|
22
|
-
* @param {!Array
|
|
23
|
-
* @param {function(ELEM)
|
|
24
|
-
* @return {!Promise
|
|
22
|
+
* @param {!Array<ELEM>} array
|
|
23
|
+
* @param {function(ELEM): !Promise<RESULT>} callback
|
|
24
|
+
* @return {!Promise<RESULT>}
|
|
25
25
|
* @template ELEM,RESULT
|
|
26
26
|
*/
|
|
27
27
|
static createFallbackPromiseChain(array, callback) {
|
|
@@ -35,9 +35,9 @@ shaka.util.Functional = class {
|
|
|
35
35
|
* Returns the first array concatenated to the second; used to collapse an
|
|
36
36
|
* array of arrays into a single array.
|
|
37
37
|
*
|
|
38
|
-
* @param {!Array
|
|
39
|
-
* @param {!Array
|
|
40
|
-
* @return {!Array
|
|
38
|
+
* @param {!Array<T>} all
|
|
39
|
+
* @param {!Array<T>} part
|
|
40
|
+
* @return {!Array<T>}
|
|
41
41
|
* @template T
|
|
42
42
|
*/
|
|
43
43
|
static collapseArrays(all, part) {
|
|
@@ -82,8 +82,8 @@ shaka.util.Functional = class {
|
|
|
82
82
|
* |asyncProcess| is still allowed to complete.
|
|
83
83
|
*
|
|
84
84
|
* @param {number} seconds
|
|
85
|
-
* @param {!Promise
|
|
86
|
-
* @return {!Promise
|
|
85
|
+
* @param {!Promise<T>} asyncProcess
|
|
86
|
+
* @return {!Promise<T>}
|
|
87
87
|
* @template T
|
|
88
88
|
*/
|
|
89
89
|
static promiseWithTimeout(seconds, asyncProcess) {
|
package/lib/util/id3_utils.js
CHANGED
|
@@ -320,7 +320,7 @@ shaka.util.Id3Utils = class {
|
|
|
320
320
|
/**
|
|
321
321
|
* Returns an array of ID3 frames found in all the ID3 tags in the id3Data
|
|
322
322
|
* @param {Uint8Array} id3Data - The ID3 data containing one or more ID3 tags
|
|
323
|
-
* @return {!Array
|
|
323
|
+
* @return {!Array<shaka.extern.MetadataFrame>}
|
|
324
324
|
* @export
|
|
325
325
|
*/
|
|
326
326
|
static getID3Frames(id3Data) {
|
package/lib/util/iterables.js
CHANGED
|
@@ -14,9 +14,9 @@ goog.provide('shaka.util.Iterables');
|
|
|
14
14
|
*/
|
|
15
15
|
shaka.util.Iterables = class {
|
|
16
16
|
/**
|
|
17
|
-
* @param {!Iterable
|
|
17
|
+
* @param {!Iterable<FROM>} iterable
|
|
18
18
|
* @param {function(FROM):TO} mapping
|
|
19
|
-
* @return {!Iterable
|
|
19
|
+
* @return {!Iterable<TO>}
|
|
20
20
|
* @template FROM,TO
|
|
21
21
|
*/
|
|
22
22
|
static map(iterable, mapping) {
|
|
@@ -28,7 +28,7 @@ shaka.util.Iterables = class {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* @param {!Iterable
|
|
31
|
+
* @param {!Iterable<T>} iterable
|
|
32
32
|
* @param {function(T):boolean} test
|
|
33
33
|
* @return {boolean}
|
|
34
34
|
* @template T
|
|
@@ -43,7 +43,7 @@ shaka.util.Iterables = class {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
* @param {!Iterable
|
|
46
|
+
* @param {!Iterable<T>} iterable
|
|
47
47
|
* @param {function(T):boolean} test
|
|
48
48
|
* @return {boolean}
|
|
49
49
|
* @template T
|
|
@@ -61,9 +61,9 @@ shaka.util.Iterables = class {
|
|
|
61
61
|
* Iterate over an iterable object and return only the items that |filter|
|
|
62
62
|
* returns true for.
|
|
63
63
|
*
|
|
64
|
-
* @param {!Iterable
|
|
64
|
+
* @param {!Iterable<T>} iterable
|
|
65
65
|
* @param {function(T):boolean} filter
|
|
66
|
-
* @return {!Array
|
|
66
|
+
* @return {!Array<T>}
|
|
67
67
|
* @template T
|
|
68
68
|
*/
|
|
69
69
|
static filter(iterable, filter) {
|
|
@@ -76,9 +76,9 @@ shaka.util.LanguageUtils = class {
|
|
|
76
76
|
|
|
77
77
|
// Get all components. This should only be language and region
|
|
78
78
|
// since we do not support dialect.
|
|
79
|
-
/** @type {!Array
|
|
79
|
+
/** @type {!Array<string>} */
|
|
80
80
|
const locale1Components = LanguageUtils.disassembleLocale_(locale1);
|
|
81
|
-
/** @type {!Array
|
|
81
|
+
/** @type {!Array<string>} */
|
|
82
82
|
const locale2Components = LanguageUtils.disassembleLocale_(locale2);
|
|
83
83
|
|
|
84
84
|
// We are language compatible if we have the same language.
|
|
@@ -117,10 +117,10 @@ shaka.util.LanguageUtils = class {
|
|
|
117
117
|
|
|
118
118
|
// Get all components. This should only be language and region
|
|
119
119
|
// since we do not support dialect.
|
|
120
|
-
/** @type {!Array
|
|
120
|
+
/** @type {!Array<string>} */
|
|
121
121
|
const possibleParentComponents =
|
|
122
122
|
LanguageUtils.disassembleLocale_(possibleParent);
|
|
123
|
-
/** @type {!Array
|
|
123
|
+
/** @type {!Array<string>} */
|
|
124
124
|
const possibleChildComponents =
|
|
125
125
|
LanguageUtils.disassembleLocale_(possibleChild);
|
|
126
126
|
|
|
@@ -162,9 +162,9 @@ shaka.util.LanguageUtils = class {
|
|
|
162
162
|
|
|
163
163
|
// Get all components. This should only be language and region
|
|
164
164
|
// since we do not support dialect.
|
|
165
|
-
/** @type {!Array
|
|
165
|
+
/** @type {!Array<string>} */
|
|
166
166
|
const localeAComponents = LanguageUtils.disassembleLocale_(localeA);
|
|
167
|
-
/** @type {!Array
|
|
167
|
+
/** @type {!Array<string>} */
|
|
168
168
|
const localeBComponents = LanguageUtils.disassembleLocale_(localeB);
|
|
169
169
|
|
|
170
170
|
return localeAComponents.length == 2 &&
|
|
@@ -191,15 +191,15 @@ shaka.util.LanguageUtils = class {
|
|
|
191
191
|
static normalize(locale) {
|
|
192
192
|
const LanguageUtils = shaka.util.LanguageUtils;
|
|
193
193
|
|
|
194
|
-
const
|
|
195
|
-
const [languageRegion = '',
|
|
196
|
-
locale.split(`-${
|
|
194
|
+
const privateUsePrefix = 'x-';
|
|
195
|
+
const [languageRegion = '', privateUseSuffix = ''] =
|
|
196
|
+
locale.split(`-${privateUsePrefix}`);
|
|
197
197
|
const [languageCode = '', regionCode = ''] = languageRegion.split('-');
|
|
198
198
|
|
|
199
|
-
// We are only going to use the language, the region and the
|
|
199
|
+
// We are only going to use the language, the region and the private use part (as per https://datatracker.ietf.org/doc/html/rfc5646).
|
|
200
200
|
// Anything else is thrown away.
|
|
201
|
-
const
|
|
202
|
-
`${
|
|
201
|
+
const privateUse = privateUseSuffix ?
|
|
202
|
+
`${privateUsePrefix}${privateUseSuffix}` : '';
|
|
203
203
|
|
|
204
204
|
// Convert the language to lower case. It is standard for the language code
|
|
205
205
|
// to be in lower case, but it will also make the map look-up easier.
|
|
@@ -212,7 +212,7 @@ shaka.util.LanguageUtils = class {
|
|
|
212
212
|
const region = regionCode.toUpperCase();
|
|
213
213
|
|
|
214
214
|
return `${region ? `${language}-${region}` : language}${
|
|
215
|
-
|
|
215
|
+
privateUse ? `-${privateUse}` : ''}`;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
/**
|
|
@@ -367,7 +367,7 @@ shaka.util.LanguageUtils = class {
|
|
|
367
367
|
* locale is found to be close to |target|, then |null| will be returned.
|
|
368
368
|
*
|
|
369
369
|
* @param {string} target
|
|
370
|
-
* @param {!Iterable
|
|
370
|
+
* @param {!Iterable<string>} searchSpace
|
|
371
371
|
* @return {?string}
|
|
372
372
|
* @export
|
|
373
373
|
*/
|
|
@@ -376,7 +376,7 @@ shaka.util.LanguageUtils = class {
|
|
|
376
376
|
|
|
377
377
|
/** @type {string} */
|
|
378
378
|
const safeTarget = LanguageUtils.normalize(target);
|
|
379
|
-
/** @type {!Set
|
|
379
|
+
/** @type {!Set<string>} */
|
|
380
380
|
const safeSearchSpace = new Set();
|
|
381
381
|
for (const option of searchSpace) {
|
|
382
382
|
safeSearchSpace.add(LanguageUtils.normalize(option));
|
|
@@ -428,7 +428,7 @@ shaka.util.LanguageUtils = class {
|
|
|
428
428
|
* should ONLY be used to verify locales that have been normalized.
|
|
429
429
|
*
|
|
430
430
|
* @param {string} locale
|
|
431
|
-
* @return {!Array
|
|
431
|
+
* @return {!Array<string>}
|
|
432
432
|
* @private
|
|
433
433
|
*/
|
|
434
434
|
static disassembleLocale_(locale) {
|
|
@@ -451,7 +451,7 @@ shaka.util.LanguageUtils = class {
|
|
|
451
451
|
* A map from 3-letter language codes (ISO 639-2) to 2-letter language codes
|
|
452
452
|
* (ISO 639-1) for all languages which have both in the registry.
|
|
453
453
|
*
|
|
454
|
-
* @const {!Map
|
|
454
|
+
* @const {!Map<string, string>}
|
|
455
455
|
* @private
|
|
456
456
|
*/
|
|
457
457
|
shaka.util.LanguageUtils.isoMap_ = new Map([
|
|
@@ -24,10 +24,10 @@ shaka.util.ManifestParserUtils = class {
|
|
|
24
24
|
* Note: This method is slow in SmartTVs and Consoles. It should only be
|
|
25
25
|
* called when necessary.
|
|
26
26
|
*
|
|
27
|
-
* @param {!Array
|
|
28
|
-
* @param {!Array
|
|
27
|
+
* @param {!Array<string>} baseUris
|
|
28
|
+
* @param {!Array<string>} relativeUris
|
|
29
29
|
* @param {string=} extraQueryParams
|
|
30
|
-
* @return {!Array
|
|
30
|
+
* @return {!Array<string>}
|
|
31
31
|
*/
|
|
32
32
|
static resolveUris(baseUris, relativeUris, extraQueryParams = '') {
|
|
33
33
|
if (relativeUris.length == 0) {
|
|
@@ -69,7 +69,7 @@ shaka.util.ManifestParserUtils = class {
|
|
|
69
69
|
*
|
|
70
70
|
* @param {string} keySystem
|
|
71
71
|
* @param {string} encryptionScheme
|
|
72
|
-
* @param {Array
|
|
72
|
+
* @param {Array<shaka.extern.InitDataOverride>} initData
|
|
73
73
|
* @param {string} [keySystemUri]
|
|
74
74
|
* @return {shaka.extern.DrmInfo}
|
|
75
75
|
*/
|
|
@@ -99,7 +99,7 @@ shaka.util.ManifestParserUtils = class {
|
|
|
99
99
|
/**
|
|
100
100
|
* Creates a DrmInfo object from ClearKeys.
|
|
101
101
|
*
|
|
102
|
-
* @param {!Map
|
|
102
|
+
* @param {!Map<string, string>} clearKeys
|
|
103
103
|
* @param {string=} encryptionScheme
|
|
104
104
|
* @return {shaka.extern.DrmInfo}
|
|
105
105
|
*/
|
|
@@ -166,7 +166,7 @@ shaka.util.ManifestParserUtils = class {
|
|
|
166
166
|
* Assumes that at least one codec is correct, and throws if none are.
|
|
167
167
|
*
|
|
168
168
|
* @param {string} contentType
|
|
169
|
-
* @param {!Array
|
|
169
|
+
* @param {!Array<string>} codecs
|
|
170
170
|
* @return {string}
|
|
171
171
|
*/
|
|
172
172
|
static guessCodecs(contentType, codecs) {
|
|
@@ -197,7 +197,7 @@ shaka.util.ManifestParserUtils = class {
|
|
|
197
197
|
* not throw if it fails to match.
|
|
198
198
|
*
|
|
199
199
|
* @param {string} contentType
|
|
200
|
-
* @param {!Array
|
|
200
|
+
* @param {!Array<string>} codecs
|
|
201
201
|
* @return {?string} or null if no match is found
|
|
202
202
|
*/
|
|
203
203
|
static guessCodecsSafe(contentType, codecs) {
|
|
@@ -225,8 +225,8 @@ shaka.util.ManifestParserUtils = class {
|
|
|
225
225
|
* content.
|
|
226
226
|
*
|
|
227
227
|
* @param {string} contentType
|
|
228
|
-
* @param {!Array
|
|
229
|
-
* @return {!Array
|
|
228
|
+
* @param {!Array<string>} codecs
|
|
229
|
+
* @return {!Array<string>}
|
|
230
230
|
*/
|
|
231
231
|
static guessAllCodecsSafe(contentType, codecs) {
|
|
232
232
|
const allCodecs = [];
|
|
@@ -280,7 +280,7 @@ shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS = 1 / 15;
|
|
|
280
280
|
/**
|
|
281
281
|
* A list of regexps to detect well-known video codecs.
|
|
282
282
|
*
|
|
283
|
-
* @const {!Array
|
|
283
|
+
* @const {!Array<!RegExp>}
|
|
284
284
|
* @private
|
|
285
285
|
*/
|
|
286
286
|
shaka.util.ManifestParserUtils.VIDEO_CODEC_REGEXPS_ = [
|
|
@@ -300,7 +300,7 @@ shaka.util.ManifestParserUtils.VIDEO_CODEC_REGEXPS_ = [
|
|
|
300
300
|
/**
|
|
301
301
|
* A list of regexps to detect well-known audio codecs.
|
|
302
302
|
*
|
|
303
|
-
* @const {!Array
|
|
303
|
+
* @const {!Array<!RegExp>}
|
|
304
304
|
* @private
|
|
305
305
|
*/
|
|
306
306
|
shaka.util.ManifestParserUtils.AUDIO_CODEC_REGEXPS_ = [
|
|
@@ -321,7 +321,7 @@ shaka.util.ManifestParserUtils.AUDIO_CODEC_REGEXPS_ = [
|
|
|
321
321
|
/**
|
|
322
322
|
* A list of regexps to detect well-known text codecs.
|
|
323
323
|
*
|
|
324
|
-
* @const {!Array
|
|
324
|
+
* @const {!Array<!RegExp>}
|
|
325
325
|
* @private
|
|
326
326
|
*/
|
|
327
327
|
shaka.util.ManifestParserUtils.TEXT_CODEC_REGEXPS_ = [
|
|
@@ -332,7 +332,7 @@ shaka.util.ManifestParserUtils.TEXT_CODEC_REGEXPS_ = [
|
|
|
332
332
|
|
|
333
333
|
|
|
334
334
|
/**
|
|
335
|
-
* @const {!Object
|
|
335
|
+
* @const {!Object<string, !Array<!RegExp>>}
|
|
336
336
|
*/
|
|
337
337
|
shaka.util.ManifestParserUtils.CODEC_REGEXPS_BY_CONTENT_TYPE_ = {
|
|
338
338
|
'audio': shaka.util.ManifestParserUtils.AUDIO_CODEC_REGEXPS_,
|
package/lib/util/map_utils.js
CHANGED
|
@@ -12,8 +12,8 @@ goog.provide('shaka.util.MapUtils');
|
|
|
12
12
|
*/
|
|
13
13
|
shaka.util.MapUtils = class {
|
|
14
14
|
/**
|
|
15
|
-
* @param {!Object
|
|
16
|
-
* @return {!Map
|
|
15
|
+
* @param {!Object<KEY, VALUE>} object
|
|
16
|
+
* @return {!Map<KEY, VALUE>}
|
|
17
17
|
* @template KEY,VALUE
|
|
18
18
|
*/
|
|
19
19
|
static asMap(object) {
|
|
@@ -27,8 +27,8 @@ shaka.util.MapUtils = class {
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* @param {!Map
|
|
31
|
-
* @return {!Object
|
|
30
|
+
* @param {!Map<KEY, VALUE>} map
|
|
31
|
+
* @return {!Object<KEY, VALUE>}
|
|
32
32
|
* @template KEY,VALUE
|
|
33
33
|
*/
|
|
34
34
|
static asObject(map) {
|
|
@@ -44,8 +44,8 @@ shaka.util.MapUtils = class {
|
|
|
44
44
|
* NOTE: This only works for simple value types and
|
|
45
45
|
* will not be accurate if map values are objects!
|
|
46
46
|
*
|
|
47
|
-
* @param {Map
|
|
48
|
-
* @param {Map
|
|
47
|
+
* @param {Map<KEY, VALUE>} map1
|
|
48
|
+
* @param {Map<KEY, VALUE>} map2
|
|
49
49
|
* @return {boolean}
|
|
50
50
|
* @template KEY,VALUE
|
|
51
51
|
*/
|
package/lib/util/mime_utils.js
CHANGED
|
@@ -125,7 +125,7 @@ shaka.util.MimeUtils = class {
|
|
|
125
125
|
/**
|
|
126
126
|
* Split a list of codecs encoded in a string into a list of codecs.
|
|
127
127
|
* @param {string} codecs
|
|
128
|
-
* @return {!Array
|
|
128
|
+
* @return {!Array<string>}
|
|
129
129
|
*/
|
|
130
130
|
static splitCodecs(codecs) {
|
|
131
131
|
return codecs.split(',');
|
|
@@ -254,11 +254,22 @@ shaka.util.MimeUtils = class {
|
|
|
254
254
|
mimeType === 'application/vnd.apple.mpegurl';
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
+
/**
|
|
258
|
+
* Checks if the given MIME type is DASH MIME type.
|
|
259
|
+
*
|
|
260
|
+
* @param {string} mimeType
|
|
261
|
+
* @return {boolean}
|
|
262
|
+
*/
|
|
263
|
+
static isDashType(mimeType) {
|
|
264
|
+
return mimeType === 'application/dash+xml' ||
|
|
265
|
+
mimeType === 'video/vnd.mpeg.dash.mpd';
|
|
266
|
+
}
|
|
267
|
+
|
|
257
268
|
/**
|
|
258
269
|
* Get the base and profile of a codec string. Where [0] will be the codec
|
|
259
270
|
* base and [1] will be the profile.
|
|
260
271
|
* @param {string} codecString
|
|
261
|
-
* @return {!Array
|
|
272
|
+
* @return {!Array<string>}
|
|
262
273
|
* @private
|
|
263
274
|
*/
|
|
264
275
|
static getCodecParts_(codecString) {
|
|
@@ -281,7 +292,7 @@ shaka.util.MimeUtils = class {
|
|
|
281
292
|
*
|
|
282
293
|
* This initial set of parameters are all recognized by Chromecast.
|
|
283
294
|
*
|
|
284
|
-
* @const {!Map
|
|
295
|
+
* @const {!Map<string, string>}
|
|
285
296
|
* @private
|
|
286
297
|
*/
|
|
287
298
|
shaka.util.MimeUtils.EXTENDED_MIME_PARAMETERS_ = new Map()
|
|
@@ -308,7 +319,7 @@ shaka.util.MimeUtils.CEA708_CLOSED_CAPTION_MIMETYPE = 'application/cea-708';
|
|
|
308
319
|
/**
|
|
309
320
|
* MIME types of raw formats.
|
|
310
321
|
*
|
|
311
|
-
* @const {!Array
|
|
322
|
+
* @const {!Array<string>}
|
|
312
323
|
*/
|
|
313
324
|
shaka.util.MimeUtils.RAW_FORMATS = [
|
|
314
325
|
'audio/aac',
|
|
@@ -313,7 +313,7 @@ shaka.util.Mp4BoxParsers = class {
|
|
|
313
313
|
reader.skip(2); // Skip "data_reference_index"
|
|
314
314
|
reader.skip(8); // Skip "reserved"
|
|
315
315
|
const channelCount = reader.readUint16();
|
|
316
|
-
reader.skip(2); // Skip "
|
|
316
|
+
reader.skip(2); // Skip "sample_size"
|
|
317
317
|
reader.skip(2); // Skip "pre_defined"
|
|
318
318
|
reader.skip(2); // Skip "reserved"
|
|
319
319
|
const sampleRate = reader.readUint16() + (reader.readUint16() / 65536);
|
|
@@ -818,13 +818,13 @@ shaka.util.ParsedTREXBox;
|
|
|
818
818
|
/**
|
|
819
819
|
* @typedef {{
|
|
820
820
|
* sampleCount: number,
|
|
821
|
-
* sampleData: !Array
|
|
821
|
+
* sampleData: !Array<shaka.util.ParsedTRUNSample>,
|
|
822
822
|
* dataOffset: ?number
|
|
823
823
|
* }}
|
|
824
824
|
*
|
|
825
825
|
* @property {number} sampleCount
|
|
826
826
|
* As per the spec: the number of samples being added in this run;
|
|
827
|
-
* @property {!Array
|
|
827
|
+
* @property {!Array<shaka.util.ParsedTRUNSample>} sampleData
|
|
828
828
|
* An array of size <sampleCount> containing data for each sample
|
|
829
829
|
* @property {?number} dataOffset
|
|
830
830
|
* If specified via flags, this indicate the offset of the sample in bytes.
|
|
@@ -847,7 +847,7 @@ shaka.util.ParsedTRUNBox;
|
|
|
847
847
|
* @property {?number} sampleCompositionTimeOffset
|
|
848
848
|
* The time since the start of the sample in timescale units. Time
|
|
849
849
|
* offset is based of the start of the sample. If this value is
|
|
850
|
-
* missing, the accumulated durations
|
|
850
|
+
* missing, the accumulated durations preceding this time sample will
|
|
851
851
|
* be used to create the start time.
|
|
852
852
|
*
|
|
853
853
|
* @exportDoc
|
|
@@ -1022,7 +1022,7 @@ shaka.util.ParsedHDLRBox;
|
|
|
1022
1022
|
* Possible values:
|
|
1023
1023
|
* - Rectangular: ‘rect’
|
|
1024
1024
|
* - Half equirectangular: ‘hequ’
|
|
1025
|
-
* -
|
|
1025
|
+
* - Equirectangular: ?
|
|
1026
1026
|
* - Fisheye: ‘fish’
|
|
1027
1027
|
*
|
|
1028
1028
|
* @exportDoc
|
|
@@ -13,12 +13,12 @@ goog.require('shaka.util.Uint8ArrayUtils');
|
|
|
13
13
|
|
|
14
14
|
shaka.util.Mp4Generator = class {
|
|
15
15
|
/**
|
|
16
|
-
* @param {!Array
|
|
16
|
+
* @param {!Array<shaka.util.Mp4Generator.StreamInfo>} streamInfos
|
|
17
17
|
*/
|
|
18
18
|
constructor(streamInfos) {
|
|
19
19
|
shaka.util.Mp4Generator.initStaticProperties_();
|
|
20
20
|
|
|
21
|
-
/** @private {!Array
|
|
21
|
+
/** @private {!Array<shaka.util.Mp4Generator.StreamInfo>} */
|
|
22
22
|
this.streamInfos_ = streamInfos;
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -355,8 +355,8 @@ shaka.util.Mp4Generator = class {
|
|
|
355
355
|
0x00, 0x00, 0x00, 0x00, // pre_defined
|
|
356
356
|
...this.breakNumberIntoBytes_(width, 2), // width
|
|
357
357
|
...this.breakNumberIntoBytes_(height, 2), // height
|
|
358
|
-
0x00, 0x48, 0x00, 0x00, //
|
|
359
|
-
0x00, 0x48, 0x00, 0x00, //
|
|
358
|
+
0x00, 0x48, 0x00, 0x00, // horizontal resolution
|
|
359
|
+
0x00, 0x48, 0x00, 0x00, // vertical resolution
|
|
360
360
|
0x00, 0x00, 0x00, 0x00, // reserved
|
|
361
361
|
0x00, 0x01, // frame_count
|
|
362
362
|
0x13,
|
|
@@ -367,7 +367,7 @@ shaka.util.Mp4Generator = class {
|
|
|
367
367
|
0x68, 0x6c, 0x73, 0x00,
|
|
368
368
|
0x00, 0x00, 0x00, 0x00,
|
|
369
369
|
0x00, 0x00, 0x00, 0x00,
|
|
370
|
-
0x00, 0x00, 0x00, //
|
|
370
|
+
0x00, 0x00, 0x00, // compressor name
|
|
371
371
|
0x00, 0x18, // depth = 24
|
|
372
372
|
0x11, 0x11, // pre_defined = -1
|
|
373
373
|
]);
|
|
@@ -390,8 +390,8 @@ shaka.util.Mp4Generator = class {
|
|
|
390
390
|
* @private
|
|
391
391
|
*/
|
|
392
392
|
avcC_(streamInfo) {
|
|
393
|
-
const
|
|
394
|
-
const
|
|
393
|
+
const NALU_TYPE_SPS = 7;
|
|
394
|
+
const NALU_TYPE_PPS = 8;
|
|
395
395
|
|
|
396
396
|
// length = 7 by default (0 SPS and 0 PPS)
|
|
397
397
|
let avcCLength = 7;
|
|
@@ -406,12 +406,12 @@ shaka.util.Mp4Generator = class {
|
|
|
406
406
|
const naluBytes = this.hexStringToBuffer_(streamInfo.videoNalus[i]);
|
|
407
407
|
const naluType = naluBytes[0] & 0x1F;
|
|
408
408
|
switch (naluType) {
|
|
409
|
-
case
|
|
409
|
+
case NALU_TYPE_SPS:
|
|
410
410
|
sps.push(naluBytes);
|
|
411
411
|
// 2 = sequenceParameterSetLength field length
|
|
412
412
|
avcCLength += naluBytes.length + 2;
|
|
413
413
|
break;
|
|
414
|
-
case
|
|
414
|
+
case NALU_TYPE_PPS:
|
|
415
415
|
pps.push(naluBytes);
|
|
416
416
|
// 2 = pictureParameterSetLength field length
|
|
417
417
|
avcCLength += naluBytes.length + 2;
|
|
@@ -485,8 +485,8 @@ shaka.util.Mp4Generator = class {
|
|
|
485
485
|
0x00, 0x00, 0x00, 0x00, // pre_defined
|
|
486
486
|
...this.breakNumberIntoBytes_(width, 2), // width
|
|
487
487
|
...this.breakNumberIntoBytes_(height, 2), // height
|
|
488
|
-
0x00, 0x48, 0x00, 0x00, //
|
|
489
|
-
0x00, 0x48, 0x00, 0x00, //
|
|
488
|
+
0x00, 0x48, 0x00, 0x00, // horizontal resolution
|
|
489
|
+
0x00, 0x48, 0x00, 0x00, // vertical resolution
|
|
490
490
|
0x00, 0x00, 0x00, 0x00, // reserved
|
|
491
491
|
0x00, 0x01, // frame_count
|
|
492
492
|
0x13,
|
|
@@ -497,7 +497,7 @@ shaka.util.Mp4Generator = class {
|
|
|
497
497
|
0x68, 0x6c, 0x73, 0x00,
|
|
498
498
|
0x00, 0x00, 0x00, 0x00,
|
|
499
499
|
0x00, 0x00, 0x00, 0x00,
|
|
500
|
-
0x00, 0x00, 0x00, //
|
|
500
|
+
0x00, 0x00, 0x00, // compressor name
|
|
501
501
|
0x00, 0x18, // depth = 24
|
|
502
502
|
0x11, 0x11, // pre_defined = -1
|
|
503
503
|
]);
|
|
@@ -550,7 +550,7 @@ shaka.util.Mp4Generator = class {
|
|
|
550
550
|
0x00, 0x00, 0x00, 0x00,
|
|
551
551
|
0x00, 0x00, 0x00, 0x00, // reserved
|
|
552
552
|
0x00,
|
|
553
|
-
channelsCount, //
|
|
553
|
+
channelsCount, // channel count
|
|
554
554
|
0x00, 0x10, // sampleSize:16bits
|
|
555
555
|
0x00, 0x00, 0x00, 0x00, // reserved2
|
|
556
556
|
...this.breakNumberIntoBytes_(audioSamplingRate, 2), // Sample Rate
|
|
@@ -706,13 +706,13 @@ shaka.util.Mp4Generator = class {
|
|
|
706
706
|
0x00, 0x00, 0x00, // flags
|
|
707
707
|
|
|
708
708
|
// ES_Descriptor
|
|
709
|
-
0x03, // tag,
|
|
709
|
+
0x03, // tag, ES_DescriptionTag
|
|
710
710
|
0x19, // length
|
|
711
711
|
...this.breakNumberIntoBytes_(id, 2), // ES_ID
|
|
712
712
|
0x00, // streamDependenceFlag, URL_flag, reserved, streamPriority
|
|
713
713
|
|
|
714
714
|
// DecoderConfigDescriptor
|
|
715
|
-
0x04, // tag,
|
|
715
|
+
0x04, // tag, DecoderConfigDescriptionTag
|
|
716
716
|
0x11, // length
|
|
717
717
|
0x40, // object type
|
|
718
718
|
0x15, // streamType
|
|
@@ -1041,9 +1041,9 @@ shaka.util.Mp4Generator = class {
|
|
|
1041
1041
|
|
|
1042
1042
|
const samples = streamInfo.data ? streamInfo.data.samples : [];
|
|
1043
1043
|
const samplesLength = samples.length;
|
|
1044
|
-
const
|
|
1045
|
-
const bytes = new Uint8Array(
|
|
1046
|
-
offset += 8 +
|
|
1044
|
+
const bytesLen = 12 + 16 * samplesLength;
|
|
1045
|
+
const bytes = new Uint8Array(bytesLen);
|
|
1046
|
+
offset += 8 + bytesLen;
|
|
1047
1047
|
const isVideo = streamInfo.type === ContentType.VIDEO;
|
|
1048
1048
|
bytes.set(
|
|
1049
1049
|
[
|
|
@@ -1081,6 +1081,7 @@ shaka.util.Mp4Generator = class {
|
|
|
1081
1081
|
/**
|
|
1082
1082
|
* Generate a MDAT box
|
|
1083
1083
|
*
|
|
1084
|
+
* @param {shaka.util.Mp4Generator.StreamInfo} streamInfo
|
|
1084
1085
|
* @return {!Uint8Array}
|
|
1085
1086
|
* @private
|
|
1086
1087
|
*/
|
|
@@ -1096,7 +1097,7 @@ shaka.util.Mp4Generator = class {
|
|
|
1096
1097
|
/**
|
|
1097
1098
|
* @param {number} number
|
|
1098
1099
|
* @param {number} numBytes
|
|
1099
|
-
* @return {!Array
|
|
1100
|
+
* @return {!Array<number>}
|
|
1100
1101
|
* @private
|
|
1101
1102
|
*/
|
|
1102
1103
|
breakNumberIntoBytes_(number, numBytes) {
|
|
@@ -1142,11 +1143,11 @@ shaka.util.Mp4Generator = class {
|
|
|
1142
1143
|
*/
|
|
1143
1144
|
static initStaticProperties_() {
|
|
1144
1145
|
const Mp4Generator = shaka.util.Mp4Generator;
|
|
1145
|
-
if (Mp4Generator.
|
|
1146
|
+
if (Mp4Generator.initialized_) {
|
|
1146
1147
|
return;
|
|
1147
1148
|
}
|
|
1148
1149
|
|
|
1149
|
-
Mp4Generator.
|
|
1150
|
+
Mp4Generator.initialized_ = true;
|
|
1150
1151
|
|
|
1151
1152
|
const majorBrand = new Uint8Array([105, 115, 111, 109]); // isom
|
|
1152
1153
|
const avc1Brand = new Uint8Array([97, 118, 99, 49]); // avc1
|
|
@@ -1202,7 +1203,7 @@ shaka.util.Mp4Generator = class {
|
|
|
1202
1203
|
/**
|
|
1203
1204
|
* @private {boolean}
|
|
1204
1205
|
*/
|
|
1205
|
-
shaka.util.Mp4Generator.
|
|
1206
|
+
shaka.util.Mp4Generator.initialized_ = false;
|
|
1206
1207
|
|
|
1207
1208
|
|
|
1208
1209
|
/**
|
|
@@ -1211,7 +1212,7 @@ shaka.util.Mp4Generator.initializated_ = false;
|
|
|
1211
1212
|
shaka.util.Mp4Generator.UINT32_MAX_ = Math.pow(2, 32) - 1;
|
|
1212
1213
|
|
|
1213
1214
|
/**
|
|
1214
|
-
* @private {!Object
|
|
1215
|
+
* @private {!Object<string, !Array<number>>}
|
|
1215
1216
|
*/
|
|
1216
1217
|
shaka.util.Mp4Generator.BOX_TYPES_ = {};
|
|
1217
1218
|
|
|
@@ -1288,10 +1289,10 @@ shaka.util.Mp4Generator.STSZ_ = new Uint8Array([
|
|
|
1288
1289
|
shaka.util.Mp4Generator.VMHD_ = new Uint8Array([
|
|
1289
1290
|
0x00, // version
|
|
1290
1291
|
0x00, 0x00, 0x01, // flags
|
|
1291
|
-
0x00, 0x00, //
|
|
1292
|
+
0x00, 0x00, // graphics mode
|
|
1292
1293
|
0x00, 0x00,
|
|
1293
1294
|
0x00, 0x00,
|
|
1294
|
-
0x00, 0x00, //
|
|
1295
|
+
0x00, 0x00, // op color
|
|
1295
1296
|
]);
|
|
1296
1297
|
|
|
1297
1298
|
/**
|
|
@@ -1344,7 +1345,7 @@ shaka.util.Mp4Generator.DINF_ = new Uint8Array([]);
|
|
|
1344
1345
|
* encrypted: boolean,
|
|
1345
1346
|
* timescale: number,
|
|
1346
1347
|
* duration: number,
|
|
1347
|
-
* videoNalus: !Array
|
|
1348
|
+
* videoNalus: !Array<string>,
|
|
1348
1349
|
* audioConfig: !Uint8Array,
|
|
1349
1350
|
* videoConfig: !Uint8Array,
|
|
1350
1351
|
* hSpacing: number,
|
|
@@ -1367,7 +1368,7 @@ shaka.util.Mp4Generator.DINF_ = new Uint8Array([]);
|
|
|
1367
1368
|
* The Stream's timescale.
|
|
1368
1369
|
* @property {number} duration
|
|
1369
1370
|
* The Stream's duration.
|
|
1370
|
-
* @property {!Array
|
|
1371
|
+
* @property {!Array<string>} videoNalus
|
|
1371
1372
|
* The stream's video nalus.
|
|
1372
1373
|
* @property {!Uint8Array} audioConfig
|
|
1373
1374
|
* The stream's audio config.
|
|
@@ -1376,7 +1377,7 @@ shaka.util.Mp4Generator.DINF_ = new Uint8Array([]);
|
|
|
1376
1377
|
* @property {number} hSpacing
|
|
1377
1378
|
* The stream's video horizontal spacing of pixels.
|
|
1378
1379
|
* @property {number} vSpacing
|
|
1379
|
-
* The stream's video
|
|
1380
|
+
* The stream's video vertical spacing of pixels.
|
|
1380
1381
|
* @property {?shaka.util.Mp4Generator.Data} data
|
|
1381
1382
|
* The stream's data.
|
|
1382
1383
|
* @property {!shaka.extern.Stream} stream
|
|
@@ -1388,14 +1389,14 @@ shaka.util.Mp4Generator.StreamInfo;
|
|
|
1388
1389
|
* @typedef {{
|
|
1389
1390
|
* sequenceNumber: number,
|
|
1390
1391
|
* baseMediaDecodeTime: number,
|
|
1391
|
-
* samples: !Array
|
|
1392
|
+
* samples: !Array<shaka.util.Mp4Generator.Mp4Sample>
|
|
1392
1393
|
* }}
|
|
1393
1394
|
*
|
|
1394
1395
|
* @property {number} sequenceNumber
|
|
1395
1396
|
* The sequence number.
|
|
1396
1397
|
* @property {number} baseMediaDecodeTime
|
|
1397
1398
|
* The base media decode time.
|
|
1398
|
-
* @property {!Array
|
|
1399
|
+
* @property {!Array<shaka.util.Mp4Generator.Mp4Sample>} samples
|
|
1399
1400
|
* The data samples.
|
|
1400
1401
|
*/
|
|
1401
1402
|
shaka.util.Mp4Generator.Data;
|
package/lib/util/mp4_parser.js
CHANGED
|
@@ -17,10 +17,10 @@ goog.require('shaka.util.DataViewReader');
|
|
|
17
17
|
shaka.util.Mp4Parser = class {
|
|
18
18
|
/** */
|
|
19
19
|
constructor() {
|
|
20
|
-
/** @private {!Object
|
|
20
|
+
/** @private {!Object<number, shaka.util.Mp4Parser.BoxType_>} */
|
|
21
21
|
this.headers_ = [];
|
|
22
22
|
|
|
23
|
-
/** @private {!Object
|
|
23
|
+
/** @private {!Object<number, !shaka.util.Mp4Parser.CallbackType>} */
|
|
24
24
|
this.boxDefinitions_ = [];
|
|
25
25
|
|
|
26
26
|
/** @private {boolean} */
|