shaka-player 4.10.13 → 4.11.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/README.md +5 -1
- package/dist/controls.css +3 -3
- package/dist/controls.css.map +1 -1
- package/dist/deps.js +11 -11
- package/dist/locales.js +38 -34
- package/dist/shaka-player.compiled.d.ts +68 -33
- package/dist/shaka-player.compiled.debug.d.ts +68 -33
- package/dist/shaka-player.compiled.debug.externs.js +584 -544
- package/dist/shaka-player.compiled.debug.js +715 -676
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +584 -544
- package/dist/shaka-player.compiled.js +1394 -1371
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +76 -34
- package/dist/shaka-player.ui.debug.d.ts +76 -34
- package/dist/shaka-player.ui.debug.externs.js +77 -26
- package/dist/shaka-player.ui.debug.js +774 -720
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +77 -26
- package/dist/shaka-player.ui.js +1649 -1617
- package/dist/shaka-player.ui.map +4 -4
- package/externs/mediasession.js +10 -1
- package/externs/shaka/ads.js +79 -2
- package/externs/shaka/manifest.js +6 -1
- package/externs/shaka/manifest_parser.js +6 -2
- package/externs/shaka/net.js +23 -2
- package/externs/shaka/player.js +414 -103
- package/externs/shaka/text.js +2 -1
- package/lib/abr/simple_abr_manager.js +5 -0
- package/lib/ads/ad_manager.js +45 -1
- package/lib/ads/ad_utils.js +124 -1
- package/lib/ads/interstitial_ad.js +9 -2
- package/lib/ads/interstitial_ad_manager.js +216 -101
- package/lib/ads/media_tailor_ad.js +1 -39
- package/lib/ads/media_tailor_ad_manager.js +32 -16
- package/lib/cea/cea608_data_channel.js +40 -8
- package/lib/cea/cea608_memory.js +28 -0
- package/lib/dash/dash_parser.js +162 -25
- package/lib/dash/segment_base.js +3 -2
- package/lib/dash/segment_list.js +6 -3
- package/lib/dash/segment_template.js +104 -20
- package/lib/hls/hls_parser.js +319 -215
- package/lib/media/drm_engine.js +11 -3
- package/lib/media/media_source_engine.js +0 -8
- package/lib/media/preload_manager.js +16 -4
- package/lib/media/segment_reference.js +3 -0
- package/lib/media/segment_utils.js +8 -1
- package/lib/media/streaming_engine.js +10 -6
- package/lib/mss/mss_parser.js +14 -2
- package/lib/net/http_fetch_plugin.js +12 -5
- package/lib/net/http_xhr_plugin.js +7 -3
- package/lib/net/networking_engine.js +21 -1
- package/lib/offline/manifest_converter.js +1 -0
- package/lib/offline/storage.js +1 -0
- package/lib/player.js +336 -121
- package/lib/text/cue.js +373 -0
- package/lib/text/mp4_ttml_parser.js +51 -1
- package/lib/text/mp4_vtt_parser.js +2 -5
- package/lib/text/sbv_text_parser.js +2 -31
- package/lib/text/srt_text_parser.js +1 -1
- package/lib/text/text_engine.js +1 -1
- package/lib/text/text_utils.js +1 -0
- package/lib/text/ttml_text_parser.js +14 -4
- package/lib/text/ui_text_displayer.js +0 -4
- package/lib/text/vtt_text_parser.js +10 -415
- package/lib/util/abortable_operation.js +8 -0
- package/lib/util/cmcd_manager.js +38 -0
- package/lib/util/error.js +16 -0
- package/lib/util/fake_event.js +1 -0
- package/lib/util/manifest_parser_utils.js +12 -3
- package/lib/util/player_configuration.js +4 -2
- package/lib/util/stream_utils.js +57 -2
- package/lib/util/tXml.js +2 -1
- package/lib/util/text_parser.js +46 -0
- package/lib/util/ts_parser.js +32 -3
- package/package.json +1 -1
- package/shaka-player.uncompiled.js +1 -1
- package/ui/chapter_selection.js +179 -0
- package/ui/controls.js +151 -0
- package/ui/enums.js +1 -0
- package/ui/externs/ui.js +7 -1
- package/ui/less/containers.less +3 -4
- package/ui/less/overflow_menu.less +5 -0
- package/ui/less/tooltip.less +1 -1
- package/ui/locales/en.json +1 -0
- package/ui/locales/es.json +1 -0
- package/ui/locales/fr.json +1 -0
- package/ui/locales/source.json +4 -0
- package/ui/seek_bar.js +3 -2
- package/ui/ui.js +2 -0
- package/lib/polyfill/abort_controller.js +0 -158
package/externs/mediasession.js
CHANGED
|
@@ -36,9 +36,18 @@ const MediaSession = class {
|
|
|
36
36
|
setActionHandler(type, callback) {
|
|
37
37
|
/** @type {string} */
|
|
38
38
|
this.type = type;
|
|
39
|
-
|
|
39
|
+
|
|
40
|
+
/** @type {!function(!{action: string, seekOffset: ?number,
|
|
41
|
+
* seekTime: ?number})}
|
|
42
|
+
*/
|
|
40
43
|
this.callback = callback;
|
|
41
44
|
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @param {?{duration: ?number, playbackRate: ?number,
|
|
48
|
+
* position: ?number}=} stateDict
|
|
49
|
+
*/
|
|
50
|
+
setPositionState(stateDict) {}
|
|
42
51
|
};
|
|
43
52
|
|
|
44
53
|
|
package/externs/shaka/ads.js
CHANGED
|
@@ -57,6 +57,65 @@ shaka.extern.AdsStats;
|
|
|
57
57
|
shaka.extern.AdCuePoint;
|
|
58
58
|
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* @typedef {{
|
|
62
|
+
* id: ?string,
|
|
63
|
+
* startTime: number,
|
|
64
|
+
* endTime: ?number,
|
|
65
|
+
* uri: string,
|
|
66
|
+
* isSkippable: boolean,
|
|
67
|
+
* skipOffset: ?number,
|
|
68
|
+
* canJump: boolean,
|
|
69
|
+
* resumeOffset: ?number,
|
|
70
|
+
* playoutLimit: ?number,
|
|
71
|
+
* once: boolean,
|
|
72
|
+
* pre: boolean,
|
|
73
|
+
* post: boolean,
|
|
74
|
+
* timelineRange: boolean
|
|
75
|
+
* }}
|
|
76
|
+
*
|
|
77
|
+
* @description
|
|
78
|
+
* Contains the ad interstitial info.
|
|
79
|
+
*
|
|
80
|
+
* @property {?string} id
|
|
81
|
+
* The id of the interstitial.
|
|
82
|
+
* @property {number} startTime
|
|
83
|
+
* The start time of the interstitial.
|
|
84
|
+
* @property {?number} endTime
|
|
85
|
+
* The end time of the interstitial.
|
|
86
|
+
* @property {string} uri
|
|
87
|
+
* The uri of the interstitial, can be any type that
|
|
88
|
+
* ShakaPlayer supports (either in MSE or src=)
|
|
89
|
+
* @property {boolean} isSkippable
|
|
90
|
+
* Indicate if the interstitial is skippable.
|
|
91
|
+
* @property {?number} skipOffset
|
|
92
|
+
* Time value that identifies when skip controls are made available to the
|
|
93
|
+
* end user.
|
|
94
|
+
* @property {boolean} canJump
|
|
95
|
+
* Indicate if the interstitial is jumpable.
|
|
96
|
+
* @property {?number} resumeOffset
|
|
97
|
+
* Indicates where the primary playback will resume after the interstitial
|
|
98
|
+
* plays. It is expressed as a time lag from when interstitial playback was
|
|
99
|
+
* scheduled on the primary player's timeline. For live ad replacement it
|
|
100
|
+
* must be null.
|
|
101
|
+
* @property {?number} playoutLimit
|
|
102
|
+
* Indicate a limit for the playout time of the entire interstitial.
|
|
103
|
+
* @property {boolean} once
|
|
104
|
+
* Indicates that the interstitial should only be played once.
|
|
105
|
+
* @property {boolean} pre
|
|
106
|
+
* Indicates that an action is to be triggered before playback of the
|
|
107
|
+
* primary asset begins, regardless of where playback begins in the primary
|
|
108
|
+
* asset.
|
|
109
|
+
* @property {boolean} post
|
|
110
|
+
* Indicates that an action is to be triggered after the primary asset has
|
|
111
|
+
* been played to its end without error.
|
|
112
|
+
* @property {boolean} timelineRange
|
|
113
|
+
* Indicates whether the interstitial should be presented in a timeline UI
|
|
114
|
+
* as a single point or as a range.
|
|
115
|
+
*/
|
|
116
|
+
shaka.extern.AdInterstitial;
|
|
117
|
+
|
|
118
|
+
|
|
60
119
|
/**
|
|
61
120
|
* An object that's responsible for all the ad-related logic
|
|
62
121
|
* in the player.
|
|
@@ -187,9 +246,27 @@ shaka.extern.IAdManager = class extends EventTarget {
|
|
|
187
246
|
/**
|
|
188
247
|
* @param {!shaka.Player} basePlayer
|
|
189
248
|
* @param {!HTMLMediaElement} baseVideo
|
|
190
|
-
* @param {shaka.extern.
|
|
249
|
+
* @param {shaka.extern.HLSInterstitial} interstitial
|
|
250
|
+
*/
|
|
251
|
+
onHLSInterstitialMetadata(basePlayer, baseVideo, interstitial) {}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* @param {!shaka.Player} basePlayer
|
|
255
|
+
* @param {!HTMLMediaElement} baseVideo
|
|
256
|
+
* @param {shaka.extern.TimelineRegionInfo} region
|
|
257
|
+
*/
|
|
258
|
+
onDASHInterstitialMetadata(basePlayer, baseVideo, region) {}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* @param {shaka.extern.AdInterstitial} interstitial
|
|
262
|
+
*/
|
|
263
|
+
addCustomInterstitial(interstitial) {}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* @param {string} url
|
|
267
|
+
* @return {!Promise}
|
|
191
268
|
*/
|
|
192
|
-
|
|
269
|
+
addAdUrlInterstitial(url) {}
|
|
193
270
|
};
|
|
194
271
|
|
|
195
272
|
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
* nextUrl: ?string,
|
|
26
26
|
* periodCount: number,
|
|
27
27
|
* gapCount: number,
|
|
28
|
-
* isLowLatency: boolean
|
|
28
|
+
* isLowLatency: boolean,
|
|
29
|
+
* startTime: ?number
|
|
29
30
|
* }}
|
|
30
31
|
*
|
|
31
32
|
* @description
|
|
@@ -111,6 +112,10 @@
|
|
|
111
112
|
* If in src= mode or nothing is loaded, NaN.
|
|
112
113
|
* @property {bolean} isLowLatency
|
|
113
114
|
* If true, the manifest is Low Latency.
|
|
115
|
+
* @property {?number} startTime
|
|
116
|
+
* Indicate the startTime of the playback, when <code>startTime</code> is
|
|
117
|
+
* <code>null</code>, playback will start at the default start time.
|
|
118
|
+
* Note: It only overrides the load startTime when it is not defined.
|
|
114
119
|
*
|
|
115
120
|
* @exportDoc
|
|
116
121
|
*/
|
|
@@ -47,9 +47,10 @@ shaka.extern.ManifestParser = class {
|
|
|
47
47
|
* configuration changes. Will be called at least once before start().
|
|
48
48
|
*
|
|
49
49
|
* @param {shaka.extern.ManifestConfiguration} config
|
|
50
|
+
* @param {(function():boolean)=} isPreloadFn
|
|
50
51
|
* @exportDoc
|
|
51
52
|
*/
|
|
52
|
-
configure(config) {}
|
|
53
|
+
configure(config, isPreloadFn) {}
|
|
53
54
|
|
|
54
55
|
/**
|
|
55
56
|
* Initialize and start the parser. When |start| resolves, it should return
|
|
@@ -139,7 +140,8 @@ shaka.extern.ManifestParser = class {
|
|
|
139
140
|
* getBandwidthEstimate: function():number,
|
|
140
141
|
* onMetadata: function(string, number, ?number,
|
|
141
142
|
* !Array.<shaka.extern.MetadataFrame>),
|
|
142
|
-
* disableStream: function(!shaka.extern.Stream)
|
|
143
|
+
* disableStream: function(!shaka.extern.Stream),
|
|
144
|
+
* addFont: function(string, string)
|
|
143
145
|
* }}
|
|
144
146
|
*
|
|
145
147
|
* @description
|
|
@@ -184,6 +186,8 @@ shaka.extern.ManifestParser = class {
|
|
|
184
186
|
* @property {function(!shaka.extern.Stream)} disableStream
|
|
185
187
|
* Called to temporarily disable a stream i.e. disabling all variant
|
|
186
188
|
* containing said stream.
|
|
189
|
+
* @property {function(string, string)} addFont
|
|
190
|
+
* Called when a new font needs to be added.
|
|
187
191
|
* @exportDoc
|
|
188
192
|
*/
|
|
189
193
|
shaka.extern.ManifestParser.PlayerInterface;
|
package/externs/shaka/net.js
CHANGED
|
@@ -169,7 +169,8 @@ shaka.extern.Response;
|
|
|
169
169
|
* shaka.extern.Request,
|
|
170
170
|
* shaka.net.NetworkingEngine.RequestType,
|
|
171
171
|
* shaka.extern.ProgressUpdated,
|
|
172
|
-
* shaka.extern.HeadersReceived
|
|
172
|
+
* shaka.extern.HeadersReceived,
|
|
173
|
+
* shaka.extern.SchemePluginConfig):
|
|
173
174
|
* !shaka.extern.IAbortableOperation.<shaka.extern.Response>}
|
|
174
175
|
* @description
|
|
175
176
|
* Defines a plugin that handles a specific scheme.
|
|
@@ -185,6 +186,23 @@ shaka.extern.Response;
|
|
|
185
186
|
shaka.extern.SchemePlugin;
|
|
186
187
|
|
|
187
188
|
|
|
189
|
+
/**
|
|
190
|
+
* @typedef {{
|
|
191
|
+
* minBytesForProgressEvents: (number|undefined)
|
|
192
|
+
* }}
|
|
193
|
+
*
|
|
194
|
+
* @description
|
|
195
|
+
* Defines configuration object to use by SchemePlugins.
|
|
196
|
+
*
|
|
197
|
+
* @property {(number|undefined)} minBytesForProgressEvents
|
|
198
|
+
* Defines minimum number of bytes that should be use to emit progress event,
|
|
199
|
+
* if possible.
|
|
200
|
+
*
|
|
201
|
+
* @exportDoc
|
|
202
|
+
*/
|
|
203
|
+
shaka.extern.SchemePluginConfig;
|
|
204
|
+
|
|
205
|
+
|
|
188
206
|
/**
|
|
189
207
|
* @typedef {function(number, number, number)}
|
|
190
208
|
*
|
|
@@ -217,7 +235,8 @@ shaka.extern.HeadersReceived;
|
|
|
217
235
|
* @typedef {{
|
|
218
236
|
* type: (shaka.net.NetworkingEngine.AdvancedRequestType|undefined),
|
|
219
237
|
* stream: (shaka.extern.Stream|undefined),
|
|
220
|
-
* segment: (shaka.media.SegmentReference|undefined)
|
|
238
|
+
* segment: (shaka.media.SegmentReference|undefined),
|
|
239
|
+
* isPreload: (boolean|undefined)
|
|
221
240
|
* }}
|
|
222
241
|
*
|
|
223
242
|
* @description
|
|
@@ -229,6 +248,8 @@ shaka.extern.HeadersReceived;
|
|
|
229
248
|
* The duration of the segment in seconds
|
|
230
249
|
* @property {shaka.media.SegmentReference=} segment
|
|
231
250
|
* The request's segment reference
|
|
251
|
+
* @property {boolean=} isPreload
|
|
252
|
+
* Whether the request came from a preload or a normal load.
|
|
232
253
|
* @exportDoc
|
|
233
254
|
*/
|
|
234
255
|
shaka.extern.RequestContext;
|