shaka-player 4.5.0 → 4.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
- package/AUTHORS +2 -0
- package/CHANGELOG.md +109 -0
- package/CODE_OF_CONDUCT.md +1 -1
- package/CONTRIBUTORS +2 -0
- package/README.md +38 -32
- package/demo/common/asset.js +11 -17
- package/demo/common/assets.js +117 -11
- package/demo/config.js +28 -1
- package/demo/custom.js +52 -38
- package/demo/main.js +11 -3
- package/demo/search.js +7 -0
- package/dist/controls.css +1 -1
- package/dist/controls.css.map +1 -1
- package/dist/demo.compiled.debug.js +133 -124
- package/dist/demo.compiled.debug.map +3 -3
- package/dist/demo.compiled.js +133 -124
- package/dist/demo.compiled.map +3 -3
- package/dist/deps.js +20 -18
- package/dist/locales.js +34 -30
- package/dist/receiver.compiled.debug.js +58 -50
- package/dist/receiver.compiled.debug.map +3 -3
- package/dist/receiver.compiled.js +58 -50
- package/dist/receiver.compiled.map +3 -3
- package/dist/shaka-player.compiled.d.ts +440 -390
- package/dist/shaka-player.compiled.debug.d.ts +440 -390
- package/dist/shaka-player.compiled.debug.externs.js +162 -77
- package/dist/shaka-player.compiled.debug.js +789 -738
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +162 -77
- package/dist/shaka-player.compiled.js +1147 -1113
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +491 -437
- package/dist/shaka-player.ui.debug.d.ts +491 -437
- package/dist/shaka-player.ui.debug.externs.js +167 -77
- package/dist/shaka-player.ui.debug.js +857 -791
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +167 -77
- package/dist/shaka-player.ui.js +1359 -1314
- package/dist/shaka-player.ui.map +4 -4
- package/docs/tutorials/ad_monetization.md +54 -0
- package/docs/tutorials/basic-usage.md +2 -1
- package/docs/tutorials/errors.md +2 -1
- package/docs/tutorials/offline.md +10 -8
- package/docs/tutorials/plugins.md +5 -0
- package/docs/tutorials/ui-customization.md +13 -0
- package/docs/tutorials/ui.md +2 -1
- package/docs/tutorials/upgrade.md +3 -0
- package/externs/managedmediasource.js +24 -0
- package/externs/shaka/abr_manager.js +6 -2
- package/externs/shaka/cea.js +7 -0
- package/externs/shaka/codecs.js +5 -3
- package/externs/shaka/manifest.js +21 -5
- package/externs/shaka/manifest_parser.js +17 -0
- package/externs/shaka/net.js +2 -2
- package/externs/shaka/offline.js +9 -2
- package/externs/shaka/player.js +53 -7
- package/externs/shaka/text.js +3 -1
- package/externs/shaka/transmuxer.js +1 -1
- package/lib/abr/simple_abr_manager.js +25 -8
- package/lib/ads/media_tailor_ad_manager.js +14 -3
- package/lib/cast/cast_receiver.js +1 -1
- package/lib/cea/cea_decoder.js +28 -0
- package/lib/cea/dummy_caption_decoder.js +5 -0
- package/lib/dash/dash_parser.js +251 -84
- package/lib/dash/mpd_utils.js +52 -31
- package/lib/dash/segment_base.js +4 -5
- package/lib/dash/segment_list.js +5 -4
- package/lib/dash/segment_template.js +92 -29
- package/lib/hls/hls_classes.js +28 -43
- package/lib/hls/hls_parser.js +770 -652
- package/lib/hls/hls_utils.js +64 -5
- package/lib/hls/manifest_text_parser.js +7 -11
- package/lib/media/adaptation_set.js +20 -13
- package/lib/media/adaptation_set_criteria.js +70 -18
- package/lib/media/closed_caption_parser.js +13 -0
- package/lib/media/content_workarounds.js +6 -0
- package/lib/media/drm_engine.js +8 -13
- package/lib/media/manifest_parser.js +8 -113
- package/lib/media/media_source_capabilities.js +10 -3
- package/lib/media/media_source_engine.js +75 -21
- package/lib/media/play_rate_controller.js +8 -38
- package/lib/media/presentation_timeline.js +7 -1
- package/lib/media/quality_observer.js +1 -1
- package/lib/media/segment_index.js +5 -5
- package/lib/media/segment_prefetch.js +92 -24
- package/lib/media/segment_reference.js +67 -1
- package/lib/media/segment_utils.js +343 -0
- package/lib/media/stall_detector.js +0 -3
- package/lib/media/streaming_engine.js +72 -44
- package/lib/mss/mss_parser.js +18 -2
- package/lib/net/networking_engine.js +66 -12
- package/lib/net/networking_utils.js +95 -0
- package/lib/offline/indexeddb/v1_storage_cell.js +2 -0
- package/lib/offline/indexeddb/v2_storage_cell.js +2 -0
- package/lib/offline/manifest_converter.js +2 -0
- package/lib/offline/offline_manifest_parser.js +10 -0
- package/lib/offline/storage.js +11 -7
- package/lib/player.js +998 -1503
- package/lib/polyfill/mediasource.js +22 -1
- package/lib/text/mp4_ttml_parser.js +2 -2
- package/lib/text/srt_text_parser.js +2 -2
- package/lib/text/stub_text_displayer.js +51 -0
- package/lib/text/text_engine.js +3 -2
- package/lib/text/ttml_text_parser.js +28 -5
- package/lib/text/ui_text_displayer.js +4 -0
- package/lib/text/vtt_text_parser.js +7 -2
- package/lib/transmuxer/aac_transmuxer.js +1 -1
- package/lib/transmuxer/ac3_transmuxer.js +1 -1
- package/lib/transmuxer/ec3_transmuxer.js +1 -1
- package/lib/transmuxer/h264.js +5 -4
- package/lib/transmuxer/h265.js +5 -4
- package/lib/transmuxer/mp3_transmuxer.js +1 -1
- package/lib/transmuxer/mpeg_ts_transmuxer.js +1 -1
- package/lib/transmuxer/mss_transmuxer.js +1 -1
- package/lib/transmuxer/ts_transmuxer.js +33 -13
- package/lib/util/buffer_utils.js +26 -4
- package/lib/util/content_steering_manager.js +358 -0
- package/lib/util/error.js +2 -6
- package/lib/util/fairplay_utils.js +1 -1
- package/lib/util/fake_event.js +5 -1
- package/lib/util/id3_utils.js +50 -1
- package/lib/util/manifest_parser_utils.js +12 -8
- package/lib/util/mp4_generator.js +2 -4
- package/lib/util/mutex.js +59 -0
- package/lib/util/object_utils.js +1 -1
- package/lib/util/periods.js +154 -179
- package/lib/util/platform.js +4 -3
- package/lib/util/player_configuration.js +35 -6
- package/lib/util/stream_utils.js +105 -98
- package/lib/util/ts_parser.js +124 -73
- package/lib/util/uint8array_utils.js +5 -1
- package/lib/util/xml_utils.js +5 -0
- package/maintained-branches.md +2 -2
- package/package.json +1 -1
- package/roadmap.md +15 -5
- package/shaka-player.uncompiled.js +0 -1
- package/test/abr/simple_abr_manager_unit.js +33 -33
- package/test/ads/ad_manager_unit.js +3 -2
- package/test/cast/cast_receiver_integration.js +3 -4
- package/test/cast/cast_utils_unit.js +2 -0
- package/test/cea/cea_decoder_unit.js +7 -0
- package/test/codec_switching/codec_switching_integration.js +2 -1
- package/test/dash/dash_parser_integration.js +2 -1
- package/test/dash/dash_parser_live_unit.js +0 -19
- package/test/dash/dash_parser_manifest_unit.js +494 -2
- package/test/dash/mpd_utils_unit.js +61 -30
- package/test/hls/hls_live_unit.js +12 -3
- package/test/hls/hls_parser_unit.js +417 -27
- package/test/hls/manifest_text_parser_unit.js +32 -99
- package/test/media/adaptation_set_criteria_unit.js +172 -21
- package/test/media/adaptation_set_unit.js +1 -0
- package/test/media/content_workarounds_unit.js +1 -1
- package/test/media/drm_engine_unit.js +3 -3
- package/test/media/media_source_engine_unit.js +1 -1
- package/test/media/play_rate_controller_unit.js +0 -48
- package/test/media/segment_index_unit.js +2 -1
- package/test/mss/mss_player_integration.js +3 -2
- package/test/net/networking_engine_unit.js +3 -3
- package/test/{media/manifest_parser_unit.js → net/networking_utils_unit.js} +2 -2
- package/test/offline/manifest_convert_unit.js +9 -0
- package/test/offline/offline_integration.js +2 -1
- package/test/offline/storage_integration.js +21 -9
- package/test/player_external.js +4 -2
- package/test/player_integration.js +15 -4
- package/test/player_load_graph_integration.js +47 -151
- package/test/player_src_equals_external.js +1 -0
- package/test/player_src_equals_integration.js +71 -4
- package/test/player_unit.js +80 -27
- package/test/test/util/fake_media_source_engine.js +5 -0
- package/test/test/util/fake_networking_engine.js +9 -1
- package/test/test/util/fake_segment_prefetch.js +3 -0
- package/test/test/util/manifest_generator.js +4 -0
- package/test/test/util/manifest_parser_util.js +14 -2
- package/test/test/util/offline_utils.js +1 -0
- package/test/test/util/simple_fakes.js +2 -2
- package/test/test/util/streaming_engine_util.js +3 -0
- package/test/test/util/test_scheme.js +6 -0
- package/test/test/util/ui_utils.js +4 -3
- package/test/text/mp4_ttml_parser_unit.js +4 -4
- package/test/text/srt_text_parser_unit.js +1 -1
- package/test/text/text_displayer_layout_unit.js +1 -1
- package/test/text/text_engine_unit.js +6 -0
- package/test/text/ttml_text_parser_unit.js +33 -2
- package/test/transmuxer/transmuxer_engine_integration.js +9 -0
- package/test/transmuxer/transmuxer_integration.js +33 -3
- package/test/ui/ad_ui_unit.js +2 -2
- package/test/ui/ui_customization_unit.js +17 -16
- package/test/ui/ui_integration.js +30 -20
- package/test/ui/ui_unit.js +25 -19
- package/test/util/buffer_utils_unit.js +1 -1
- package/test/util/content_steering_manager_unit.js +427 -0
- package/test/util/id3_utils_unit.js +52 -0
- package/test/util/stream_utils_unit.js +17 -113
- package/test/util/ts_parser_unit.js +3 -3
- package/third_party/closure-uri/uri.js +13 -1
- package/ui/audio_language_selection.js +9 -2
- package/ui/externs/ui.js +17 -2
- package/ui/language_utils.js +43 -8
- package/ui/less/range_elements.less +33 -0
- package/ui/locales/en.json +1 -0
- package/ui/locales/es-419.json +1 -0
- package/ui/locales/es.json +1 -0
- package/ui/locales/source.json +4 -0
- package/ui/localization.js +10 -0
- package/ui/remote_button.js +3 -1
- package/ui/resolution_selection.js +47 -10
- package/ui/seek_bar.js +296 -3
- package/ui/text_selection.js +2 -1
- package/ui/ui.js +6 -2
- package/lib/routing/node.js +0 -23
- package/lib/routing/payload.js +0 -47
- package/lib/routing/walker.js +0 -587
- package/test/routing/walker_unit.js +0 -505
|
@@ -225,7 +225,6 @@ shaka.util.Error.Code = {
|
|
|
225
225
|
'TEXT_ONLY_WEBVTT_SRC_EQUALS': 2013,
|
|
226
226
|
'MISSING_TEXT_PLUGIN': 2014,
|
|
227
227
|
'CHAPTERS_TRACK_FAILED': 2015,
|
|
228
|
-
'CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_SRC_EQUALS': 2016,
|
|
229
228
|
'UNSUPPORTED_EXTERNAL_THUMBNAILS_URI': 2017,
|
|
230
229
|
'BUFFER_READ_OUT_OF_BOUNDS': 3000,
|
|
231
230
|
'JS_INTEGER_OVERFLOW': 3001,
|
|
@@ -548,6 +547,11 @@ shaka.ui.Localization = class extends shaka.util.FakeEventTarget {
|
|
|
548
547
|
* @return {string}
|
|
549
548
|
*/
|
|
550
549
|
resolve(id) {}
|
|
550
|
+
/**
|
|
551
|
+
* The locales currently used. An empty set means "no preference".
|
|
552
|
+
* @return {!Set.<string>}
|
|
553
|
+
*/
|
|
554
|
+
getCurrentLocales() {}
|
|
551
555
|
};
|
|
552
556
|
/**
|
|
553
557
|
* An enum for how the localization system should resolve conflicts between old
|
|
@@ -590,13 +594,6 @@ shaka.ui.Localization.LOCALE_CHANGED;
|
|
|
590
594
|
* @const {string}
|
|
591
595
|
*/
|
|
592
596
|
shaka.ui.Localization.LOCALE_UPDATED;
|
|
593
|
-
/**
|
|
594
|
-
* @enum {string}
|
|
595
|
-
*/
|
|
596
|
-
shaka.config.CodecSwitchingStrategy = {
|
|
597
|
-
RELOAD: 'reload',
|
|
598
|
-
SMOOTH: 'smooth'
|
|
599
|
-
};
|
|
600
597
|
/**
|
|
601
598
|
* @summary A set of BufferSource utility functions.
|
|
602
599
|
*/
|
|
@@ -630,6 +627,18 @@ shaka.util.BufferUtils = class {
|
|
|
630
627
|
* @return {!Uint8Array}
|
|
631
628
|
*/
|
|
632
629
|
static toUint8(data, offset, length) {}
|
|
630
|
+
/**
|
|
631
|
+
* Creates a new Uint16Array view on the same buffer. This clamps the values
|
|
632
|
+
* to be within the same view (i.e. you can't use this to move past the end
|
|
633
|
+
* of the view, even if the underlying buffer is larger). However, you can
|
|
634
|
+
* pass a negative offset to access the data before the view.
|
|
635
|
+
* @param {BufferSource} data
|
|
636
|
+
* @param {number=} offset The offset from the beginning of this data's view
|
|
637
|
+
* to start the new view at.
|
|
638
|
+
* @param {number=} length The byte length of the new view.
|
|
639
|
+
* @return {!Uint16Array}
|
|
640
|
+
*/
|
|
641
|
+
static toUint16(data, offset, length) {}
|
|
633
642
|
/**
|
|
634
643
|
* Creates a DataView over the given buffer.
|
|
635
644
|
* @see toUint8
|
|
@@ -1312,9 +1321,11 @@ shaka.abr.SimpleAbrManager = class {
|
|
|
1312
1321
|
*/
|
|
1313
1322
|
init(switchCallback) {}
|
|
1314
1323
|
/**
|
|
1324
|
+
* @param {boolean=} preferFastSwitching
|
|
1325
|
+
* @return {shaka.extern.Variant}
|
|
1315
1326
|
* @override
|
|
1316
1327
|
*/
|
|
1317
|
-
chooseVariant() {}
|
|
1328
|
+
chooseVariant(preferFastSwitching) {}
|
|
1318
1329
|
/**
|
|
1319
1330
|
* @override
|
|
1320
1331
|
*/
|
|
@@ -1326,7 +1337,7 @@ shaka.abr.SimpleAbrManager = class {
|
|
|
1326
1337
|
/**
|
|
1327
1338
|
* @override
|
|
1328
1339
|
*/
|
|
1329
|
-
segmentDownloaded(deltaTimeMs, numBytes) {}
|
|
1340
|
+
segmentDownloaded(deltaTimeMs, numBytes, allowSwitch) {}
|
|
1330
1341
|
/**
|
|
1331
1342
|
* @override
|
|
1332
1343
|
*/
|
|
@@ -1357,6 +1368,13 @@ shaka.config.AutoShowText = {
|
|
|
1357
1368
|
'IF_PREFERRED_TEXT_LANGUAGE': 2,
|
|
1358
1369
|
'IF_SUBTITLES_MAY_BE_NEEDED': 3
|
|
1359
1370
|
};
|
|
1371
|
+
/**
|
|
1372
|
+
* @enum {string}
|
|
1373
|
+
*/
|
|
1374
|
+
shaka.config.CodecSwitchingStrategy = {
|
|
1375
|
+
RELOAD: 'reload',
|
|
1376
|
+
SMOOTH: 'smooth'
|
|
1377
|
+
};
|
|
1360
1378
|
/**
|
|
1361
1379
|
* A utility to wrap abortable operations. Note that these are not cancelable.
|
|
1362
1380
|
* Cancelation implies undoing what has been done so far, whereas aborting only
|
|
@@ -1451,17 +1469,20 @@ shaka.util.AbortableOperation.prototype.promise;
|
|
|
1451
1469
|
*/
|
|
1452
1470
|
shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
|
|
1453
1471
|
/**
|
|
1454
|
-
* @param {function(number, number)=} onProgressUpdated Called when
|
|
1455
|
-
* event is triggered. Passed the duration, in milliseconds,
|
|
1456
|
-
* request took,
|
|
1472
|
+
* @param {function(number, number, boolean)=} onProgressUpdated Called when
|
|
1473
|
+
* a progress event is triggered. Passed the duration, in milliseconds,
|
|
1474
|
+
* that the request took, the number of bytes transferred, and the boolean
|
|
1475
|
+
* of whether the switching is allowed.
|
|
1457
1476
|
* @param {shaka.net.NetworkingEngine.OnHeadersReceived=} onHeadersReceived
|
|
1458
1477
|
* Called when the headers are received for a download.
|
|
1459
1478
|
* @param {shaka.net.NetworkingEngine.OnDownloadFailed=} onDownloadFailed
|
|
1460
1479
|
* Called when a download fails, for any reason.
|
|
1461
1480
|
* @param {shaka.net.NetworkingEngine.OnRequest=} onRequest
|
|
1462
1481
|
* Called when a request is made
|
|
1482
|
+
* @param {shaka.net.NetworkingEngine.OnRetry=} onRetry
|
|
1483
|
+
* Called when a request retry is made
|
|
1463
1484
|
*/
|
|
1464
|
-
constructor(onProgressUpdated, onHeadersReceived, onDownloadFailed, onRequest) {}
|
|
1485
|
+
constructor(onProgressUpdated, onHeadersReceived, onDownloadFailed, onRequest, onRetry) {}
|
|
1465
1486
|
/**
|
|
1466
1487
|
* @param {boolean} forceHTTPS
|
|
1467
1488
|
*/
|
|
@@ -1590,7 +1611,8 @@ shaka.net.NetworkingEngine.RequestType = {
|
|
|
1590
1611
|
'TIMING': 4,
|
|
1591
1612
|
'SERVER_CERTIFICATE': 5,
|
|
1592
1613
|
'KEY': 6,
|
|
1593
|
-
'ADS': 7
|
|
1614
|
+
'ADS': 7,
|
|
1615
|
+
'CONTENT_STEERING': 8
|
|
1594
1616
|
};
|
|
1595
1617
|
/**
|
|
1596
1618
|
* A more advanced form of the RequestType structure, meant to describe
|
|
@@ -1649,6 +1671,17 @@ shaka.net.NetworkingEngine.OnDownloadFailed;
|
|
|
1649
1671
|
* A callback function called on every request
|
|
1650
1672
|
*/
|
|
1651
1673
|
shaka.net.NetworkingEngine.OnRequest;
|
|
1674
|
+
/**
|
|
1675
|
+
* @typedef {function(
|
|
1676
|
+
* !shaka.net.NetworkingEngine.RequestType,
|
|
1677
|
+
* (shaka.extern.RequestContext|undefined),
|
|
1678
|
+
* string,
|
|
1679
|
+
* string)}
|
|
1680
|
+
* @description
|
|
1681
|
+
* A callback function called on every request retry. The first string is the
|
|
1682
|
+
* new URI and the second string is the old URI.
|
|
1683
|
+
*/
|
|
1684
|
+
shaka.net.NetworkingEngine.OnRetry;
|
|
1652
1685
|
/**
|
|
1653
1686
|
* @summary
|
|
1654
1687
|
* An EventManager maintains a collection of "event
|
|
@@ -2100,8 +2133,10 @@ shaka.media.SegmentReference = class {
|
|
|
2100
2133
|
* not available.
|
|
2101
2134
|
* @param {?shaka.extern.aes128Key=} aes128Key
|
|
2102
2135
|
* The segment's AES-128-CBC full segment encryption key and iv.
|
|
2136
|
+
* @param {boolean=} allPartialSegments
|
|
2137
|
+
* Indicate if the segment has all partial segments
|
|
2103
2138
|
*/
|
|
2104
|
-
constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration, syncTime, status, aes128Key) {}
|
|
2139
|
+
constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration, syncTime, status, aes128Key, allPartialSegments) {}
|
|
2105
2140
|
/**
|
|
2106
2141
|
* Creates and returns the URIs of the resource containing the segment.
|
|
2107
2142
|
* @return {!Array.<string>}
|
|
@@ -2168,6 +2203,24 @@ shaka.media.SegmentReference = class {
|
|
|
2168
2203
|
* @return {boolean}
|
|
2169
2204
|
*/
|
|
2170
2205
|
isIndependent() {}
|
|
2206
|
+
/**
|
|
2207
|
+
* Mark the reference as partial.
|
|
2208
|
+
*/
|
|
2209
|
+
markAsPartial() {}
|
|
2210
|
+
/**
|
|
2211
|
+
* Returns true if the segment is partial.
|
|
2212
|
+
* @return {boolean}
|
|
2213
|
+
*/
|
|
2214
|
+
isPartial() {}
|
|
2215
|
+
/**
|
|
2216
|
+
* Mark the reference as being the last part of the full segment
|
|
2217
|
+
*/
|
|
2218
|
+
markAsLastPartial() {}
|
|
2219
|
+
/**
|
|
2220
|
+
* Returns true if reference as being the last part of the full segment.
|
|
2221
|
+
* @return {boolean}
|
|
2222
|
+
*/
|
|
2223
|
+
isLastPartial() {}
|
|
2171
2224
|
/**
|
|
2172
2225
|
* Mark the reference as byterange optimization.
|
|
2173
2226
|
* The "byterange optimization" means that it is playable using MP4 low
|
|
@@ -2291,11 +2344,10 @@ shaka.util.TsParser = class {
|
|
|
2291
2344
|
* The code is based on hls.js
|
|
2292
2345
|
* Credit to https://github.com/video-dev/hls.js/blob/master/src/demux/tsdemuxer.ts
|
|
2293
2346
|
* @param {shaka.extern.MPEG_PES} pes
|
|
2294
|
-
* @param {?shaka.extern.MPEG_PES=} nextPes
|
|
2295
2347
|
* @param {?shaka.extern.VideoNalu=} lastNalu
|
|
2296
2348
|
* @return {!Array.<shaka.extern.VideoNalu>}
|
|
2297
2349
|
*/
|
|
2298
|
-
parseNalus(pes,
|
|
2350
|
+
parseNalus(pes, lastNalu) {}
|
|
2299
2351
|
/**
|
|
2300
2352
|
* Return the ID3 metadata
|
|
2301
2353
|
* @return {!Array.<shaka.extern.ID3Metadata>}
|
|
@@ -2308,14 +2360,16 @@ shaka.util.TsParser = class {
|
|
|
2308
2360
|
getAudioData() {}
|
|
2309
2361
|
/**
|
|
2310
2362
|
* Return the audio data
|
|
2363
|
+
* @param {boolean=} naluProcessing
|
|
2311
2364
|
* @return {!Array.<shaka.extern.MPEG_PES>}
|
|
2312
2365
|
*/
|
|
2313
|
-
getVideoData() {}
|
|
2366
|
+
getVideoData(naluProcessing) {}
|
|
2314
2367
|
/**
|
|
2315
2368
|
* Return the start time for the audio and video
|
|
2316
|
-
* @
|
|
2369
|
+
* @param {string} contentType
|
|
2370
|
+
* @return {?number}
|
|
2317
2371
|
*/
|
|
2318
|
-
getStartTime() {}
|
|
2372
|
+
getStartTime(contentType) {}
|
|
2319
2373
|
/**
|
|
2320
2374
|
* Return the audio and video codecs
|
|
2321
2375
|
* @return {{audio: ?string, video: ?string}}
|
|
@@ -2567,7 +2621,9 @@ shaka.media.PresentationTimeline = class {
|
|
|
2567
2621
|
* @typedef {{
|
|
2568
2622
|
* start: number,
|
|
2569
2623
|
* unscaledStart: number,
|
|
2570
|
-
* end: number
|
|
2624
|
+
* end: number,
|
|
2625
|
+
* partialSegments: number,
|
|
2626
|
+
* segmentPosition: number
|
|
2571
2627
|
* }}
|
|
2572
2628
|
* @description
|
|
2573
2629
|
* Defines a time range of a media segment. Times are in seconds.
|
|
@@ -2577,6 +2633,10 @@ shaka.media.PresentationTimeline = class {
|
|
|
2577
2633
|
* The start time of the range in representation timescale units.
|
|
2578
2634
|
* @property {number} end
|
|
2579
2635
|
* The end time (exclusive) of the range.
|
|
2636
|
+
* @property {number} partialSegments
|
|
2637
|
+
* The number of partial segments
|
|
2638
|
+
* @property {number} segmentPosition
|
|
2639
|
+
* The segment position of the timeline entry as it appears in the manifest
|
|
2580
2640
|
*/
|
|
2581
2641
|
shaka.media.PresentationTimeline.TimeRange;
|
|
2582
2642
|
/**
|
|
@@ -2796,6 +2856,32 @@ shaka.text.SimpleTextDisplayer = class {
|
|
|
2796
2856
|
*/
|
|
2797
2857
|
setTextVisibility(on) {}
|
|
2798
2858
|
};
|
|
2859
|
+
/**
|
|
2860
|
+
* A stub text displayer plugin that does nothing
|
|
2861
|
+
* @implements {shaka.extern.TextDisplayer}
|
|
2862
|
+
*/
|
|
2863
|
+
shaka.text.StubTextDisplayer = class {
|
|
2864
|
+
/**
|
|
2865
|
+
* @override
|
|
2866
|
+
*/
|
|
2867
|
+
remove(start, end) {}
|
|
2868
|
+
/**
|
|
2869
|
+
* @override
|
|
2870
|
+
*/
|
|
2871
|
+
append(cues) {}
|
|
2872
|
+
/**
|
|
2873
|
+
* @override
|
|
2874
|
+
*/
|
|
2875
|
+
destroy() {}
|
|
2876
|
+
/**
|
|
2877
|
+
* @override
|
|
2878
|
+
*/
|
|
2879
|
+
isTextVisible() {}
|
|
2880
|
+
/**
|
|
2881
|
+
* @override
|
|
2882
|
+
*/
|
|
2883
|
+
setTextVisibility(on) {}
|
|
2884
|
+
};
|
|
2799
2885
|
/** */
|
|
2800
2886
|
shaka.util.Dom = class {
|
|
2801
2887
|
/**
|
|
@@ -3043,16 +3129,9 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
3043
3129
|
*/
|
|
3044
3130
|
static probeSupport(promptsOkay) {}
|
|
3045
3131
|
/**
|
|
3046
|
-
*
|
|
3047
|
-
*
|
|
3048
|
-
*
|
|
3049
|
-
* Calling <code>attach</code> with <code>initializedMediaSource=true</code>
|
|
3050
|
-
* will tell the player to take the initial load step and initialize media
|
|
3051
|
-
* source.
|
|
3052
|
-
* <p>
|
|
3053
|
-
* Calls to <code>attach</code> will interrupt any in-progress calls to
|
|
3054
|
-
* <code>load</code> but cannot interrupt calls to <code>attach</code>,
|
|
3055
|
-
* <code>detach</code>, or <code>unload</code>.
|
|
3132
|
+
* Attaches the player to a media element.
|
|
3133
|
+
* If the player was already attached to a media element, first detaches from
|
|
3134
|
+
* that media element.
|
|
3056
3135
|
* @param {!HTMLMediaElement} mediaElement
|
|
3057
3136
|
* @param {boolean=} initializeMediaSource
|
|
3058
3137
|
* @return {!Promise}
|
|
@@ -3065,35 +3144,15 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
3065
3144
|
*/
|
|
3066
3145
|
attachCanvas(canvas) {}
|
|
3067
3146
|
/**
|
|
3068
|
-
*
|
|
3069
|
-
*
|
|
3070
|
-
*
|
|
3071
|
-
*
|
|
3072
|
-
* <li>loading, this will abort loading, unload, and release the media
|
|
3073
|
-
* element,
|
|
3074
|
-
* <li>playing content, this will stop playback, unload, and release the
|
|
3075
|
-
* media element.
|
|
3076
|
-
* </ul>
|
|
3077
|
-
* <p>
|
|
3078
|
-
* Calls to <code>detach</code> will interrupt any in-progress calls to
|
|
3079
|
-
* <code>load</code> but cannot interrupt calls to <code>attach</code>,
|
|
3080
|
-
* <code>detach</code>, or <code>unload</code>.
|
|
3147
|
+
* Detach the player from the current media element. Leaves the player in a
|
|
3148
|
+
* state where it cannot play media, until it has been attached to something
|
|
3149
|
+
* else.
|
|
3150
|
+
* @param {boolean=} keepAdManager
|
|
3081
3151
|
* @return {!Promise}
|
|
3082
3152
|
*/
|
|
3083
|
-
detach() {}
|
|
3153
|
+
detach(keepAdManager) {}
|
|
3084
3154
|
/**
|
|
3085
|
-
*
|
|
3086
|
-
* <ul>
|
|
3087
|
-
* <li>detached (when it does not have a media element),
|
|
3088
|
-
* <li>attached (when it has a media element and
|
|
3089
|
-
* <code>initializedMediaSource=false</code>)
|
|
3090
|
-
* <li>media source initialized (when it has a media element and
|
|
3091
|
-
* <code>initializedMediaSource=true</code>)
|
|
3092
|
-
* </ul>
|
|
3093
|
-
* <p>
|
|
3094
|
-
* Calls to <code>unload</code> will interrupt any in-progress calls to
|
|
3095
|
-
* <code>load</code> but cannot interrupt calls to <code>attach</code>,
|
|
3096
|
-
* <code>detach</code>, or <code>unload</code>.
|
|
3155
|
+
* Unloads the currently playing stream, if any.
|
|
3097
3156
|
* @param {boolean=} initializeMediaSource
|
|
3098
3157
|
* @param {boolean=} keepAdManager
|
|
3099
3158
|
* @return {!Promise}
|
|
@@ -3108,22 +3167,21 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
3108
3167
|
*/
|
|
3109
3168
|
updateStartTime(startTime) {}
|
|
3110
3169
|
/**
|
|
3111
|
-
*
|
|
3112
|
-
*
|
|
3113
|
-
* a call to <code>attach</code> must have succeeded.
|
|
3114
|
-
* <p>
|
|
3115
|
-
* Calls to <code>load</code> will interrupt any in-progress calls to
|
|
3116
|
-
* <code>load</code> but cannot interrupt calls to <code>attach</code>,
|
|
3117
|
-
* <code>detach</code>, or <code>unload</code>.
|
|
3170
|
+
* Loads a new stream.
|
|
3171
|
+
* If another stream was already playing, first unloads that stream.
|
|
3118
3172
|
* @param {string} assetUri
|
|
3119
3173
|
* @param {?number=} startTime
|
|
3120
3174
|
* When <code>startTime</code> is <code>null</code> or
|
|
3121
3175
|
* <code>undefined</code>, playback will start at the default start time (0
|
|
3122
3176
|
* for VOD and liveEdge for LIVE).
|
|
3123
|
-
* @param {string=} mimeType
|
|
3177
|
+
* @param {?string=} mimeType
|
|
3124
3178
|
* @return {!Promise}
|
|
3125
3179
|
*/
|
|
3126
3180
|
load(assetUri, startTime, mimeType) {}
|
|
3181
|
+
/**
|
|
3182
|
+
* Releases all of the mutexes of the player. Meant for use by the tests.
|
|
3183
|
+
*/
|
|
3184
|
+
releaseAllMutexes() {}
|
|
3127
3185
|
/**
|
|
3128
3186
|
* Changes configuration settings on the Player. This checks the names of
|
|
3129
3187
|
* keys and the types of values to avoid coding errors. If there are errors,
|
|
@@ -3222,7 +3280,8 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
3222
3280
|
isAudioOnly() {}
|
|
3223
3281
|
/**
|
|
3224
3282
|
* Get the range of time (in seconds) that seeking is allowed. If the player
|
|
3225
|
-
* has not loaded content, this will return a range
|
|
3283
|
+
* has not loaded content and the manifest is HLS, this will return a range
|
|
3284
|
+
* from 0 to 0.
|
|
3226
3285
|
* @return {{start: number, end: number}}
|
|
3227
3286
|
*/
|
|
3228
3287
|
seekRange() {}
|
|
@@ -3320,6 +3379,13 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
3320
3379
|
* @return {!Array.<shaka.extern.Track>}
|
|
3321
3380
|
*/
|
|
3322
3381
|
getImageTracks() {}
|
|
3382
|
+
/**
|
|
3383
|
+
* Returns Thumbnail objects for each thumbnail for a given image track ID.
|
|
3384
|
+
* If the player has not loaded content, this will return a null.
|
|
3385
|
+
* @param {number} trackId
|
|
3386
|
+
* @return {!Promise.<?Array<!shaka.extern.Thumbnail>>}
|
|
3387
|
+
*/
|
|
3388
|
+
getAllThumbnails(trackId) {}
|
|
3323
3389
|
/**
|
|
3324
3390
|
* Return a Thumbnail object from a image track Id and time.
|
|
3325
3391
|
* If the player has not loaded content, this will return a null.
|
|
@@ -4444,6 +4510,14 @@ shaka.dash.DashParser = class {
|
|
|
4444
4510
|
* @override
|
|
4445
4511
|
*/
|
|
4446
4512
|
onExpirationUpdated(sessionId, expiration) {}
|
|
4513
|
+
/**
|
|
4514
|
+
* @override
|
|
4515
|
+
*/
|
|
4516
|
+
onInitialVariantChosen(variant) {}
|
|
4517
|
+
/**
|
|
4518
|
+
* @override
|
|
4519
|
+
*/
|
|
4520
|
+
banLocation(uri) {}
|
|
4447
4521
|
};
|
|
4448
4522
|
/**
|
|
4449
4523
|
*/
|
|
@@ -4513,6 +4587,14 @@ shaka.hls.HlsParser = class {
|
|
|
4513
4587
|
* @override
|
|
4514
4588
|
*/
|
|
4515
4589
|
onExpirationUpdated(sessionId, expiration) {}
|
|
4590
|
+
/**
|
|
4591
|
+
* @override
|
|
4592
|
+
*/
|
|
4593
|
+
onInitialVariantChosen(variant) {}
|
|
4594
|
+
/**
|
|
4595
|
+
* @override
|
|
4596
|
+
*/
|
|
4597
|
+
banLocation(uri) {}
|
|
4516
4598
|
};
|
|
4517
4599
|
/**
|
|
4518
4600
|
* Creates a new MSS parser.
|
|
@@ -4541,6 +4623,14 @@ shaka.mss.MssParser = class {
|
|
|
4541
4623
|
* @override
|
|
4542
4624
|
*/
|
|
4543
4625
|
onExpirationUpdated(sessionId, expiration) {}
|
|
4626
|
+
/**
|
|
4627
|
+
* @override
|
|
4628
|
+
*/
|
|
4629
|
+
onInitialVariantChosen(variant) {}
|
|
4630
|
+
/**
|
|
4631
|
+
* @override
|
|
4632
|
+
*/
|
|
4633
|
+
banLocation(uri) {}
|
|
4544
4634
|
};
|
|
4545
4635
|
/**
|
|
4546
4636
|
* @summary A networking plugin to handle http and https URIs via the Fetch API.
|
|
@@ -5013,7 +5103,7 @@ shaka.text.TtmlTextParser = class {
|
|
|
5013
5103
|
/**
|
|
5014
5104
|
* @override
|
|
5015
5105
|
*/
|
|
5016
|
-
parseMedia(data, time) {}
|
|
5106
|
+
parseMedia(data, time, uri) {}
|
|
5017
5107
|
};
|
|
5018
5108
|
/**
|
|
5019
5109
|
* @implements {shaka.extern.TextParser}
|
|
@@ -5036,7 +5126,7 @@ shaka.text.Mp4TtmlParser = class {
|
|
|
5036
5126
|
/**
|
|
5037
5127
|
* @override
|
|
5038
5128
|
*/
|
|
5039
|
-
parseMedia(data, time) {}
|
|
5129
|
+
parseMedia(data, time, uri) {}
|
|
5040
5130
|
};
|
|
5041
5131
|
/**
|
|
5042
5132
|
* @implements {shaka.extern.TextParser}
|
|
@@ -5126,7 +5216,7 @@ shaka.text.SrtTextParser = class {
|
|
|
5126
5216
|
/**
|
|
5127
5217
|
* @override
|
|
5128
5218
|
*/
|
|
5129
|
-
parseMedia(data, time) {}
|
|
5219
|
+
parseMedia(data, time, uri) {}
|
|
5130
5220
|
/**
|
|
5131
5221
|
* Convert a SRT format to WebVTT
|
|
5132
5222
|
* @param {string} data
|
|
@@ -5184,7 +5274,7 @@ shaka.transmuxer.AacTransmuxer = class {
|
|
|
5184
5274
|
/**
|
|
5185
5275
|
* @override
|
|
5186
5276
|
*/
|
|
5187
|
-
|
|
5277
|
+
getOriginalMimeType() {}
|
|
5188
5278
|
/**
|
|
5189
5279
|
* @override
|
|
5190
5280
|
*/
|
|
@@ -5217,7 +5307,7 @@ shaka.transmuxer.Ac3Transmuxer = class {
|
|
|
5217
5307
|
/**
|
|
5218
5308
|
* @override
|
|
5219
5309
|
*/
|
|
5220
|
-
|
|
5310
|
+
getOriginalMimeType() {}
|
|
5221
5311
|
/**
|
|
5222
5312
|
* @override
|
|
5223
5313
|
*/
|
|
@@ -5250,7 +5340,7 @@ shaka.transmuxer.Ec3Transmuxer = class {
|
|
|
5250
5340
|
/**
|
|
5251
5341
|
* @override
|
|
5252
5342
|
*/
|
|
5253
|
-
|
|
5343
|
+
getOriginalMimeType() {}
|
|
5254
5344
|
/**
|
|
5255
5345
|
* @override
|
|
5256
5346
|
*/
|
|
@@ -5283,7 +5373,7 @@ shaka.transmuxer.Mp3Transmuxer = class {
|
|
|
5283
5373
|
/**
|
|
5284
5374
|
* @override
|
|
5285
5375
|
*/
|
|
5286
|
-
|
|
5376
|
+
getOriginalMimeType() {}
|
|
5287
5377
|
/**
|
|
5288
5378
|
* @override
|
|
5289
5379
|
*/
|
|
@@ -5316,7 +5406,7 @@ shaka.transmuxer.MpegTsTransmuxer = class {
|
|
|
5316
5406
|
/**
|
|
5317
5407
|
* @override
|
|
5318
5408
|
*/
|
|
5319
|
-
|
|
5409
|
+
getOriginalMimeType() {}
|
|
5320
5410
|
/**
|
|
5321
5411
|
* @override
|
|
5322
5412
|
*/
|
|
@@ -5349,7 +5439,7 @@ shaka.transmuxer.MssTransmuxer = class {
|
|
|
5349
5439
|
/**
|
|
5350
5440
|
* @override
|
|
5351
5441
|
*/
|
|
5352
|
-
|
|
5442
|
+
getOriginalMimeType() {}
|
|
5353
5443
|
/**
|
|
5354
5444
|
* @override
|
|
5355
5445
|
*/
|
|
@@ -5382,7 +5472,7 @@ shaka.transmuxer.TsTransmuxer = class {
|
|
|
5382
5472
|
/**
|
|
5383
5473
|
* @override
|
|
5384
5474
|
*/
|
|
5385
|
-
|
|
5475
|
+
getOriginalMimeType() {}
|
|
5386
5476
|
/**
|
|
5387
5477
|
* @override
|
|
5388
5478
|
*/
|