shaka-player 4.12.9 → 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 +36 -36
- package/dist/shaka-player.compiled.d.ts +131 -36
- package/dist/shaka-player.compiled.debug.d.ts +131 -36
- package/dist/shaka-player.compiled.debug.externs.js +355 -107
- package/dist/shaka-player.compiled.debug.js +799 -742
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +355 -107
- package/dist/shaka-player.compiled.js +1456 -1423
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +165 -38
- package/dist/shaka-player.ui.debug.d.ts +165 -38
- package/dist/shaka-player.ui.debug.externs.js +394 -113
- package/dist/shaka-player.ui.debug.js +808 -738
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +394 -113
- package/dist/shaka-player.ui.js +1671 -1632
- 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 +137 -108
- package/externs/shaka/text.js +3 -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 +34 -24
- 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 +98 -108
- 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 +14 -14
- 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/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 +71 -26
- 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 +270 -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/ssa_text_parser.js +3 -1
- package/lib/text/stub_text_displayer.js +5 -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 +13 -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/dash/mpd_utils.js
CHANGED
|
@@ -37,7 +37,7 @@ shaka.dash.MpdUtils = class {
|
|
|
37
37
|
*/
|
|
38
38
|
static fillUriTemplate(
|
|
39
39
|
uriTemplate, representationId, number, subNumber, bandwidth, time) {
|
|
40
|
-
/** @type {!Object
|
|
40
|
+
/** @type {!Object<string, ?number | ?string>} */
|
|
41
41
|
const valueTable = {
|
|
42
42
|
'RepresentationID': representationId,
|
|
43
43
|
'Number': number,
|
|
@@ -46,6 +46,7 @@ shaka.dash.MpdUtils = class {
|
|
|
46
46
|
'Time': time,
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
+
// cspell: disable-next-line
|
|
49
50
|
const re = /\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g; // eslint-disable-line max-len
|
|
50
51
|
const uri = uriTemplate.replace(re, (match, name, widthStr, format) => {
|
|
51
52
|
if (match == '$$') {
|
|
@@ -129,7 +130,7 @@ shaka.dash.MpdUtils = class {
|
|
|
129
130
|
* @param {number} periodDuration The Period's duration in seconds.
|
|
130
131
|
* Infinity indicates that the Period continues indefinitely.
|
|
131
132
|
* @param {number} startNumber
|
|
132
|
-
* @return {!Array
|
|
133
|
+
* @return {!Array<shaka.media.PresentationTimeline.TimeRange>}
|
|
133
134
|
*/
|
|
134
135
|
static createTimeline(
|
|
135
136
|
timePoints, timescale, unscaledPresentationTimeOffset,
|
|
@@ -143,7 +144,7 @@ shaka.dash.MpdUtils = class {
|
|
|
143
144
|
// Alias.
|
|
144
145
|
const TXml = shaka.util.TXml;
|
|
145
146
|
|
|
146
|
-
/** @type {!Array
|
|
147
|
+
/** @type {!Array<shaka.media.PresentationTimeline.TimeRange>} */
|
|
147
148
|
const timeline = [];
|
|
148
149
|
let lastEndTime = -unscaledPresentationTimeOffset;
|
|
149
150
|
|
|
@@ -186,7 +187,7 @@ shaka.dash.MpdUtils = class {
|
|
|
186
187
|
return timeline;
|
|
187
188
|
} else if (startTime >= nextStartTime) {
|
|
188
189
|
shaka.log.warning(
|
|
189
|
-
'An "S" element cannot have a negative
|
|
190
|
+
'An "S" element cannot have a negative repeat if its start ',
|
|
190
191
|
'time exceeds the next "S" element\'s start time:',
|
|
191
192
|
'ignoring the remaining "S" elements.', timePoint);
|
|
192
193
|
return timeline;
|
|
@@ -207,7 +208,7 @@ shaka.dash.MpdUtils = class {
|
|
|
207
208
|
shaka.log.warning(
|
|
208
209
|
'The last "S" element cannot have a negative repeat',
|
|
209
210
|
'if its start time exceeds the Period\'s duration:',
|
|
210
|
-
'
|
|
211
|
+
'ignoring the last "S" element.', timePoint);
|
|
211
212
|
return timeline;
|
|
212
213
|
}
|
|
213
214
|
repeat = Math.ceil((periodDuration * timescale - startTime) / d) - 1;
|
|
@@ -293,7 +294,7 @@ shaka.dash.MpdUtils = class {
|
|
|
293
294
|
startNumber = 1;
|
|
294
295
|
}
|
|
295
296
|
|
|
296
|
-
/** @type {Array
|
|
297
|
+
/** @type {Array<shaka.media.PresentationTimeline.TimeRange>} */
|
|
297
298
|
let timeline = null;
|
|
298
299
|
const timelineNode =
|
|
299
300
|
MpdUtils.inheritChild(context, callback, 'SegmentTimeline');
|
|
@@ -322,8 +323,8 @@ shaka.dash.MpdUtils = class {
|
|
|
322
323
|
* @param {shaka.dash.DashParser.Context} context
|
|
323
324
|
* @param {function(?shaka.dash.DashParser.InheritanceFrame):
|
|
324
325
|
* ?shaka.extern.xml.Node} callback
|
|
325
|
-
* @return {!Array
|
|
326
|
-
|
|
326
|
+
* @return {!Array<!shaka.extern.xml.Node>}
|
|
327
|
+
*/
|
|
327
328
|
static getNodes(context, callback) {
|
|
328
329
|
const Functional = shaka.util.Functional;
|
|
329
330
|
goog.asserts.assert(
|
|
@@ -417,9 +418,9 @@ shaka.dash.MpdUtils = class {
|
|
|
417
418
|
// Remove the xlink properties, so it won't download again
|
|
418
419
|
// when re-processed.
|
|
419
420
|
for (const key of Object.keys(element.attributes)) {
|
|
420
|
-
const
|
|
421
|
+
const segments = key.split(':');
|
|
421
422
|
const namespace = shaka.util.TXml.getKnownNameSpace(NS);
|
|
422
|
-
if (
|
|
423
|
+
if (segments[0] == namespace) {
|
|
423
424
|
delete element.attributes[key];
|
|
424
425
|
}
|
|
425
426
|
}
|
|
@@ -504,7 +505,7 @@ shaka.dash.MpdUtils = class {
|
|
|
504
505
|
* @param {boolean} failGracefully
|
|
505
506
|
* @param {string} baseUri
|
|
506
507
|
* @param {!shaka.net.NetworkingEngine} networkingEngine
|
|
507
|
-
* @param {number=} linkDepth
|
|
508
|
+
* @param {number=} linkDepth default set to 0
|
|
508
509
|
* @return {!shaka.util.AbortableOperation.<!shaka.extern.xml.Node>}
|
|
509
510
|
*/
|
|
510
511
|
static processXlinks(
|
|
@@ -569,7 +570,7 @@ shaka.dash.MpdUtils = class {
|
|
|
569
570
|
* startNumber: number,
|
|
570
571
|
* scaledPresentationTimeOffset: number,
|
|
571
572
|
* unscaledPresentationTimeOffset: number,
|
|
572
|
-
* timeline: Array
|
|
573
|
+
* timeline: Array<shaka.media.PresentationTimeline.TimeRange>
|
|
573
574
|
* }}
|
|
574
575
|
*
|
|
575
576
|
* @description
|
|
@@ -587,7 +588,7 @@ shaka.dash.MpdUtils = class {
|
|
|
587
588
|
* The presentation time offset of the representation, in seconds.
|
|
588
589
|
* @property {number} unscaledPresentationTimeOffset
|
|
589
590
|
* The presentation time offset of the representation, in timescale units.
|
|
590
|
-
* @property {Array
|
|
591
|
+
* @property {Array<shaka.media.PresentationTimeline.TimeRange>} timeline
|
|
591
592
|
* The timeline of the representation, if given. Times in seconds.
|
|
592
593
|
*/
|
|
593
594
|
shaka.dash.MpdUtils.SegmentInfo;
|
package/lib/dash/segment_base.js
CHANGED
|
@@ -136,11 +136,11 @@ shaka.dash.SegmentBase = class {
|
|
|
136
136
|
* @param {shaka.dash.DashParser.Context} context
|
|
137
137
|
* @param {shaka.dash.DashParser.RequestSegmentCallback} requestSegment
|
|
138
138
|
* @param {shaka.media.InitSegmentReference} initSegmentReference
|
|
139
|
-
* @param {!Array
|
|
139
|
+
* @param {!Array<string>} uris
|
|
140
140
|
* @param {number} startByte
|
|
141
141
|
* @param {?number} endByte
|
|
142
142
|
* @param {number} scaledPresentationTimeOffset
|
|
143
|
-
* @return {!Promise
|
|
143
|
+
* @return {!Promise<shaka.media.SegmentIndex>}
|
|
144
144
|
*/
|
|
145
145
|
static async generateSegmentIndexFromUris(
|
|
146
146
|
context, requestSegment, initSegmentReference, uris, startByte,
|
|
@@ -173,7 +173,7 @@ shaka.dash.SegmentBase = class {
|
|
|
173
173
|
const results = await Promise.all(responses);
|
|
174
174
|
const indexData = results[0];
|
|
175
175
|
const initData = results[1] || null;
|
|
176
|
-
/** @type {Array
|
|
176
|
+
/** @type {Array<!shaka.media.SegmentReference>} */
|
|
177
177
|
let references = null;
|
|
178
178
|
|
|
179
179
|
const timestampOffset = periodStart - scaledPresentationTimeOffset;
|
|
@@ -249,7 +249,7 @@ shaka.dash.SegmentBase = class {
|
|
|
249
249
|
* Compute the URIs of the segment index from the container.
|
|
250
250
|
*
|
|
251
251
|
* @param {shaka.dash.DashParser.Context} context
|
|
252
|
-
* @return {!Array
|
|
252
|
+
* @return {!Array<string>}
|
|
253
253
|
* @private
|
|
254
254
|
*/
|
|
255
255
|
static computeIndexUris_(context) {
|
|
@@ -350,7 +350,7 @@ shaka.dash.SegmentBase = class {
|
|
|
350
350
|
* @param {shaka.dash.DashParser.RequestSegmentCallback} requestSegment
|
|
351
351
|
* @param {shaka.media.InitSegmentReference} initSegmentReference
|
|
352
352
|
* @param {number} scaledPresentationTimeOffset
|
|
353
|
-
* @return {!Promise
|
|
353
|
+
* @return {!Promise<shaka.media.SegmentIndex>}
|
|
354
354
|
* @private
|
|
355
355
|
*/
|
|
356
356
|
static generateSegmentIndex_(
|
package/lib/dash/segment_list.js
CHANGED
|
@@ -31,7 +31,7 @@ shaka.dash.SegmentList = class {
|
|
|
31
31
|
* Updates the existing SegmentIndex, if any.
|
|
32
32
|
*
|
|
33
33
|
* @param {shaka.dash.DashParser.Context} context
|
|
34
|
-
* @param {!Object
|
|
34
|
+
* @param {!Object<string, !shaka.extern.Stream>} streamMap
|
|
35
35
|
* @param {shaka.extern.aesKey|undefined} aesKey
|
|
36
36
|
* @return {shaka.dash.DashParser.StreamInfo}
|
|
37
37
|
*/
|
|
@@ -197,7 +197,7 @@ shaka.dash.SegmentList = class {
|
|
|
197
197
|
* @param {number} periodStart in seconds.
|
|
198
198
|
* @param {?number} periodDuration in seconds.
|
|
199
199
|
* @param {number} startNumber
|
|
200
|
-
* @param {function()
|
|
200
|
+
* @param {function(): !Array<string>} getBaseUris
|
|
201
201
|
* @param {shaka.dash.SegmentList.SegmentListInfo} info
|
|
202
202
|
* @param {shaka.media.InitSegmentReference} initSegmentReference
|
|
203
203
|
* @param {shaka.extern.aesKey|undefined} aesKey
|
|
@@ -205,7 +205,7 @@ shaka.dash.SegmentList = class {
|
|
|
205
205
|
* @param {string} codecs
|
|
206
206
|
* @param {number} bandwidth
|
|
207
207
|
* @param {function():string} urlParams
|
|
208
|
-
* @return {!Array
|
|
208
|
+
* @return {!Array<!shaka.media.SegmentReference>}
|
|
209
209
|
* @private
|
|
210
210
|
*/
|
|
211
211
|
static createSegmentReferences_(
|
|
@@ -227,7 +227,7 @@ shaka.dash.SegmentList = class {
|
|
|
227
227
|
const appendWindowEnd = periodDuration ?
|
|
228
228
|
periodStart + periodDuration : Infinity;
|
|
229
229
|
|
|
230
|
-
/** @type {!Array
|
|
230
|
+
/** @type {!Array<!shaka.media.SegmentReference>} */
|
|
231
231
|
const references = [];
|
|
232
232
|
let prevEndTime = info.startTime;
|
|
233
233
|
for (let i = 0; i < max; i++) {
|
|
@@ -287,12 +287,12 @@ shaka.dash.SegmentList = class {
|
|
|
287
287
|
* Parses the media URIs from the context.
|
|
288
288
|
*
|
|
289
289
|
* @param {shaka.dash.DashParser.Context} context
|
|
290
|
-
* @return {!Array
|
|
290
|
+
* @return {!Array<shaka.dash.SegmentList.MediaSegment>}
|
|
291
291
|
* @private
|
|
292
292
|
*/
|
|
293
293
|
static parseMediaSegments_(context) {
|
|
294
294
|
const Functional = shaka.util.Functional;
|
|
295
|
-
/** @type {!Array
|
|
295
|
+
/** @type {!Array<!shaka.extern.xml.Node>} */
|
|
296
296
|
const segmentLists = [
|
|
297
297
|
context.representation.segmentList,
|
|
298
298
|
context.adaptationSet.segmentList,
|
|
@@ -347,8 +347,8 @@ shaka.dash.SegmentList.MediaSegment;
|
|
|
347
347
|
* startTime: number,
|
|
348
348
|
* startNumber: number,
|
|
349
349
|
* scaledPresentationTimeOffset: number,
|
|
350
|
-
* timeline: Array
|
|
351
|
-
* mediaSegments: !Array
|
|
350
|
+
* timeline: Array<shaka.media.PresentationTimeline.TimeRange>,
|
|
351
|
+
* mediaSegments: !Array<shaka.dash.SegmentList.MediaSegment>
|
|
352
352
|
* }}
|
|
353
353
|
* @private
|
|
354
354
|
*
|
|
@@ -363,9 +363,9 @@ shaka.dash.SegmentList.MediaSegment;
|
|
|
363
363
|
* The start number of the segments; 1 or greater.
|
|
364
364
|
* @property {number} scaledPresentationTimeOffset
|
|
365
365
|
* The scaledPresentationTimeOffset of the representation, in seconds.
|
|
366
|
-
* @property {Array
|
|
366
|
+
* @property {Array<shaka.media.PresentationTimeline.TimeRange>} timeline
|
|
367
367
|
* The timeline of the representation, if given. Times in seconds.
|
|
368
|
-
* @property {!Array
|
|
368
|
+
* @property {!Array<shaka.dash.SegmentList.MediaSegment>} mediaSegments
|
|
369
369
|
* The URI and byte-ranges of the media segments.
|
|
370
370
|
*/
|
|
371
371
|
shaka.dash.SegmentList.SegmentListInfo;
|
|
@@ -33,11 +33,11 @@ shaka.dash.SegmentTemplate = class {
|
|
|
33
33
|
*
|
|
34
34
|
* @param {shaka.dash.DashParser.Context} context
|
|
35
35
|
* @param {shaka.dash.DashParser.RequestSegmentCallback} requestSegment
|
|
36
|
-
* @param {!Object
|
|
36
|
+
* @param {!Object<string, !shaka.extern.Stream>} streamMap
|
|
37
37
|
* @param {boolean} isUpdate True if the manifest is being updated.
|
|
38
38
|
* @param {number} segmentLimit The maximum number of segments to generate for
|
|
39
39
|
* a SegmentTemplate with fixed duration.
|
|
40
|
-
* @param {!Object
|
|
40
|
+
* @param {!Object<string, number>} periodDurationMap
|
|
41
41
|
* @param {shaka.extern.aesKey|undefined} aesKey
|
|
42
42
|
* @param {?number} lastSegmentNumber
|
|
43
43
|
* @param {boolean} isPatchUpdate
|
|
@@ -302,7 +302,7 @@ shaka.dash.SegmentTemplate = class {
|
|
|
302
302
|
shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);
|
|
303
303
|
} else if (n != 1) {
|
|
304
304
|
shaka.log.warning(
|
|
305
|
-
'SegmentTemplate
|
|
305
|
+
'SegmentTemplate contains multiple segment information sources:',
|
|
306
306
|
'the SegmentTemplate should only contain an index URL template,',
|
|
307
307
|
'a SegmentTimeline or a segment duration.',
|
|
308
308
|
context.representation);
|
|
@@ -338,7 +338,7 @@ shaka.dash.SegmentTemplate = class {
|
|
|
338
338
|
* @param {shaka.dash.DashParser.RequestSegmentCallback} requestSegment
|
|
339
339
|
* @param {shaka.media.InitSegmentReference} init
|
|
340
340
|
* @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info
|
|
341
|
-
* @return {!Promise
|
|
341
|
+
* @return {!Promise<shaka.media.SegmentIndex>}
|
|
342
342
|
* @private
|
|
343
343
|
*/
|
|
344
344
|
static generateSegmentIndexFromIndexTemplate_(
|
|
@@ -366,11 +366,11 @@ shaka.dash.SegmentTemplate = class {
|
|
|
366
366
|
* @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info
|
|
367
367
|
* @param {number} segmentLimit The maximum number of segments to generate.
|
|
368
368
|
* @param {shaka.media.InitSegmentReference} initSegmentReference
|
|
369
|
-
* @param {!Object
|
|
369
|
+
* @param {!Object<string, number>} periodDurationMap
|
|
370
370
|
* @param {shaka.extern.aesKey|undefined} aesKey
|
|
371
371
|
* @param {?number} lastSegmentNumber
|
|
372
372
|
* @param {number} segmentSequenceCadence
|
|
373
|
-
* @return {!Promise
|
|
373
|
+
* @return {!Promise<shaka.media.SegmentIndex>}
|
|
374
374
|
* @private
|
|
375
375
|
*/
|
|
376
376
|
static generateSegmentIndexFromDuration_(
|
|
@@ -682,7 +682,7 @@ shaka.dash.SegmentTemplate = class {
|
|
|
682
682
|
const getBaseUris = context.representation.getBaseUris;
|
|
683
683
|
const urlParams = context.urlParams;
|
|
684
684
|
const getUris = () => {
|
|
685
|
-
goog.asserts.assert(initialization, 'Should have returned
|
|
685
|
+
goog.asserts.assert(initialization, 'Should have returned earlier');
|
|
686
686
|
const filledTemplate = MpdUtils.fillUriTemplate(
|
|
687
687
|
initialization, repId, null, null, bandwidth, null);
|
|
688
688
|
const resolvedUris = ManifestParserUtils.resolveUris(
|
|
@@ -711,7 +711,7 @@ shaka.dash.SegmentTemplate = class {
|
|
|
711
711
|
*
|
|
712
712
|
* @extends shaka.media.SegmentIndex
|
|
713
713
|
* @implements {shaka.util.IReleasable}
|
|
714
|
-
* @implements {Iterable
|
|
714
|
+
* @implements {Iterable<!shaka.media.SegmentReference>}
|
|
715
715
|
*
|
|
716
716
|
* @private
|
|
717
717
|
*
|
|
@@ -722,14 +722,14 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
|
|
|
722
722
|
* @param {!shaka.dash.SegmentTemplate.SegmentTemplateInfo} templateInfo
|
|
723
723
|
* @param {?string} representationId
|
|
724
724
|
* @param {number} bandwidth
|
|
725
|
-
* @param {function():Array
|
|
725
|
+
* @param {function(): Array<string>} getBaseUris
|
|
726
726
|
* @param {function():string} urlParams
|
|
727
727
|
* @param {number} periodStart
|
|
728
728
|
* @param {number} periodEnd
|
|
729
729
|
* @param {shaka.media.InitSegmentReference} initSegmentReference
|
|
730
730
|
* @param {shaka.extern.aesKey|undefined} aesKey
|
|
731
731
|
* @param {number} segmentSequenceCadence
|
|
732
|
-
|
|
732
|
+
*/
|
|
733
733
|
constructor(templateInfo, representationId, bandwidth, getBaseUris,
|
|
734
734
|
urlParams, periodStart, periodEnd, initSegmentReference,
|
|
735
735
|
aesKey, segmentSequenceCadence) {
|
|
@@ -744,7 +744,7 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
|
|
|
744
744
|
/** @private {number} */
|
|
745
745
|
this.bandwidth_ = bandwidth;
|
|
746
746
|
|
|
747
|
-
/** @private {function():Array
|
|
747
|
+
/** @private {function(): Array<string>} */
|
|
748
748
|
this.getBaseUris_ = getBaseUris;
|
|
749
749
|
|
|
750
750
|
/** @private {function():string} */
|
|
@@ -1148,7 +1148,7 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
|
|
|
1148
1148
|
/**
|
|
1149
1149
|
* Fill in a specific template with values to get the segment uris
|
|
1150
1150
|
*
|
|
1151
|
-
* @return {!Array
|
|
1151
|
+
* @return {!Array<string>}
|
|
1152
1152
|
* @private
|
|
1153
1153
|
*/
|
|
1154
1154
|
static createUris_(mediaTemplate, repId, segmentReplacement,
|
|
@@ -1172,7 +1172,7 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
|
|
|
1172
1172
|
* startNumber: number,
|
|
1173
1173
|
* scaledPresentationTimeOffset: number,
|
|
1174
1174
|
* unscaledPresentationTimeOffset: number,
|
|
1175
|
-
* timeline: Array
|
|
1175
|
+
* timeline: Array<shaka.media.PresentationTimeline.TimeRange>,
|
|
1176
1176
|
* mediaTemplate: ?string,
|
|
1177
1177
|
* indexTemplate: ?string,
|
|
1178
1178
|
* mimeType: string,
|
|
@@ -1196,7 +1196,7 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
|
|
|
1196
1196
|
* The presentation time offset of the representation, in seconds.
|
|
1197
1197
|
* @property {number} unscaledPresentationTimeOffset
|
|
1198
1198
|
* The presentation time offset of the representation, in timescale units.
|
|
1199
|
-
* @property {Array
|
|
1199
|
+
* @property {Array<shaka.media.PresentationTimeline.TimeRange>} timeline
|
|
1200
1200
|
* The timeline of the representation, if given. Times in seconds.
|
|
1201
1201
|
* @property {?string} mediaTemplate
|
|
1202
1202
|
* The media URI template, if given.
|
package/lib/debug/log.js
CHANGED
|
@@ -129,13 +129,13 @@ shaka.log.MAX_LOG_LEVEL = 3;
|
|
|
129
129
|
/**
|
|
130
130
|
* A Set to indicate which one-time warnings have been issued.
|
|
131
131
|
*
|
|
132
|
-
* @private {!Set
|
|
132
|
+
* @private {!Set<string>}
|
|
133
133
|
*/
|
|
134
134
|
shaka.log.oneTimeWarningIssued_ = new Set();
|
|
135
135
|
|
|
136
136
|
|
|
137
137
|
if (window.console) {
|
|
138
|
-
/** @private {!Object
|
|
138
|
+
/** @private {!Object<shaka.log.Level, function(...*)>} */
|
|
139
139
|
shaka.log.logMap_ = {
|
|
140
140
|
[shaka.log.Level.ERROR]: (...args) => console.error(...args),
|
|
141
141
|
[shaka.log.Level.WARNING]: (...args) => console.warn(...args),
|
package/lib/dependencies/all.js
CHANGED
|
@@ -60,11 +60,12 @@ shaka.dependencies.Allowed = {
|
|
|
60
60
|
ISOBoxer: 'ISOBoxer',
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
+
// eslint-disable-next-line jsdoc/require-returns
|
|
63
64
|
/**
|
|
64
65
|
* Contains accessor functions to shared dependencies that could be used by
|
|
65
66
|
* other components. The default accessors can be overridden.
|
|
66
67
|
*
|
|
67
|
-
* @private {!Map
|
|
68
|
+
* @private {!Map<shaka.dependencies.Allowed, function(): ?>}
|
|
68
69
|
*/
|
|
69
70
|
shaka.dependencies.dependencies_ = new Map([
|
|
70
71
|
[shaka.dependencies.Allowed.ISOBoxer, () => window.ISOBoxer],
|