shaka-player 4.7.13 → 4.8.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 +1 -0
- package/LICENSE +54 -0
- package/README.md +22 -1
- package/dist/controls.css +1 -1
- package/dist/controls.css.map +1 -1
- package/dist/deps.js +34 -23
- package/dist/locales.js +44 -34
- package/dist/shaka-player.compiled.d.ts +194 -44
- package/dist/shaka-player.compiled.debug.d.ts +194 -44
- package/dist/shaka-player.compiled.debug.externs.js +474 -337
- package/dist/shaka-player.compiled.debug.js +949 -832
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +474 -337
- package/dist/shaka-player.compiled.js +1237 -1171
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +257 -47
- package/dist/shaka-player.ui.debug.d.ts +257 -47
- package/dist/shaka-player.ui.debug.externs.js +591 -376
- package/dist/shaka-player.ui.debug.js +1165 -965
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +591 -376
- package/dist/shaka-player.ui.js +1521 -1404
- package/dist/shaka-player.ui.map +4 -4
- package/externs/device_sensor_event.js +18 -0
- package/externs/hisense.js +16 -0
- package/externs/playstation.js +31 -0
- package/externs/shaka/abr_manager.js +3 -1
- package/externs/shaka/ads.js +5 -0
- package/externs/shaka/codecs.js +13 -0
- package/externs/shaka/manifest.js +58 -6
- package/externs/shaka/net.js +13 -1
- package/externs/shaka/player.js +184 -13
- package/externs/shaka/text.js +19 -0
- package/externs/tizen.js +41 -0
- package/externs/webos.js +19 -0
- package/externs/xbox.js +43 -0
- package/lib/abr/simple_abr_manager.js +9 -1
- package/lib/ads/ad_manager.js +19 -2
- package/lib/ads/client_side_ad_manager.js +5 -3
- package/lib/ads/media_tailor_ad_manager.js +9 -0
- package/lib/cast/cast_receiver.js +0 -14
- package/lib/cast/cast_utils.js +1 -0
- package/lib/cea/mp4_cea_parser.js +6 -1
- package/lib/dash/content_protection.js +97 -53
- package/lib/dash/dash_parser.js +230 -176
- package/lib/dash/mpd_utils.js +72 -65
- package/lib/dash/segment_base.js +27 -21
- package/lib/dash/segment_list.js +18 -16
- package/lib/dash/segment_template.js +26 -21
- package/lib/hls/hls_parser.js +358 -164
- package/lib/media/buffering_observer.js +25 -1
- package/lib/media/drm_engine.js +91 -71
- package/lib/media/manifest_filterer.js +220 -0
- package/lib/media/media_source_engine.js +34 -5
- package/lib/media/preload_manager.js +827 -0
- package/lib/media/presentation_timeline.js +11 -0
- package/lib/media/segment_index.js +40 -30
- package/lib/media/segment_prefetch.js +140 -43
- package/lib/media/segment_reference.js +31 -8
- package/lib/media/segment_utils.js +208 -25
- package/lib/media/streaming_engine.js +319 -63
- package/lib/mss/content_protection.js +31 -25
- package/lib/mss/mss_parser.js +74 -55
- package/lib/net/networking_engine.js +49 -4
- package/lib/offline/storage.js +3 -3
- package/lib/player.js +882 -673
- package/lib/polyfill/media_capabilities.js +16 -1
- package/lib/text/simple_text_displayer.js +9 -0
- package/lib/text/stub_text_displayer.js +7 -0
- package/lib/text/text_engine.js +16 -3
- package/lib/text/ttml_text_parser.js +116 -114
- package/lib/text/ui_text_displayer.js +28 -11
- package/lib/text/vtt_text_parser.js +54 -115
- package/lib/transmuxer/opus.js +91 -0
- package/lib/transmuxer/ts_transmuxer.js +115 -0
- package/lib/util/cmcd_manager.js +152 -3
- package/lib/util/dom_utils.js +11 -0
- package/lib/util/error.js +5 -0
- package/lib/util/fake_event.js +2 -0
- package/lib/util/manifest_parser_utils.js +97 -3
- package/lib/util/mp4_box_parsers.js +346 -17
- package/lib/util/mp4_generator.js +23 -0
- package/lib/util/periods.js +19 -0
- package/lib/util/platform.js +161 -9
- package/lib/util/player_configuration.js +61 -3
- package/lib/util/stats.js +16 -0
- package/lib/util/stream_utils.js +16 -6
- package/lib/util/string_utils.js +36 -0
- package/lib/util/tXml.js +814 -0
- package/lib/util/ts_parser.js +50 -0
- package/lib/util/xml_utils.js +10 -338
- package/package.json +2 -2
- package/shaka-player.uncompiled.js +8 -0
- package/ui/controls.js +187 -5
- package/ui/enums.js +2 -0
- package/ui/externs/ui.js +30 -3
- package/ui/gl_matrix/matrix_4x4.js +568 -0
- package/ui/gl_matrix/matrix_quaternion.js +45 -0
- package/ui/less/containers.less +11 -0
- package/ui/locales/en-GB.json +2 -0
- package/ui/locales/en.json +2 -0
- package/ui/locales/es-419.json +2 -0
- package/ui/locales/es.json +2 -0
- package/ui/locales/source.json +8 -0
- package/ui/recenter_vr.js +126 -0
- package/ui/resolution_selection.js +25 -5
- package/ui/statistics_button.js +12 -0
- package/ui/text_selection.js +1 -1
- package/ui/toggle_stereoscopic.js +127 -0
- package/ui/ui.js +74 -38
- package/ui/vr_manager.js +557 -0
- package/ui/vr_utils.js +232 -0
- package/ui/vr_webgl.js +697 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*! @license
|
|
2
|
+
* Shaka Player
|
|
3
|
+
* Copyright 2016 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Externs for DeviceMotionEvent which were missing in the
|
|
9
|
+
* Closure compiler.
|
|
10
|
+
*
|
|
11
|
+
* @externs
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @return {!Promise.<string>}
|
|
17
|
+
*/
|
|
18
|
+
DeviceMotionEvent.requestPermission = function() {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*! @license
|
|
2
|
+
* Shaka Player
|
|
3
|
+
* Copyright 2016 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Externs for Hisense
|
|
9
|
+
*
|
|
10
|
+
* @externs
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @return {boolean}
|
|
15
|
+
*/
|
|
16
|
+
window.Hisense_Get4KSupportState = function() {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*! @license
|
|
2
|
+
* Shaka Player
|
|
3
|
+
* Copyright 2016 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Externs for PlayStation
|
|
9
|
+
*
|
|
10
|
+
* @externs
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/** @const */
|
|
15
|
+
var msdk = {};
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/** @const */
|
|
19
|
+
msdk.device = {};
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @return {!Promise.<{resolution: string}>}
|
|
24
|
+
*/
|
|
25
|
+
msdk.device.getDisplayInfo = function() {};
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @return {!Promise.<{resolution: string}>}
|
|
30
|
+
*/
|
|
31
|
+
msdk.device.getDisplayInfoImmediate = function() {};
|
|
@@ -92,9 +92,11 @@ shaka.extern.AbrManager = class {
|
|
|
92
92
|
* @param {number} numBytes The total number of bytes transferred.
|
|
93
93
|
* @param {boolean} allowSwitch Indicate if the segment is allowed to switch
|
|
94
94
|
* to another stream.
|
|
95
|
+
* @param {shaka.extern.Request=} request
|
|
96
|
+
* A reference to the request
|
|
95
97
|
* @exportDoc
|
|
96
98
|
*/
|
|
97
|
-
segmentDownloaded(deltaTimeMs, numBytes, allowSwitch) {}
|
|
99
|
+
segmentDownloaded(deltaTimeMs, numBytes, allowSwitch, request) {}
|
|
98
100
|
|
|
99
101
|
/**
|
|
100
102
|
* Notifies the ABR that it is a time to suggest new streams. This is used by
|
package/externs/shaka/ads.js
CHANGED
|
@@ -109,6 +109,11 @@ shaka.extern.IAdManager = class extends EventTarget {
|
|
|
109
109
|
*/
|
|
110
110
|
requestMediaTailorStream(url, adsParams, backupUrl) {}
|
|
111
111
|
|
|
112
|
+
/**
|
|
113
|
+
* @param {string} url
|
|
114
|
+
*/
|
|
115
|
+
addMediaTailorTrackingUrl(url) {}
|
|
116
|
+
|
|
112
117
|
/**
|
|
113
118
|
* @param {!HTMLElement} adContainer
|
|
114
119
|
* @param {!HTMLMediaElement} video
|
package/externs/shaka/codecs.js
CHANGED
|
@@ -42,3 +42,16 @@ shaka.extern.MPEG_PES;
|
|
|
42
42
|
* @property {?number} time
|
|
43
43
|
*/
|
|
44
44
|
shaka.extern.VideoNalu;
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @typedef {{
|
|
49
|
+
* projection: ?string,
|
|
50
|
+
* hfov: ?number
|
|
51
|
+
* }}
|
|
52
|
+
*
|
|
53
|
+
* @summary VideoNalu.
|
|
54
|
+
* @property {?string} projection
|
|
55
|
+
* @property {?number} hfov
|
|
56
|
+
*/
|
|
57
|
+
shaka.extern.SpatialVideoInfo;
|
|
@@ -181,6 +181,7 @@ shaka.extern.ServiceDescription;
|
|
|
181
181
|
/**
|
|
182
182
|
* @typedef {{
|
|
183
183
|
* keySystem: string,
|
|
184
|
+
* encryptionScheme: string,
|
|
184
185
|
* licenseServerUri: string,
|
|
185
186
|
* distinctiveIdentifierRequired: boolean,
|
|
186
187
|
* persistentStateRequired: boolean,
|
|
@@ -199,6 +200,9 @@ shaka.extern.ServiceDescription;
|
|
|
199
200
|
* @property {string} keySystem
|
|
200
201
|
* <i>Required.</i> <br>
|
|
201
202
|
* The key system, e.g., "com.widevine.alpha".
|
|
203
|
+
* @property {string} encryptionScheme
|
|
204
|
+
* <i>Required.</i> <br>
|
|
205
|
+
* The encryption scheme, e.g., "cenc", "cbcs", "cbcs-1-9".
|
|
202
206
|
* @property {string} licenseServerUri
|
|
203
207
|
* <i>Filled in by DRM config if missing.</i> <br>
|
|
204
208
|
* The license server URI.
|
|
@@ -318,7 +322,8 @@ shaka.extern.CreateSegmentIndexFunction;
|
|
|
318
322
|
|
|
319
323
|
/**
|
|
320
324
|
* @typedef {{
|
|
321
|
-
*
|
|
325
|
+
* bitsKey: number,
|
|
326
|
+
* blockCipherMode: string,
|
|
322
327
|
* cryptoKey: (webCrypto.CryptoKey|undefined),
|
|
323
328
|
* fetchKey: (shaka.extern.CreateSegmentIndexFunction|undefined),
|
|
324
329
|
* iv: (!Uint8Array|undefined),
|
|
@@ -326,12 +331,14 @@ shaka.extern.CreateSegmentIndexFunction;
|
|
|
326
331
|
* }}
|
|
327
332
|
*
|
|
328
333
|
* @description
|
|
329
|
-
* AES
|
|
334
|
+
* AES key and iv info from the manifest.
|
|
330
335
|
*
|
|
331
|
-
* @property {
|
|
332
|
-
* The
|
|
336
|
+
* @property {number} bitsKey
|
|
337
|
+
* The number of the bit key (eg: 128, 256).
|
|
338
|
+
* @property {string} blockCipherMode
|
|
339
|
+
* The block cipher mode of operation. Possible values: 'CTR' or 'CBC'.
|
|
333
340
|
* @property {webCrypto.CryptoKey|undefined} cryptoKey
|
|
334
|
-
* Web crypto key object of the AES
|
|
341
|
+
* Web crypto key object of the AES key. If unset, the "fetchKey"
|
|
335
342
|
* property should be provided.
|
|
336
343
|
* @property {shaka.extern.FetchCryptoKeysFunction|undefined} fetchKey
|
|
337
344
|
* A function that fetches the key.
|
|
@@ -346,7 +353,7 @@ shaka.extern.CreateSegmentIndexFunction;
|
|
|
346
353
|
*
|
|
347
354
|
* @exportDoc
|
|
348
355
|
*/
|
|
349
|
-
shaka.extern.
|
|
356
|
+
shaka.extern.aesKey;
|
|
350
357
|
|
|
351
358
|
|
|
352
359
|
/**
|
|
@@ -359,6 +366,51 @@ shaka.extern.aes128Key;
|
|
|
359
366
|
shaka.extern.FetchCryptoKeysFunction;
|
|
360
367
|
|
|
361
368
|
|
|
369
|
+
/**
|
|
370
|
+
* SegmentIndex minimal API.
|
|
371
|
+
* @interface
|
|
372
|
+
* @exportDoc
|
|
373
|
+
*/
|
|
374
|
+
shaka.extern.SegmentIndex = class {
|
|
375
|
+
/**
|
|
376
|
+
* Get number of references.
|
|
377
|
+
* @return {number}
|
|
378
|
+
* @exportDoc
|
|
379
|
+
*/
|
|
380
|
+
getNumReferences() {}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Finds the position of the segment for the given time, in seconds, relative
|
|
384
|
+
* to the start of the presentation. Returns the position of the segment
|
|
385
|
+
* with the largest end time if more than one segment is known for the given
|
|
386
|
+
* time.
|
|
387
|
+
*
|
|
388
|
+
* @param {number} time
|
|
389
|
+
* @return {?number} The position of the segment, or null if the position of
|
|
390
|
+
* the segment could not be determined.
|
|
391
|
+
* @exportDoc
|
|
392
|
+
*/
|
|
393
|
+
find(time) {}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Gets the SegmentReference for the segment at the given position.
|
|
397
|
+
*
|
|
398
|
+
* @param {number} position The position of the segment as returned by find().
|
|
399
|
+
* @return {shaka.media.SegmentReference} The SegmentReference, or null if
|
|
400
|
+
* no such SegmentReference exists.
|
|
401
|
+
* @exportDoc
|
|
402
|
+
*/
|
|
403
|
+
get(position) {}
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Gets number of already evicted segments.
|
|
407
|
+
* @return {number}
|
|
408
|
+
* @exportDoc
|
|
409
|
+
*/
|
|
410
|
+
getNumEvicted() {}
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
|
|
362
414
|
/**
|
|
363
415
|
* @typedef {{
|
|
364
416
|
* id: number,
|
package/externs/shaka/net.js
CHANGED
|
@@ -63,7 +63,11 @@ shaka.extern.RetryParameters;
|
|
|
63
63
|
* drmInfo: ?shaka.extern.DrmInfo,
|
|
64
64
|
* initData: ?Uint8Array,
|
|
65
65
|
* initDataType: ?string,
|
|
66
|
-
* streamDataCallback: ?function(BufferSource):!Promise
|
|
66
|
+
* streamDataCallback: ?function(BufferSource):!Promise,
|
|
67
|
+
* requestStartTime: (?number|undefined),
|
|
68
|
+
* timeToFirstByte: (?number|undefined),
|
|
69
|
+
* packetNumber: (?number|undefined),
|
|
70
|
+
* contentType: (?string|undefined)
|
|
67
71
|
* }}
|
|
68
72
|
*
|
|
69
73
|
* @description
|
|
@@ -104,6 +108,14 @@ shaka.extern.RetryParameters;
|
|
|
104
108
|
* used to initialize EME.
|
|
105
109
|
* @property {?function(BufferSource):!Promise} streamDataCallback
|
|
106
110
|
* A callback function to handle the chunked data of the ReadableStream.
|
|
111
|
+
* @property {(?number|undefined)} requestStartTime
|
|
112
|
+
* The time that the request started.
|
|
113
|
+
* @property {(?number|undefined)} timeToFirstByte
|
|
114
|
+
* The time taken to the first byte.
|
|
115
|
+
* @property {(?number|undefined)} packetNumber
|
|
116
|
+
* A number representing the order the packet within the request.
|
|
117
|
+
* @property {(?string|undefined)} contentType
|
|
118
|
+
* Content type (e.g. 'video', 'audio' or 'text', 'image')
|
|
107
119
|
* @exportDoc
|
|
108
120
|
*/
|
|
109
121
|
shaka.extern.Request;
|
package/externs/shaka/player.js
CHANGED
|
@@ -85,6 +85,8 @@ shaka.extern.StateChange;
|
|
|
85
85
|
* gapsJumped: number,
|
|
86
86
|
* stallsDetected: number,
|
|
87
87
|
*
|
|
88
|
+
* bytesDownloaded: number,
|
|
89
|
+
*
|
|
88
90
|
* switchHistory: !Array.<shaka.extern.TrackChoice>,
|
|
89
91
|
* stateHistory: !Array.<shaka.extern.StateChange>
|
|
90
92
|
* }}
|
|
@@ -161,6 +163,9 @@ shaka.extern.StateChange;
|
|
|
161
163
|
* The presentation's max segment duration in seconds. If nothing is loaded,
|
|
162
164
|
* NaN.
|
|
163
165
|
*
|
|
166
|
+
* @property {number} bytesDownloaded
|
|
167
|
+
* The bytes downloaded during the playback. If nothing is loaded, NaN.
|
|
168
|
+
*
|
|
164
169
|
* @property {!Array.<shaka.extern.TrackChoice>} switchHistory
|
|
165
170
|
* A history of the stream changes.
|
|
166
171
|
* @property {!Array.<shaka.extern.StateChange>} stateHistory
|
|
@@ -534,7 +539,8 @@ shaka.extern.MetadataFrame;
|
|
|
534
539
|
* startTime: number,
|
|
535
540
|
* endTime: number,
|
|
536
541
|
* id: string,
|
|
537
|
-
* eventElement: Element
|
|
542
|
+
* eventElement: Element,
|
|
543
|
+
* eventNode: ?shaka.extern.xml.Node
|
|
538
544
|
* }}
|
|
539
545
|
*
|
|
540
546
|
* @description
|
|
@@ -552,7 +558,10 @@ shaka.extern.MetadataFrame;
|
|
|
552
558
|
* The presentation time (in seconds) that the region should end.
|
|
553
559
|
* @property {string} id
|
|
554
560
|
* Specifies an identifier for this instance of the region.
|
|
555
|
-
* @property {
|
|
561
|
+
* @property {Elment} eventElement
|
|
562
|
+
* <b>DEPRECATED</b>: Use eventElement instead.
|
|
563
|
+
* The XML element that defines the Event.
|
|
564
|
+
* @property {?shaka.extern.xml.Node} eventNode
|
|
556
565
|
* The XML element that defines the Event.
|
|
557
566
|
* @exportDoc
|
|
558
567
|
*/
|
|
@@ -818,7 +827,8 @@ shaka.extern.PersistentSessionMetadata;
|
|
|
818
827
|
* <i>Defaults to 1.</i> <br>
|
|
819
828
|
* The frequency in seconds with which to check the expiration of a session.
|
|
820
829
|
* @property {!Array.<string>} preferredKeySystems
|
|
821
|
-
* <i>Defaults
|
|
830
|
+
* <i>Defaults ['com.microsoft.playready'] on Xbox One and PlayStation 4, and
|
|
831
|
+
* an empty array for all other browsers.</i> <br>
|
|
822
832
|
* Specifies the priorties of available DRM key systems.
|
|
823
833
|
* @property {Object.<string, string>} keySystemsMapping
|
|
824
834
|
* A map of key system name to key system name.
|
|
@@ -853,6 +863,30 @@ shaka.extern.DrmConfiguration;
|
|
|
853
863
|
shaka.extern.InitDataTransform;
|
|
854
864
|
|
|
855
865
|
|
|
866
|
+
/**
|
|
867
|
+
* @typedef {{
|
|
868
|
+
* tagName: !string,
|
|
869
|
+
* attributes: !Object<string, string>,
|
|
870
|
+
* children: !Array.<shaka.extern.xml.Node | string>,
|
|
871
|
+
* parent: ?shaka.extern.xml.Node
|
|
872
|
+
* }}
|
|
873
|
+
*
|
|
874
|
+
* @description
|
|
875
|
+
* Data structure for xml nodes as simple objects
|
|
876
|
+
*
|
|
877
|
+
* @property {!string} tagName
|
|
878
|
+
* The name of the element
|
|
879
|
+
* @property {!object} attributes
|
|
880
|
+
* The attributes of the element
|
|
881
|
+
* @property {!Array.<shaka.extern.xml.Node | string>} children
|
|
882
|
+
* The child nodes or string body of the element
|
|
883
|
+
* @property {?shaka.extern.xml.Node} parent
|
|
884
|
+
* The parent of the current element
|
|
885
|
+
*
|
|
886
|
+
* @exportDoc
|
|
887
|
+
*/
|
|
888
|
+
shaka.extern.xml.Node;
|
|
889
|
+
|
|
856
890
|
/**
|
|
857
891
|
* @typedef {{
|
|
858
892
|
* clockSyncUri: string,
|
|
@@ -867,9 +901,12 @@ shaka.extern.InitDataTransform;
|
|
|
867
901
|
* ignoreMaxSegmentDuration: boolean,
|
|
868
902
|
* keySystemsByURI: !Object.<string, string>,
|
|
869
903
|
* manifestPreprocessor: function(!Element),
|
|
904
|
+
* manifestPreprocessorTXml: function(!shaka.extern.xml.Node),
|
|
870
905
|
* sequenceMode: boolean,
|
|
871
906
|
* enableAudioGroups: boolean,
|
|
872
|
-
* multiTypeVariantsAllowed: boolean
|
|
907
|
+
* multiTypeVariantsAllowed: boolean,
|
|
908
|
+
* useStreamOnceInPeriodFlattening: boolean,
|
|
909
|
+
* updatePeriod: number
|
|
873
910
|
* }}
|
|
874
911
|
*
|
|
875
912
|
* @property {string} clockSyncUri
|
|
@@ -920,6 +957,11 @@ shaka.extern.InitDataTransform;
|
|
|
920
957
|
* A map of scheme URI to key system name. Defaults to default key systems
|
|
921
958
|
* mapping handled by Shaka.
|
|
922
959
|
* @property {function(!Element)} manifestPreprocessor
|
|
960
|
+
* <b>DEPRECATED</b>: Use manifestPreprocessorTXml instead.
|
|
961
|
+
* Called immediately after the DASH manifest has been parsed into an
|
|
962
|
+
* XMLDocument. Provides a way for applications to perform efficient
|
|
963
|
+
* preprocessing of the manifest.
|
|
964
|
+
* @property {function(!shaka.extern.xml.Node)} manifestPreprocessorTXml
|
|
923
965
|
* Called immediately after the DASH manifest has been parsed into an
|
|
924
966
|
* XMLDocument. Provides a way for applications to perform efficient
|
|
925
967
|
* preprocessing of the manifest.
|
|
@@ -941,6 +983,18 @@ shaka.extern.InitDataTransform;
|
|
|
941
983
|
* Might result in undesirable behavior if mediaSource.codecSwitchingStrategy
|
|
942
984
|
* is not set to SMOOTH.
|
|
943
985
|
* Defaults to true if SMOOTH codec switching is supported, RELOAD overwise.
|
|
986
|
+
* @property {boolean} useStreamOnceInPeriodFlattening
|
|
987
|
+
* If period combiner is used, this option ensures every stream is used
|
|
988
|
+
* only once in period flattening. It speeds up underlying algorithm
|
|
989
|
+
* but may raise issues if manifest does not have stream consistency
|
|
990
|
+
* between periods.
|
|
991
|
+
* Defaults to <code>false</code>.
|
|
992
|
+
* @property {number} updatePeriod
|
|
993
|
+
* Override the minimumUpdatePeriod of the manifest. The value is in second
|
|
994
|
+
* if the value is greater than the minimumUpdatePeriod, it will update the
|
|
995
|
+
* manifest less frequently. if you update the value during for a dynamic
|
|
996
|
+
* manifest, it will directly trigger a new download of the manifest
|
|
997
|
+
* Defaults to <code>-1</code>.
|
|
944
998
|
* @exportDoc
|
|
945
999
|
*/
|
|
946
1000
|
shaka.extern.DashManifestConfiguration;
|
|
@@ -953,6 +1007,7 @@ shaka.extern.DashManifestConfiguration;
|
|
|
953
1007
|
* defaultAudioCodec: string,
|
|
954
1008
|
* defaultVideoCodec: string,
|
|
955
1009
|
* ignoreManifestProgramDateTime: boolean,
|
|
1010
|
+
* ignoreManifestProgramDateTimeForTypes: !Array<string>,
|
|
956
1011
|
* mediaPlaylistFullMimeType: string,
|
|
957
1012
|
* useSafariBehaviorForLive: boolean,
|
|
958
1013
|
* liveSegmentsDelay: number,
|
|
@@ -981,6 +1036,14 @@ shaka.extern.DashManifestConfiguration;
|
|
|
981
1036
|
* Meant for streams where <code>EXT-X-PROGRAM-DATE-TIME</code> is incorrect
|
|
982
1037
|
* or malformed.
|
|
983
1038
|
* <i>Defaults to <code>false</code>.</i>
|
|
1039
|
+
* @property {!Array.<string>} ignoreManifestProgramDateTimeForTypes
|
|
1040
|
+
* An array of strings representing types for which
|
|
1041
|
+
* <code>EXT-X-PROGRAM-DATE-TIME</code> should be ignored. Only used if the
|
|
1042
|
+
* the main ignoreManifestProgramDateTime is set to false.
|
|
1043
|
+
* For example, setting this to ['text', 'video'] will cause the PDT values
|
|
1044
|
+
* text and video streams to be ignored, while still using the PDT values for
|
|
1045
|
+
* audio.
|
|
1046
|
+
* <i>Defaults to an empty array.</i>
|
|
984
1047
|
* @property {string} mediaPlaylistFullMimeType
|
|
985
1048
|
* A string containing a full mime type, including both the basic mime type
|
|
986
1049
|
* and also the codecs. Used when the HLS parser parses a media playlist
|
|
@@ -1032,11 +1095,17 @@ shaka.extern.HlsManifestConfiguration;
|
|
|
1032
1095
|
/**
|
|
1033
1096
|
* @typedef {{
|
|
1034
1097
|
* manifestPreprocessor: function(!Element),
|
|
1098
|
+
* manifestPreprocessorTXml: function(!shaka.extern.xml.Node),
|
|
1035
1099
|
* sequenceMode: boolean,
|
|
1036
1100
|
* keySystemsBySystemId: !Object.<string, string>
|
|
1037
1101
|
* }}
|
|
1038
1102
|
*
|
|
1039
1103
|
* @property {function(!Element)} manifestPreprocessor
|
|
1104
|
+
* <b>DEPRECATED</b>: Use manifestPreprocessorTXml instead.
|
|
1105
|
+
* Called immediately after the MSS manifest has been parsed into an
|
|
1106
|
+
* XMLDocument. Provides a way for applications to perform efficient
|
|
1107
|
+
* preprocessing of the manifest.
|
|
1108
|
+
* @property {function(!shaka.extern.xml.Node)} manifestPreprocessorTXml
|
|
1040
1109
|
* Called immediately after the MSS manifest has been parsed into an
|
|
1041
1110
|
* XMLDocument. Provides a way for applications to perform efficient
|
|
1042
1111
|
* preprocessing of the manifest.
|
|
@@ -1121,6 +1190,7 @@ shaka.extern.ManifestConfiguration;
|
|
|
1121
1190
|
* rebufferingGoal: number,
|
|
1122
1191
|
* bufferingGoal: number,
|
|
1123
1192
|
* bufferBehind: number,
|
|
1193
|
+
* evictionGoal: number,
|
|
1124
1194
|
* ignoreTextStreamFailures: boolean,
|
|
1125
1195
|
* alwaysStreamText: boolean,
|
|
1126
1196
|
* startAtSegmentBoundary: boolean,
|
|
@@ -1132,6 +1202,7 @@ shaka.extern.ManifestConfiguration;
|
|
|
1132
1202
|
* stallThreshold: number,
|
|
1133
1203
|
* stallSkip: number,
|
|
1134
1204
|
* useNativeHlsOnSafari: boolean,
|
|
1205
|
+
* useNativeHlsForFairPlay: boolean,
|
|
1135
1206
|
* inaccurateManifestTolerance: number,
|
|
1136
1207
|
* lowLatencyMode: boolean,
|
|
1137
1208
|
* autoLowLatencyMode: boolean,
|
|
@@ -1143,13 +1214,23 @@ shaka.extern.ManifestConfiguration;
|
|
|
1143
1214
|
* maxDisabledTime: number,
|
|
1144
1215
|
* parsePrftBox: boolean,
|
|
1145
1216
|
* segmentPrefetchLimit: number,
|
|
1217
|
+
* prefetchAudioLanguages: !Array<string>,
|
|
1218
|
+
* disableAudioPrefetch: boolean,
|
|
1219
|
+
* disableTextPrefetch: boolean,
|
|
1220
|
+
* disableVideoPrefetch: boolean,
|
|
1146
1221
|
* liveSync: boolean,
|
|
1147
1222
|
* liveSyncMaxLatency: number,
|
|
1148
1223
|
* liveSyncPlaybackRate: number,
|
|
1149
1224
|
* liveSyncMinLatency: number,
|
|
1150
1225
|
* liveSyncMinPlaybackRate: number,
|
|
1226
|
+
* liveSyncPanicMode: boolean,
|
|
1227
|
+
* liveSyncPanicThreshold: number,
|
|
1151
1228
|
* allowMediaSourceRecoveries: boolean,
|
|
1152
|
-
* minTimeBetweenRecoveries: number
|
|
1229
|
+
* minTimeBetweenRecoveries: number,
|
|
1230
|
+
* vodDynamicPlaybackRate: boolean,
|
|
1231
|
+
* vodDynamicPlaybackRateLowBufferRate: number,
|
|
1232
|
+
* vodDynamicPlaybackRateBufferRatio: number,
|
|
1233
|
+
* infiniteLiveStreamDuration: boolean
|
|
1153
1234
|
* }}
|
|
1154
1235
|
*
|
|
1155
1236
|
* @description
|
|
@@ -1173,6 +1254,10 @@ shaka.extern.ManifestConfiguration;
|
|
|
1173
1254
|
* The maximum number of seconds of content that the StreamingEngine will keep
|
|
1174
1255
|
* in buffer behind the playhead when it appends a new media segment.
|
|
1175
1256
|
* The StreamingEngine will evict content to meet this limit.
|
|
1257
|
+
* @property {number} evictionGoal
|
|
1258
|
+
* The minimum duration in seconds of buffer overflow the StreamingEngine
|
|
1259
|
+
* requires to start removing content from the buffer.
|
|
1260
|
+
* Values less than <code>1.0</code> are not recommended.
|
|
1176
1261
|
* @property {boolean} ignoreTextStreamFailures
|
|
1177
1262
|
* If <code>true</code>, the player will ignore text stream failures and
|
|
1178
1263
|
* continue playing other streams.
|
|
@@ -1221,9 +1306,15 @@ shaka.extern.ManifestConfiguration;
|
|
|
1221
1306
|
* @property {boolean} useNativeHlsOnSafari
|
|
1222
1307
|
* Desktop Safari has both MediaSource and their native HLS implementation.
|
|
1223
1308
|
* Depending on the application's needs, it may prefer one over the other.
|
|
1309
|
+
* Only applies to clear streams
|
|
1310
|
+
* Defaults to <code>true</code>.
|
|
1311
|
+
* @property {boolean} useNativeHlsForFairPlay
|
|
1312
|
+
* Desktop Safari has both MediaSource and their native HLS implementation.
|
|
1313
|
+
* Depending on the application's needs, it may prefer one over the other.
|
|
1224
1314
|
* Warning when disabled: Where single-key DRM streams work fine, multi-keys
|
|
1225
1315
|
* streams is showing unexpected behaviours (stall, audio playing with video
|
|
1226
1316
|
* freezes, ...). Use with care.
|
|
1317
|
+
* Defaults to <code>true</code>.
|
|
1227
1318
|
* @property {number} inaccurateManifestTolerance
|
|
1228
1319
|
* The maximum difference, in seconds, between the times in the manifest and
|
|
1229
1320
|
* the times in the segments. Larger values allow us to compensate for more
|
|
@@ -1249,7 +1340,7 @@ shaka.extern.ManifestConfiguration;
|
|
|
1249
1340
|
* If true, all emsg boxes are parsed and dispatched.
|
|
1250
1341
|
* @property {boolean} observeQualityChanges
|
|
1251
1342
|
* If true, monitor media quality changes and emit
|
|
1252
|
-
* <code
|
|
1343
|
+
* <code>shaka.Player.MediaQualityChangedEvent</code>.
|
|
1253
1344
|
* @property {number} maxDisabledTime
|
|
1254
1345
|
* The maximum time a variant can be disabled when NETWORK HTTP_ERROR
|
|
1255
1346
|
* is reached, in seconds.
|
|
@@ -1261,11 +1352,26 @@ shaka.extern.ManifestConfiguration;
|
|
|
1261
1352
|
* start date will not change, and would save parsing the segment multiple
|
|
1262
1353
|
* times needlessly.
|
|
1263
1354
|
* Defaults to <code>false</code>.
|
|
1264
|
-
* @property {
|
|
1355
|
+
* @property {number} segmentPrefetchLimit
|
|
1265
1356
|
* The maximum number of segments for each active stream to be prefetched
|
|
1266
1357
|
* ahead of playhead in parallel.
|
|
1267
1358
|
* If <code>0</code>, the segments will be fetched sequentially.
|
|
1268
1359
|
* Defaults to <code>0</code>.
|
|
1360
|
+
* @property {!Array<string>} prefetchAudioLanguages
|
|
1361
|
+
* The audio languages to prefetch.
|
|
1362
|
+
* Defaults to an empty array.
|
|
1363
|
+
* @property {boolean} disableAudioPrefetch
|
|
1364
|
+
* If set and prefetch limit is defined, it will prevent from prefetching data
|
|
1365
|
+
* for audio.
|
|
1366
|
+
* Defaults to <code>false</code>.
|
|
1367
|
+
* @property {boolean} disableTextPrefetch
|
|
1368
|
+
* If set and prefetch limit is defined, it will prevent from prefetching data
|
|
1369
|
+
* for text.
|
|
1370
|
+
* Defaults to <code>false</code>.
|
|
1371
|
+
* @property {boolean} disableVideoPrefetch
|
|
1372
|
+
* If set and prefetch limit is defined, it will prevent from prefetching data
|
|
1373
|
+
* for video.
|
|
1374
|
+
* Defaults to <code>false</code>.
|
|
1269
1375
|
* @property {boolean} liveSync
|
|
1270
1376
|
* Enable the live stream sync against the live edge by changing the playback
|
|
1271
1377
|
* rate. Defaults to <code>false</code>.
|
|
@@ -1285,6 +1391,14 @@ shaka.extern.ManifestConfiguration;
|
|
|
1285
1391
|
* Minimum playback rate used for latency chasing. It is recommended to use a
|
|
1286
1392
|
* value between 0 and 1. Effective only if liveSync is true. Defaults to
|
|
1287
1393
|
* <code>1</code>.
|
|
1394
|
+
* @property {boolean} liveSyncPanicMode
|
|
1395
|
+
* If <code>true</code>, panic mode for live sync is enabled. When enabled,
|
|
1396
|
+
* will set the playback rate to the <code>liveSyncMinPlaybackRate</code>
|
|
1397
|
+
* until playback has continued past a rebuffering for longer than the
|
|
1398
|
+
* <code>liveSyncPanicThreshold</code>. Defaults to <code>false</code>.
|
|
1399
|
+
* @property {number} liveSyncPanicThreshold
|
|
1400
|
+
* Number of seconds that playback stays in panic mode after a rebuffering.
|
|
1401
|
+
* Defaults to <code>60</code>
|
|
1288
1402
|
* @property {boolean} allowMediaSourceRecoveries
|
|
1289
1403
|
* Indicate if we should recover from VIDEO_ERROR resetting Media Source.
|
|
1290
1404
|
* Defaults to <code>true</code>.
|
|
@@ -1292,6 +1406,21 @@ shaka.extern.ManifestConfiguration;
|
|
|
1292
1406
|
* The minimum time between recoveries when VIDEO_ERROR is reached, in
|
|
1293
1407
|
* seconds.
|
|
1294
1408
|
* Defaults to <code>5</code>.
|
|
1409
|
+
* @property {boolean} vodDynamicPlaybackRate
|
|
1410
|
+
* Adapt the playback rate of the player to keep the buffer full. Defaults to
|
|
1411
|
+
* <code>false</code>.
|
|
1412
|
+
* @property {number} vodDynamicPlaybackRateLowBufferRate
|
|
1413
|
+
* Playback rate to use if the buffer is too small. Defaults to
|
|
1414
|
+
* <code>0.95</code>.
|
|
1415
|
+
* @property {number} vodDynamicPlaybackRateBufferRatio
|
|
1416
|
+
* Ratio of the <code>bufferingGoal</code> as the low threshold for
|
|
1417
|
+
* setting the playback rate to
|
|
1418
|
+
* <code>vodDynamicPlaybackRateLowBufferRate</code>.
|
|
1419
|
+
* Defaults to <code>0.5</code>.
|
|
1420
|
+
* @property {boolean} infiniteLiveStreamDuration
|
|
1421
|
+
* If <code>true</code>, the media source live duration
|
|
1422
|
+
* set as a<code>Infinity</code>
|
|
1423
|
+
* Defaults to <code> false </code>.
|
|
1295
1424
|
* @exportDoc
|
|
1296
1425
|
*/
|
|
1297
1426
|
shaka.extern.StreamingConfiguration;
|
|
@@ -1300,9 +1429,10 @@ shaka.extern.StreamingConfiguration;
|
|
|
1300
1429
|
/**
|
|
1301
1430
|
* @typedef {{
|
|
1302
1431
|
* codecSwitchingStrategy: shaka.config.CodecSwitchingStrategy,
|
|
1303
|
-
*
|
|
1432
|
+
* addExtraFeaturesToSourceBuffer: function(string): string,
|
|
1304
1433
|
* forceTransmux: boolean,
|
|
1305
|
-
*
|
|
1434
|
+
* insertFakeEncryptionInInit: boolean,
|
|
1435
|
+
* modifyCueCallback: shaka.extern.TextParser.ModifyCueCallback
|
|
1306
1436
|
* }}
|
|
1307
1437
|
*
|
|
1308
1438
|
* @description
|
|
@@ -1313,10 +1443,12 @@ shaka.extern.StreamingConfiguration;
|
|
|
1313
1443
|
* SourceBuffer.changeType. RELOAD uses cycling of MediaSource.
|
|
1314
1444
|
* Defaults to SMOOTH if SMOOTH codec switching is supported, RELOAD
|
|
1315
1445
|
* overwise.
|
|
1316
|
-
* @property {string}
|
|
1446
|
+
* @property {function(string): string} addExtraFeaturesToSourceBuffer
|
|
1447
|
+
* Callback to generate extra features string based on used MIME type.
|
|
1317
1448
|
* Some platforms may need to pass features when initializing the
|
|
1318
1449
|
* sourceBuffer.
|
|
1319
|
-
* This string is ultimately appended to MIME
|
|
1450
|
+
* This string is ultimately appended to a MIME type in addSourceBuffer() &
|
|
1451
|
+
* changeType().
|
|
1320
1452
|
* @property {boolean} forceTransmux
|
|
1321
1453
|
* If this is <code>true</code>, we will transmux AAC and TS content even if
|
|
1322
1454
|
* not strictly necessary for the assets to be played.
|
|
@@ -1332,6 +1464,10 @@ shaka.extern.StreamingConfiguration;
|
|
|
1332
1464
|
* time.
|
|
1333
1465
|
* <br><br>
|
|
1334
1466
|
* This value defaults to <code>true</code>.
|
|
1467
|
+
* @property {shaka.extern.TextParser.ModifyCueCallback} modifyCueCallback
|
|
1468
|
+
* A callback called for each cue after it is parsed, but right before it
|
|
1469
|
+
* is appended to the presentation.
|
|
1470
|
+
* Gives a chance for client-side editing of cue text, cue timing, etc.
|
|
1335
1471
|
* @exportDoc
|
|
1336
1472
|
*/
|
|
1337
1473
|
shaka.extern.MediaSourceConfiguration;
|
|
@@ -1339,7 +1475,8 @@ shaka.extern.MediaSourceConfiguration;
|
|
|
1339
1475
|
|
|
1340
1476
|
/**
|
|
1341
1477
|
* @typedef {{
|
|
1342
|
-
* customPlayheadTracker: boolean
|
|
1478
|
+
* customPlayheadTracker: boolean,
|
|
1479
|
+
* skipPlayDetection: boolean
|
|
1343
1480
|
* }}
|
|
1344
1481
|
*
|
|
1345
1482
|
* @description
|
|
@@ -1350,6 +1487,12 @@ shaka.extern.MediaSourceConfiguration;
|
|
|
1350
1487
|
* Client Side. This is useful because it allows you to implement the use of
|
|
1351
1488
|
* IMA on platforms that do not support multiple video elements.
|
|
1352
1489
|
* This value defaults to <code>false</code>.
|
|
1490
|
+
* @property {boolean} skipPlayDetection
|
|
1491
|
+
* If this is true, we will load Client Side ads without waiting for a play
|
|
1492
|
+
* event.
|
|
1493
|
+
* Defaults to <code>false</code> except on Tizen, WebOS, Chromecast,
|
|
1494
|
+
* Hisense, PlayStation 4, PlayStation5, Xbox whose default value is
|
|
1495
|
+
* <code>true</code>.
|
|
1353
1496
|
*
|
|
1354
1497
|
* @exportDoc
|
|
1355
1498
|
*/
|
|
@@ -1465,7 +1608,9 @@ shaka.extern.AdvancedAbrConfiguration;
|
|
|
1465
1608
|
* enabled: boolean,
|
|
1466
1609
|
* useHeaders: boolean,
|
|
1467
1610
|
* sessionId: string,
|
|
1468
|
-
* contentId: string
|
|
1611
|
+
* contentId: string,
|
|
1612
|
+
* rtpSafetyFactor: number,
|
|
1613
|
+
* includeKeys: !Array<string>
|
|
1469
1614
|
* }}
|
|
1470
1615
|
*
|
|
1471
1616
|
* @description
|
|
@@ -1488,6 +1633,12 @@ shaka.extern.AdvancedAbrConfiguration;
|
|
|
1488
1633
|
* characters. This value is consistent across multiple different sessions and
|
|
1489
1634
|
* devices and is defined and updated at the discretion of the service
|
|
1490
1635
|
* provider.
|
|
1636
|
+
* @property {number} rtpSafetyFactor
|
|
1637
|
+
* RTP safety factor.
|
|
1638
|
+
* Defaults to <code>5</code>.
|
|
1639
|
+
* @property {!Array<string>} includeKeys
|
|
1640
|
+
* An array of keys to include in the CMCD data. If not provided, all keys
|
|
1641
|
+
* will be included.
|
|
1491
1642
|
* @exportDoc
|
|
1492
1643
|
*/
|
|
1493
1644
|
shaka.extern.CmcdConfiguration;
|
|
@@ -1602,6 +1753,23 @@ shaka.extern.LcevcConfiguration;
|
|
|
1602
1753
|
shaka.extern.OfflineConfiguration;
|
|
1603
1754
|
|
|
1604
1755
|
|
|
1756
|
+
/**
|
|
1757
|
+
* @typedef {{
|
|
1758
|
+
* captionsUpdatePeriod: number
|
|
1759
|
+
* }}
|
|
1760
|
+
*
|
|
1761
|
+
* @description
|
|
1762
|
+
* Text displayer configuration.
|
|
1763
|
+
*
|
|
1764
|
+
* @property {number} captionsUpdatePeriod
|
|
1765
|
+
* The number of seconds to see if the captions should be updated.
|
|
1766
|
+
* Defaults to <code>0.25</code>.
|
|
1767
|
+
*
|
|
1768
|
+
* @exportDoc
|
|
1769
|
+
*/
|
|
1770
|
+
shaka.extern.TextDisplayerConfiguration;
|
|
1771
|
+
|
|
1772
|
+
|
|
1605
1773
|
/**
|
|
1606
1774
|
* @typedef {{
|
|
1607
1775
|
* ads: shaka.extern.AdsConfiguration,
|
|
@@ -1633,6 +1801,7 @@ shaka.extern.OfflineConfiguration;
|
|
|
1633
1801
|
* restrictions: shaka.extern.Restrictions,
|
|
1634
1802
|
* playRangeStart: number,
|
|
1635
1803
|
* playRangeEnd: number,
|
|
1804
|
+
* textDisplayer: shaka.extern.TextDisplayerConfiguration,
|
|
1636
1805
|
* textDisplayFactory: shaka.extern.TextDisplayer.Factory
|
|
1637
1806
|
* }}
|
|
1638
1807
|
*
|
|
@@ -1719,6 +1888,8 @@ shaka.extern.OfflineConfiguration;
|
|
|
1719
1888
|
* @property {number} playRangeEnd
|
|
1720
1889
|
* Optional playback and seek end time in seconds. Defaults to the end of
|
|
1721
1890
|
* the presentation if not provided.
|
|
1891
|
+
* @property {shaka.extern.TextDisplayerConfiguration} textDisplayer
|
|
1892
|
+
* Text displayer configuration and settings.
|
|
1722
1893
|
* @property {shaka.extern.TextDisplayer.Factory} textDisplayFactory
|
|
1723
1894
|
* A factory to construct a text displayer. Note that, if this is changed
|
|
1724
1895
|
* during playback, it will cause the text tracks to be reloaded.
|