shaka-player 2.5.1 → 2.5.5
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/.csslintrc +13 -0
- package/AUTHORS +3 -0
- package/CHANGELOG.md +156 -0
- package/CONTRIBUTORS +3 -0
- package/README.md +3 -0
- package/build/README.md +5 -5
- package/build/apps.py +3 -1
- package/build/build.py +5 -2
- package/build/check.py +17 -0
- package/build/compiler.py +49 -0
- package/build/conformance.textproto +1 -0
- package/build/docs.py +0 -6
- package/build/generateExterns.js +72 -20
- package/build/install-linux-prereqs.sh +4 -4
- package/build/shakaBuildHelpers.py +7 -8
- package/build/test.py +21 -9
- package/build/types/core +1 -0
- package/build/types/ui +6 -1
- package/demo/asset_card.js +129 -41
- package/demo/cast_receiver/receiver_app.css +27 -13
- package/demo/close_button.js +10 -15
- package/demo/common/asset.js +6 -6
- package/demo/common/assets.js +72 -14
- package/demo/config.js +28 -25
- package/demo/custom.js +20 -16
- package/demo/demo.less +107 -16
- package/demo/demo_uncompiled.js +33 -0
- package/demo/demo_utils.js +4 -3
- package/demo/front.js +12 -8
- package/demo/index.html +14 -17
- package/demo/input.js +30 -23
- package/demo/input_container.js +15 -11
- package/demo/load.js +5 -7
- package/demo/main.js +138 -49
- package/demo/search.js +40 -36
- package/demo/service_worker.js +1 -1
- package/demo/tooltip.js +16 -24
- package/dist/.csslintstamp +0 -0
- package/dist/controls.css +1 -1
- package/dist/controls.css.map +1 -1
- package/dist/demo.compiled.debug.js +165 -152
- package/dist/demo.compiled.debug.map +4 -4
- package/dist/demo.compiled.js +165 -152
- package/dist/demo.compiled.map +4 -4
- package/dist/demo.css +1 -1
- package/dist/demo.css.map +1 -1
- package/dist/deps.js +28 -11
- package/dist/receiver.compiled.debug.js +11 -11
- package/dist/receiver.compiled.debug.map +3 -3
- package/dist/receiver.compiled.js +11 -11
- package/dist/receiver.compiled.map +3 -3
- package/dist/shaka-player.compiled.debug.externs.js +232 -102
- package/dist/shaka-player.compiled.debug.js +189 -165
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +232 -102
- package/dist/shaka-player.compiled.js +567 -553
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.debug.externs.js +338 -113
- package/dist/shaka-player.ui.debug.js +296 -276
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +338 -113
- package/dist/shaka-player.ui.js +685 -671
- package/dist/shaka-player.ui.map +4 -4
- package/docs/tutorials/drm-config.md +1 -0
- package/docs/tutorials/fairplay.md +77 -0
- package/docs/tutorials/index.json +1 -0
- package/docs/tutorials/manifest-parser.md +1 -1
- package/docs/tutorials/ui-customization.md +5 -2
- package/docs/tutorials/ui.md +10 -4
- package/docs/tutorials/welcome.md +2 -2
- package/externs/mediasession.js +16 -1
- package/externs/shaka/net.js +14 -4
- package/externs/shaka/player.js +136 -90
- package/externs/tippy.js +30 -0
- package/externs/webkitmediakeys.js +4 -0
- package/karma.conf.js +30 -24
- package/lib/cast/cast_proxy.js +94 -23
- package/lib/cast/cast_receiver.js +8 -1
- package/lib/dash/content_protection.js +33 -1
- package/lib/dash/dash_parser.js +13 -5
- package/lib/hls/hls_parser.js +20 -4
- package/lib/media/drm_engine.js +29 -2
- package/lib/media/media_source_engine.js +9 -6
- package/lib/media/play_rate_controller.js +14 -3
- package/lib/media/playhead.js +8 -3
- package/lib/media/streaming_engine.js +68 -20
- package/lib/media/transmuxer.js +2 -2
- package/lib/media/video_wrapper.js +8 -3
- package/lib/net/data_uri_plugin.js +5 -2
- package/lib/net/http_fetch_plugin.js +3 -3
- package/lib/net/http_plugin_utils.js +2 -4
- package/lib/net/http_xhr_plugin.js +2 -2
- package/lib/net/networking_engine.js +1 -0
- package/lib/offline/offline_scheme.js +7 -2
- package/lib/player.js +18 -8
- package/lib/polyfill/input_event.js +7 -11
- package/lib/polyfill/mediasource.js +1 -1
- package/lib/polyfill/patchedmediakeys_apple.js +2 -72
- package/lib/text/cue.js +1 -1
- package/lib/text/ttml_text_parser.js +1 -1
- package/lib/util/config_utils.js +1 -0
- package/lib/util/error.js +45 -11
- package/lib/util/event_manager.js +211 -100
- package/lib/util/fairplay_utils.js +122 -0
- package/lib/util/i_releasable.js +1 -0
- package/lib/util/player_configuration.js +7 -0
- package/lib/util/pssh.js +41 -0
- package/lib/util/string_utils.js +42 -6
- package/lib/util/timer.js +1 -1
- package/package.json +33 -33
- package/roadmap.md +96 -0
- package/shaka-player.uncompiled.js +5 -1
- package/test/dash/dash_parser_content_protection_unit.js +35 -1
- package/test/dash/dash_parser_manifest_unit.js +60 -0
- package/test/hls/hls_live_unit.js +7 -1
- package/test/hls/hls_parser_unit.js +50 -0
- package/test/media/drm_engine_unit.js +10 -4
- package/test/media/media_source_engine_integration.js +12 -0
- package/test/media/media_source_engine_unit.js +3 -1
- package/test/media/playhead_unit.js +7 -5
- package/test/media/streaming_engine_unit.js +46 -1
- package/test/media/transmuxer_integration.js +13 -0
- package/test/net/data_uri_plugin_unit.js +13 -2
- package/test/net/http_plugin_unit.js +17 -12
- package/test/net/networking_engine_unit.js +17 -8
- package/test/offline/offline_scheme_unit.js +18 -8
- package/test/player_external.js +3 -2
- package/test/player_integration.js +94 -3
- package/test/player_src_equals_integration.js +2 -2
- package/test/player_unit.js +21 -8
- package/test/test/boot.js +20 -5
- package/test/test/externs/jasmine.js +48 -0
- package/test/test/util/expect_async_polyfill.js +145 -0
- package/test/test/util/fake_networking_engine.js +1 -0
- package/test/test/util/manifest_generator.js +2 -1
- package/test/test/util/test_scheme.js +34 -2
- package/test/test/util/ui_utils.js +41 -0
- package/test/test/util/util.js +16 -8
- package/test/ui/ui_unit.js +130 -4
- package/ui/audio_language_selection.js +17 -96
- package/ui/big_play_button.js +61 -0
- package/ui/controls.js +226 -335
- package/ui/controls.less +3 -5
- package/ui/element.js +24 -6
- package/ui/externs/ui.js +62 -9
- package/ui/fullscreen_button.js +2 -52
- package/ui/less/buttons.less +10 -16
- package/ui/less/containers.less +75 -20
- package/ui/less/general.less +18 -2
- package/ui/less/other_elements.less +2 -1
- package/ui/less/overflow_menu.less +11 -10
- package/ui/less/range_elements.less +12 -10
- package/ui/less/spinner.less +2 -0
- package/ui/overflow_menu.js +1 -1
- package/ui/pip_button.js +1 -1
- package/ui/{play_pause_button.js → play_button.js} +17 -47
- package/ui/presentation_time.js +17 -12
- package/ui/range_element.js +176 -0
- package/ui/resolution_selection.js +43 -106
- package/ui/seek_bar.js +204 -0
- package/ui/settings_menu.js +113 -0
- package/ui/small_play_button.js +73 -0
- package/ui/text_displayer.js +17 -14
- package/ui/text_selection.js +42 -107
- package/ui/ui.js +17 -40
- package/ui/volume_bar.js +40 -68
package/externs/shaka/player.js
CHANGED
|
@@ -32,16 +32,17 @@
|
|
|
32
32
|
*
|
|
33
33
|
* @property {number} timestamp
|
|
34
34
|
* The timestamp the choice was made, in seconds since 1970
|
|
35
|
-
* (i.e. Date.now() / 1000).
|
|
35
|
+
* (i.e. <code>Date.now() / 1000</code>).
|
|
36
36
|
* @property {number} id
|
|
37
37
|
* The id of the track that was chosen.
|
|
38
38
|
* @property {string} type
|
|
39
|
-
* The type of track chosen ('variant' or 'text').
|
|
39
|
+
* The type of track chosen (<code>'variant'</code> or <code>'text'</code>).
|
|
40
40
|
* @property {boolean} fromAdaptation
|
|
41
|
-
*
|
|
42
|
-
* was made by the application through
|
|
41
|
+
* <code>true</code> if the choice was made by AbrManager for adaptation;
|
|
42
|
+
* <code>false</code> if it was made by the application through
|
|
43
|
+
* <code>selectTrack</code>.
|
|
43
44
|
* @property {?number} bandwidth
|
|
44
|
-
* The bandwidth of the chosen track (null for text).
|
|
45
|
+
* The bandwidth of the chosen track (<code>null</code> for text).
|
|
45
46
|
* @exportDoc
|
|
46
47
|
*/
|
|
47
48
|
shaka.extern.TrackChoice;
|
|
@@ -56,10 +57,10 @@ shaka.extern.TrackChoice;
|
|
|
56
57
|
*
|
|
57
58
|
* @property {number} timestamp
|
|
58
59
|
* The timestamp the state was entered, in seconds since 1970
|
|
59
|
-
* (i.e. Date.now() / 1000).
|
|
60
|
+
* (i.e. <code>Date.now() / 1000</code>).
|
|
60
61
|
* @property {string} state
|
|
61
|
-
* The state the player entered. This could be 'buffering'
|
|
62
|
-
* 'paused'
|
|
62
|
+
* The state the player entered. This could be <code>'buffering'</code>,
|
|
63
|
+
* <code>'playing'</code>, <code>'paused'</code>, or <code>'ended'</code>.
|
|
63
64
|
* @property {number} duration
|
|
64
65
|
* The number of seconds the player was in this state. If this is the last
|
|
65
66
|
* entry in the list, the player is still in this state, so the duration will
|
|
@@ -91,7 +92,8 @@ shaka.extern.StateChange;
|
|
|
91
92
|
* @description
|
|
92
93
|
* Contains statistics and information about the current state of the player.
|
|
93
94
|
* This is meant for applications that want to log quality-of-experience (QoE)
|
|
94
|
-
* or other stats. These values will reset when load() is called
|
|
95
|
+
* or other stats. These values will reset when <code>load()</code> is called
|
|
96
|
+
* again.
|
|
95
97
|
*
|
|
96
98
|
* @property {number} width
|
|
97
99
|
* The width of the current video track.
|
|
@@ -101,18 +103,18 @@ shaka.extern.StateChange;
|
|
|
101
103
|
* The bandwidth required for the current streams (total, in bit/sec).
|
|
102
104
|
*
|
|
103
105
|
* @property {number} decodedFrames
|
|
104
|
-
* The total number of frames decoded by the Player. This may be
|
|
105
|
-
* is not supported by the browser.
|
|
106
|
+
* The total number of frames decoded by the Player. This may be
|
|
107
|
+
* <code>NaN</code> if this is not supported by the browser.
|
|
106
108
|
* @property {number} droppedFrames
|
|
107
|
-
* The total number of frames dropped by the Player. This may be
|
|
108
|
-
* is not supported by the browser.
|
|
109
|
+
* The total number of frames dropped by the Player. This may be
|
|
110
|
+
* <code>NaN</code> if this is not supported by the browser.
|
|
109
111
|
* @property {number} estimatedBandwidth
|
|
110
112
|
* The current estimated network bandwidth (in bit/sec).
|
|
111
113
|
*
|
|
112
114
|
* @property {number} loadLatency
|
|
113
115
|
* This is the number of seconds it took for the video element to have enough
|
|
114
116
|
* data to begin playback. This is measured from the time load() is called to
|
|
115
|
-
* the time the 'loadeddata' event is fired by the media element.
|
|
117
|
+
* the time the <code>'loadeddata'</code> event is fired by the media element.
|
|
116
118
|
* @property {number} playTime
|
|
117
119
|
* The total time spent in a playing state in seconds.
|
|
118
120
|
* @property {number} pauseTime
|
|
@@ -159,7 +161,8 @@ shaka.extern.BufferedRange;
|
|
|
159
161
|
* Contains information about the current buffered ranges.
|
|
160
162
|
*
|
|
161
163
|
* @property {!Array.<shaka.extern.BufferedRange>} total
|
|
162
|
-
* The combined audio/video buffered ranges, reported by
|
|
164
|
+
* The combined audio/video buffered ranges, reported by
|
|
165
|
+
* <code>video.buffered</code>.
|
|
163
166
|
* @property {!Array.<shaka.extern.BufferedRange>} audio
|
|
164
167
|
* The buffered ranges for audio content.
|
|
165
168
|
* @property {!Array.<shaka.extern.BufferedRange>} video
|
|
@@ -215,18 +218,18 @@ shaka.extern.BufferedInfo;
|
|
|
215
218
|
* visible/audible in the buffer).
|
|
216
219
|
*
|
|
217
220
|
* @property {string} type
|
|
218
|
-
* The type of track, either 'variant' or 'text'
|
|
221
|
+
* The type of track, either <code>'variant'</code> or <code>'text'</code>.
|
|
219
222
|
* @property {number} bandwidth
|
|
220
223
|
* The bandwidth required to play the track, in bits/sec.
|
|
221
224
|
*
|
|
222
225
|
* @property {string} language
|
|
223
|
-
* The language of the track, or 'und' if not given. This is the
|
|
224
|
-
* value provided in the manifest; it may need to be normalized.
|
|
226
|
+
* The language of the track, or <code>'und'</code> if not given. This is the
|
|
227
|
+
* exact value provided in the manifest; it may need to be normalized.
|
|
225
228
|
* @property {?string} label
|
|
226
229
|
* The track label, which is unique text that should describe the track.
|
|
227
230
|
* @property {?string} kind
|
|
228
|
-
* (only for text tracks) The kind of text track, either
|
|
229
|
-
* 'subtitle'
|
|
231
|
+
* (only for text tracks) The kind of text track, either
|
|
232
|
+
* <code>'caption'</code> or <code>'subtitle'</code>.
|
|
230
233
|
* @property {?number} width
|
|
231
234
|
* The video width provided in the manifest, if present.
|
|
232
235
|
* @property {?number} height
|
|
@@ -248,10 +251,12 @@ shaka.extern.BufferedInfo;
|
|
|
248
251
|
* indicates which track Shaka will use when the user's language preference
|
|
249
252
|
* cannot be satisfied.
|
|
250
253
|
* @property {!Array.<string>} roles
|
|
251
|
-
* The roles of the track, e.g. 'main'
|
|
254
|
+
* The roles of the track, e.g. <code>'main'</code>, <code>'caption'</code>,
|
|
255
|
+
* or <code>'commentary'</code>.
|
|
252
256
|
* @property {Array.<string>} audioRoles
|
|
253
|
-
* The roles of the audio in the track, e.g. 'main' or
|
|
254
|
-
* Will be null for text tracks or variant tracks
|
|
257
|
+
* The roles of the audio in the track, e.g. <code>'main'</code> or
|
|
258
|
+
* <code>'commentary'</code>. Will be null for text tracks or variant tracks
|
|
259
|
+
* without audio.
|
|
255
260
|
* @property {?number} videoId
|
|
256
261
|
* (only for variant tracks) The video stream id.
|
|
257
262
|
* @property {?number} audioId
|
|
@@ -308,9 +313,11 @@ shaka.extern.Track;
|
|
|
308
313
|
* @property {number} maxHeight
|
|
309
314
|
* The maximum height of a video track, in pixels.
|
|
310
315
|
* @property {number} minPixels
|
|
311
|
-
* The minimum number of total pixels in a video track (i.e.
|
|
316
|
+
* The minimum number of total pixels in a video track (i.e.
|
|
317
|
+
* <code>width * height</code>).
|
|
312
318
|
* @property {number} maxPixels
|
|
313
|
-
* The maximum number of total pixels in a video track (i.e.
|
|
319
|
+
* The maximum number of total pixels in a video track (i.e.
|
|
320
|
+
* <code>width * height</code>).
|
|
314
321
|
*
|
|
315
322
|
* @property {number} minBandwidth
|
|
316
323
|
* The minimum bandwidth of a variant track, in bit/sec.
|
|
@@ -351,8 +358,8 @@ shaka.extern.DrmSupportType;
|
|
|
351
358
|
* The keys are media MIME types.
|
|
352
359
|
* @property {!Object.<string, ?shaka.extern.DrmSupportType>} drm
|
|
353
360
|
* A map of supported key systems.
|
|
354
|
-
* The keys are the key system names. The value is null if it is
|
|
355
|
-
* supported. Key systems not probed will not be in this dictionary.
|
|
361
|
+
* The keys are the key system names. The value is <code>null</code> if it is
|
|
362
|
+
* not supported. Key systems not probed will not be in this dictionary.
|
|
356
363
|
*
|
|
357
364
|
* @exportDoc
|
|
358
365
|
*/
|
|
@@ -460,22 +467,23 @@ shaka.extern.DashContentProtectionCallback;
|
|
|
460
467
|
* @property {string} videoRobustness
|
|
461
468
|
* A key-system-specific string that specifies a required security level for
|
|
462
469
|
* video.
|
|
463
|
-
* <i>Defaults to ''
|
|
470
|
+
* <i>Defaults to <code>''</code>, i.e., no specific robustness required.</i>
|
|
464
471
|
* @property {string} audioRobustness
|
|
465
472
|
* A key-system-specific string that specifies a required security level for
|
|
466
473
|
* audio.
|
|
467
|
-
* <i>Defaults to ''
|
|
474
|
+
* <i>Defaults to <code>''</code>, i.e., no specific robustness required.</i>
|
|
468
475
|
* @property {Uint8Array} serverCertificate
|
|
469
476
|
* <i>Defaults to null.</i> <br>
|
|
470
|
-
* <i>An empty certificate (byteLength
|
|
477
|
+
* <i>An empty certificate (<code>byteLength==0</code>) will be treated as
|
|
478
|
+
* <code>null</code>.</i> <br>
|
|
471
479
|
* <i>A certificate will be requested from the license server if
|
|
472
480
|
* required.</i> <br>
|
|
473
481
|
* A key-system-specific server certificate used to encrypt license requests.
|
|
474
482
|
* Its use is optional and is meant as an optimization to avoid a round-trip
|
|
475
483
|
* to request a certificate.
|
|
476
484
|
* @property {string} individualizationServer
|
|
477
|
-
* The server that handles an 'individualiation-request'
|
|
478
|
-
* given, it will default to the license server.
|
|
485
|
+
* The server that handles an <code>'individualiation-request'</code>. If the
|
|
486
|
+
* server isn't given, it will default to the license server.
|
|
479
487
|
*
|
|
480
488
|
* @exportDoc
|
|
481
489
|
*/
|
|
@@ -488,7 +496,9 @@ shaka.extern.AdvancedDrmConfiguration;
|
|
|
488
496
|
* servers: !Object.<string, string>,
|
|
489
497
|
* clearKeys: !Object.<string, string>,
|
|
490
498
|
* delayLicenseRequestUntilPlayed: boolean,
|
|
491
|
-
* advanced: Object.<string, shaka.extern.AdvancedDrmConfiguration
|
|
499
|
+
* advanced: Object.<string, shaka.extern.AdvancedDrmConfiguration>,
|
|
500
|
+
* initDataTransform: ((function(!Uint8Array):!Uint8Array)|undefined),
|
|
501
|
+
* fairPlayTransform: boolean
|
|
492
502
|
* }}
|
|
493
503
|
*
|
|
494
504
|
* @property {shaka.extern.RetryParameters} retryParameters
|
|
@@ -496,7 +506,8 @@ shaka.extern.AdvancedDrmConfiguration;
|
|
|
496
506
|
* @property {!Object.<string, string>} servers
|
|
497
507
|
* <i>Required for all but the clear key CDM.</i> <br>
|
|
498
508
|
* A dictionary which maps key system IDs to their license servers.
|
|
499
|
-
* For example,
|
|
509
|
+
* For example,
|
|
510
|
+
* <code>{'com.widevine.alpha': 'https://example.com/drm'}</code>.
|
|
500
511
|
* @property {!Object.<string, string>} clearKeys
|
|
501
512
|
* <i>Forces the use of the Clear Key CDM.</i>
|
|
502
513
|
* A map of key IDs (hex) to keys (hex).
|
|
@@ -508,6 +519,19 @@ shaka.extern.AdvancedDrmConfiguration;
|
|
|
508
519
|
* <i>Optional.</i> <br>
|
|
509
520
|
* A dictionary which maps key system IDs to advanced DRM configuration for
|
|
510
521
|
* those key systems.
|
|
522
|
+
* @property {((function(!Uint8Array):!Uint8Array)|undefined)}
|
|
523
|
+
* initDataTransform
|
|
524
|
+
* <i>Optional.</i><br>
|
|
525
|
+
* If given, this function is called with the init data from the
|
|
526
|
+
* manifest/media and should return the (possibly transformed) init data to
|
|
527
|
+
* pass to the browser.
|
|
528
|
+
* @property {boolean} fairPlayTransform
|
|
529
|
+
* <i>Optional.</i><br>
|
|
530
|
+
* <b>Temporary, for v2.5.x only.</b><br>
|
|
531
|
+
* If true, transform the FairPlay license request/response according to the
|
|
532
|
+
* FairPlay examples; if false, don't transform. Defaults to
|
|
533
|
+
* <code>true</code>. Starting in v2.6 this will go away and we will never
|
|
534
|
+
* provide default license request/response transforms.
|
|
511
535
|
*
|
|
512
536
|
* @exportDoc
|
|
513
537
|
*/
|
|
@@ -531,8 +555,8 @@ shaka.extern.DrmConfiguration;
|
|
|
531
555
|
* ContentProtection node. Return null if not recognized.
|
|
532
556
|
* @property {string} clockSyncUri
|
|
533
557
|
* A default clock sync URI to be used with live streams which do not
|
|
534
|
-
* contain any clock sync information. The
|
|
535
|
-
* will be used to determine the current time.
|
|
558
|
+
* contain any clock sync information. The <code>Date</code> header from this
|
|
559
|
+
* URI will be used to determine the current time.
|
|
536
560
|
* @property {boolean} ignoreDrmInfo
|
|
537
561
|
* If true will cause DASH parser to ignore DRM information specified
|
|
538
562
|
* by the manifest and treat it as if it signaled no particular key
|
|
@@ -543,39 +567,57 @@ shaka.extern.DrmConfiguration;
|
|
|
543
567
|
* to the application and will result in a playback failure. Defaults to
|
|
544
568
|
* false if not provided.
|
|
545
569
|
* @property {number} defaultPresentationDelay
|
|
546
|
-
* A default presentationDelay if
|
|
547
|
-
* in the MPEG DASH
|
|
570
|
+
* A default <code>presentationDelay</code> if
|
|
571
|
+
* <code>suggestedPresentationDelay</code> is missing in the MPEG DASH
|
|
572
|
+
* manifest. This has to be bigger than <code>minBufferTime * 1.5</code>.
|
|
548
573
|
* @property {boolean} ignoreMinBufferTime
|
|
549
|
-
* If true will cause DASH parser to ignore minBufferTime from
|
|
550
|
-
* It allows player config to take precedence over manifest for
|
|
551
|
-
* rebufferingGoal
|
|
574
|
+
* If true will cause DASH parser to ignore <code>minBufferTime</code> from
|
|
575
|
+
* manifest. It allows player config to take precedence over manifest for
|
|
576
|
+
* <code>rebufferingGoal</code>. Defaults to <code>false</code> if not
|
|
577
|
+
* provided.
|
|
552
578
|
* @property {boolean} autoCorrectDrift
|
|
553
|
-
* If true
|
|
554
|
-
* the segments to determine the live edge. This
|
|
555
|
-
* that have a lot of drift. If false
|
|
556
|
-
* manifest specifies segments in the future.
|
|
557
|
-
*
|
|
579
|
+
* If <code>true</code>, ignore the <code>availabilityStartTime</code> in the
|
|
580
|
+
* manifest and instead use the segments to determine the live edge. This
|
|
581
|
+
* allows us to play streams that have a lot of drift. If <code>false</code>,
|
|
582
|
+
* we can't play content where the manifest specifies segments in the future.
|
|
583
|
+
* Defaults to <code>true</code>.
|
|
558
584
|
* @exportDoc
|
|
559
585
|
*/
|
|
560
586
|
shaka.extern.DashManifestConfiguration;
|
|
561
587
|
|
|
562
588
|
|
|
589
|
+
/**
|
|
590
|
+
* @typedef {{
|
|
591
|
+
* ignoreTextStreamFailures: boolean
|
|
592
|
+
* }}
|
|
593
|
+
*
|
|
594
|
+
* @property {boolean} ignoreTextStreamFailures
|
|
595
|
+
* If <code>true</code>, ignore any errors in a text stream and filter out
|
|
596
|
+
* those streams.
|
|
597
|
+
* @exportDoc
|
|
598
|
+
*/
|
|
599
|
+
shaka.extern.HlsManifestConfiguration;
|
|
600
|
+
|
|
601
|
+
|
|
563
602
|
/**
|
|
564
603
|
* @typedef {{
|
|
565
604
|
* retryParameters: shaka.extern.RetryParameters,
|
|
566
605
|
* availabilityWindowOverride: number,
|
|
567
|
-
* dash: shaka.extern.DashManifestConfiguration
|
|
606
|
+
* dash: shaka.extern.DashManifestConfiguration,
|
|
607
|
+
* hls: shaka.extern.HlsManifestConfiguration
|
|
568
608
|
* }}
|
|
569
609
|
*
|
|
570
610
|
* @property {shaka.extern.RetryParameters} retryParameters
|
|
571
611
|
* Retry parameters for manifest requests.
|
|
572
612
|
* @property {number} availabilityWindowOverride
|
|
573
613
|
* A number, in seconds, that overrides the availability window in the
|
|
574
|
-
* manifest, or NaN if the default value should be used. This is
|
|
575
|
-
* the manifest parser, so custom manifest parsers should take
|
|
576
|
-
* this parameter.
|
|
614
|
+
* manifest, or <code>NaN</code> if the default value should be used. This is
|
|
615
|
+
* enforced by the manifest parser, so custom manifest parsers should take
|
|
616
|
+
* care to honor this parameter.
|
|
577
617
|
* @property {shaka.extern.DashManifestConfiguration} dash
|
|
578
618
|
* Advanced parameters used by the DASH manifest parser.
|
|
619
|
+
* @property {shaka.extern.HlsManifestConfiguration} hls
|
|
620
|
+
* Advanced parameters used by the HLS manifest parser.
|
|
579
621
|
*
|
|
580
622
|
* @exportDoc
|
|
581
623
|
*/
|
|
@@ -624,27 +666,29 @@ shaka.extern.ManifestConfiguration;
|
|
|
624
666
|
* in buffer behind the playhead when it appends a new media segment.
|
|
625
667
|
* The StreamingEngine will evict content to meet this limit.
|
|
626
668
|
* @property {boolean} ignoreTextStreamFailures
|
|
627
|
-
* If true
|
|
628
|
-
* other streams.
|
|
669
|
+
* If <code>true</code>, the player will ignore text stream failures and
|
|
670
|
+
* continue playing other streams.
|
|
629
671
|
* @property {boolean} alwaysStreamText
|
|
630
|
-
* If true
|
|
631
|
-
* shown. This is necessary when using the browser's built-in
|
|
632
|
-
* are not capable of signaling display state changes back to
|
|
633
|
-
*
|
|
672
|
+
* If <code>true</code>, always stream text tracks, regardless of whether or
|
|
673
|
+
* not they are shown. This is necessary when using the browser's built-in
|
|
674
|
+
* controls, which are not capable of signaling display state changes back to
|
|
675
|
+
* Shaka Player.
|
|
676
|
+
* Defaults to <code>false</code>.
|
|
634
677
|
* @property {boolean} startAtSegmentBoundary
|
|
635
|
-
* If true
|
|
636
|
-
* segment. This affects both explicit start times and calculated start
|
|
637
|
-
* for live streams. This can put us further from the live edge. Defaults
|
|
638
|
-
* false
|
|
678
|
+
* If <code>true</code>, adjust the start time backwards so it is at the start
|
|
679
|
+
* of a segment. This affects both explicit start times and calculated start
|
|
680
|
+
* time for live streams. This can put us further from the live edge. Defaults
|
|
681
|
+
* to <code>false</code>.
|
|
639
682
|
* @property {number} smallGapLimit
|
|
640
683
|
* The limit (in seconds) for a gap in the media to be considered "small".
|
|
641
684
|
* Small gaps are jumped automatically without events. Large gaps result
|
|
642
685
|
* in a Player event and can be jumped.
|
|
643
686
|
* @property {boolean} jumpLargeGaps
|
|
644
|
-
* If true
|
|
645
|
-
* raised first. Then, if the app doesn't
|
|
646
|
-
*
|
|
647
|
-
*
|
|
687
|
+
* If <code>true</code>, jump large gaps in addition to small gaps. A
|
|
688
|
+
* <code>largegap</code> event will be raised first. Then, if the app doesn't
|
|
689
|
+
* call <code>preventDefault()</code> on the event, the Player will jump the
|
|
690
|
+
* gap. If <code>false</code>, then the event will be raised, but the gap
|
|
691
|
+
* will not be jumped.
|
|
648
692
|
* @property {number} durationBackoff
|
|
649
693
|
* By default, we will not allow seeking to exactly the duration of a
|
|
650
694
|
* presentation. This field is the number of seconds before duration we will
|
|
@@ -652,11 +696,11 @@ shaka.extern.ManifestConfiguration;
|
|
|
652
696
|
* To disable this behavior, the config can be set to 0. We recommend using
|
|
653
697
|
* the default value unless you have a good reason not to.
|
|
654
698
|
* @property {boolean} forceTransmuxTS
|
|
655
|
-
* If this is true
|
|
656
|
-
* for the assets to be played. Shaka Player currently
|
|
657
|
-
* captions by transmuxing, so this value is necessary
|
|
658
|
-
* platforms with native TS support like Edge or
|
|
659
|
-
* This value defaults to false
|
|
699
|
+
* If this is <code>true</code>, we will transmux TS content even if not
|
|
700
|
+
* strictly necessary for the assets to be played. Shaka Player currently
|
|
701
|
+
* only supports CEA 708 captions by transmuxing, so this value is necessary
|
|
702
|
+
* for enabling them on platforms with native TS support like Edge or
|
|
703
|
+
* Chromecast. This value defaults to <code>false</code>.
|
|
660
704
|
* @property {number} safeSeekOffset
|
|
661
705
|
* The amount of seconds that should be added when repositioning the playhead
|
|
662
706
|
* after falling out of the availability window or seek. This gives the player
|
|
@@ -664,9 +708,9 @@ shaka.extern.ManifestConfiguration;
|
|
|
664
708
|
* jump in the stream skipping more content. This is helpful for lower
|
|
665
709
|
* bandwidth scenarios. Defaults to 5 if not provided.
|
|
666
710
|
* @property {boolean} stallEnabled
|
|
667
|
-
* When set to
|
|
668
|
-
*
|
|
669
|
-
* seconds.
|
|
711
|
+
* When set to <code>true</code>, the stall detector logic will run, skipping
|
|
712
|
+
* forward <code>stallSkip</code> seconds whenever the playhead stops moving
|
|
713
|
+
* for <code>stallThreshold</code> seconds.
|
|
670
714
|
* @property {number} stallThreshold
|
|
671
715
|
* The maximum number of seconds that may elapse without the playhead moving
|
|
672
716
|
* (when playback is expected) before it will be labeled as a stall.
|
|
@@ -697,10 +741,10 @@ shaka.extern.StreamingConfiguration;
|
|
|
697
741
|
* The restrictions to apply to ABR decisions. These are "soft" restrictions.
|
|
698
742
|
* Any track that fails to meet these restrictions will not be selected
|
|
699
743
|
* automatically, but will still appear in the track list and can still be
|
|
700
|
-
* selected via selectVariantTrack()
|
|
701
|
-
* AbrManager should not fail, but choose a low-res or
|
|
702
|
-
* instead. It is the responsibiliy of AbrManager
|
|
703
|
-
* these rules and implement this behavior.
|
|
744
|
+
* selected via <code>selectVariantTrack()</code>. If no tracks meet these
|
|
745
|
+
* restrictions, AbrManager should not fail, but choose a low-res or
|
|
746
|
+
* low-bandwidth variant instead. It is the responsibiliy of AbrManager
|
|
747
|
+
* implementations to follow these rules and implement this behavior.
|
|
704
748
|
* @property {number} switchInterval
|
|
705
749
|
* The minimum amount of time that must pass between switches, in
|
|
706
750
|
* seconds. This keeps us from changing too often and annoying the user.
|
|
@@ -725,19 +769,21 @@ shaka.extern.AbrConfiguration;
|
|
|
725
769
|
*
|
|
726
770
|
* @property {function(!Array.<shaka.extern.Track>):!Array.<shaka.extern.Track>}
|
|
727
771
|
* trackSelectionCallback
|
|
728
|
-
* Called inside store() to determine which tracks to save from a
|
|
729
|
-
* It is passed an array of Tracks from the manifest and it should
|
|
730
|
-
* an array of the tracks to store. This is called for each Period in
|
|
731
|
-
* manifest (in order).
|
|
772
|
+
* Called inside <code>store()</code> to determine which tracks to save from a
|
|
773
|
+
* manifest. It is passed an array of Tracks from the manifest and it should
|
|
774
|
+
* return an array of the tracks to store. This is called for each Period in
|
|
775
|
+
* the manifest (in order).
|
|
732
776
|
* @property {function(shaka.extern.StoredContent,number)} progressCallback
|
|
733
|
-
* Called inside store() to give progress info back to the app.
|
|
734
|
-
* the current manifest being stored and the progress of it being
|
|
777
|
+
* Called inside <code>store()</code> to give progress info back to the app.
|
|
778
|
+
* It is given the current manifest being stored and the progress of it being
|
|
779
|
+
* stored.
|
|
735
780
|
* @property {boolean} usePersistentLicense
|
|
736
|
-
* If true
|
|
737
|
-
* network is required to view.
|
|
738
|
-
* If false
|
|
739
|
-
* will be required to retrieve a temporary license to
|
|
740
|
-
*
|
|
781
|
+
* If <code>true</code>, store protected content with a persistent license so
|
|
782
|
+
* that no network is required to view.
|
|
783
|
+
* If <code>false</code>, store protected content without a persistent
|
|
784
|
+
* license. A network will be required to retrieve a temporary license to
|
|
785
|
+
* view.
|
|
786
|
+
* Defaults to <code>true</code>.
|
|
741
787
|
* @exportDoc
|
|
742
788
|
*/
|
|
743
789
|
shaka.extern.OfflineConfiguration;
|
|
@@ -776,7 +822,7 @@ shaka.extern.OfflineConfiguration;
|
|
|
776
822
|
* Offline configuration and settings.
|
|
777
823
|
* @property {string} preferredAudioLanguage
|
|
778
824
|
* The preferred language to use for audio tracks. If not given it will use
|
|
779
|
-
* the 'main' track.
|
|
825
|
+
* the <code>'main'</code> track.
|
|
780
826
|
* Changing this during playback will not affect the current playback.
|
|
781
827
|
* @property {string} preferredTextLanguage
|
|
782
828
|
* The preferred language to use for text tracks. If a matching text track
|
|
@@ -817,8 +863,8 @@ shaka.extern.PlayerConfiguration;
|
|
|
817
863
|
* @property {string} language
|
|
818
864
|
* The language code for the stream.
|
|
819
865
|
* @property {string} role
|
|
820
|
-
* The role name for the stream. If the stream has no role,
|
|
821
|
-
* ''
|
|
866
|
+
* The role name for the stream. If the stream has no role, <code>role</code>
|
|
867
|
+
* will be <code>''</code>.
|
|
822
868
|
* @exportDoc
|
|
823
869
|
*/
|
|
824
870
|
shaka.extern.LanguageRole;
|
package/externs/tippy.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2016 Google Inc.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @fileoverview Externs for Tippy methods.
|
|
20
|
+
* @externs
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* This is the subset of this method that we use in our demo code.
|
|
26
|
+
*
|
|
27
|
+
* @param {!Element} element
|
|
28
|
+
* @param {!Object} config
|
|
29
|
+
*/
|
|
30
|
+
const tippy = function(element, config) {};
|
|
@@ -61,6 +61,10 @@ WebKitMediaKeySession.prototype.update = function(message) {};
|
|
|
61
61
|
WebKitMediaKeySession.prototype.close = function() {};
|
|
62
62
|
|
|
63
63
|
|
|
64
|
+
/** @type {string} */
|
|
65
|
+
WebKitMediaKeySession.prototype.sessionId;
|
|
66
|
+
|
|
67
|
+
|
|
64
68
|
/** @type {WebKitMediaKeyError} */
|
|
65
69
|
WebKitMediaKeySession.prototype.error;
|
|
66
70
|
|
package/karma.conf.js
CHANGED
|
@@ -64,9 +64,8 @@ module.exports = function(config) {
|
|
|
64
64
|
// frameworks to use
|
|
65
65
|
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
|
66
66
|
frameworks: [
|
|
67
|
-
'jasmine-ajax',
|
|
68
|
-
|
|
69
|
-
'source-map-support',
|
|
67
|
+
'jasmine-ajax',
|
|
68
|
+
'jasmine',
|
|
70
69
|
],
|
|
71
70
|
|
|
72
71
|
plugins: [
|
|
@@ -111,7 +110,7 @@ module.exports = function(config) {
|
|
|
111
110
|
{pattern: 'ui/**/*.js', included: false},
|
|
112
111
|
{pattern: 'ui/**/*.less', included: false},
|
|
113
112
|
{pattern: 'third_party/closure/goog/**/*.js', included: false},
|
|
114
|
-
{pattern: 'third_party/language-mapping-list
|
|
113
|
+
{pattern: 'third_party/language-mapping-list/*.js', included: false},
|
|
115
114
|
{pattern: 'test/test/assets/*', included: false},
|
|
116
115
|
{pattern: 'dist/shaka-player.ui.js', included: false},
|
|
117
116
|
{pattern: 'dist/locales.js', included: false},
|
|
@@ -123,31 +122,35 @@ module.exports = function(config) {
|
|
|
123
122
|
proxies: {},
|
|
124
123
|
|
|
125
124
|
preprocessors: {
|
|
126
|
-
//
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
'lib
|
|
130
|
-
|
|
131
|
-
'
|
|
132
|
-
|
|
133
|
-
// Convert ES6 to ES5 so we can still run tests on IE11 and Tizen.
|
|
134
|
-
'demo/common/*.js': ['babel'],
|
|
135
|
-
'lib/**/*.js': ['babel'],
|
|
136
|
-
'ui/**/*.js': ['babel'],
|
|
137
|
-
'test/**/*.js': ['babel'],
|
|
138
|
-
'third_party/language-mapping-list/**/*.js': ['babel'],
|
|
125
|
+
// Use babel to convert ES6 to ES5 so we can still run tests everywhere.
|
|
126
|
+
// Use sourcemap to read inline source maps from babel into karma.
|
|
127
|
+
'demo/**/*.js': ['babel', 'sourcemap'],
|
|
128
|
+
'lib/**/*.js': ['babel', 'sourcemap'],
|
|
129
|
+
'ui/**/*.js': ['babel', 'sourcemap'],
|
|
130
|
+
'test/**/*.js': ['babel', 'sourcemap'],
|
|
131
|
+
'third_party/language-mapping-list/*.js': ['babel', 'sourcemap'],
|
|
139
132
|
},
|
|
140
133
|
|
|
141
134
|
babelPreprocessor: {
|
|
142
135
|
options: {
|
|
143
|
-
presets: [
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
],
|
|
149
|
-
// The source-map-support framework is necessary to make this work:
|
|
136
|
+
presets: ['env'],
|
|
137
|
+
// Add source maps so that backtraces refer to the original code.
|
|
138
|
+
// Babel will output inline source maps, and the 'sourcemap'
|
|
139
|
+
// preprocessor will read them and feed them to Karma. Karma will then
|
|
140
|
+
// use them to reformat stack traces in errors.
|
|
150
141
|
sourceMap: 'inline',
|
|
142
|
+
// Add instrumentation for code coverage.
|
|
143
|
+
plugins: [
|
|
144
|
+
['istanbul', {
|
|
145
|
+
// Don't instrument these parts of the codebase.
|
|
146
|
+
exclude: [
|
|
147
|
+
'demo/**/*.js',
|
|
148
|
+
'lib/(debug|deprecate|polyfill)/*.js',
|
|
149
|
+
'test/**/*.js',
|
|
150
|
+
'third_party/**/*.js',
|
|
151
|
+
],
|
|
152
|
+
}],
|
|
153
|
+
],
|
|
151
154
|
},
|
|
152
155
|
},
|
|
153
156
|
|
|
@@ -193,6 +196,9 @@ module.exports = function(config) {
|
|
|
193
196
|
// Run playback tests on a custom manifest URI.
|
|
194
197
|
testCustomAsset: settings.test_custom_asset,
|
|
195
198
|
testCustomLicenseServer: settings.test_custom_license_server,
|
|
199
|
+
|
|
200
|
+
// Overrides the default test timeout value.
|
|
201
|
+
testTimeout: settings.test_timeout,
|
|
196
202
|
}],
|
|
197
203
|
},
|
|
198
204
|
|