shaka-player 3.1.1 → 3.1.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.
Files changed (151) hide show
  1. package/AUTHORS +7 -2
  2. package/CHANGELOG.md +199 -0
  3. package/CONTRIBUTORS +9 -3
  4. package/build/generateExterns.js +1 -1
  5. package/build/misspellings.txt +1 -0
  6. package/build/shakaBuildHelpers.py +6 -5
  7. package/build/subprocessWindowsPatch.py +103 -0
  8. package/demo/common/assets.js +1 -1
  9. package/dist/controls.css +2 -2
  10. package/dist/controls.css.map +1 -1
  11. package/dist/demo.compiled.debug.js +1 -1
  12. package/dist/demo.compiled.js +1 -1
  13. package/dist/deps.js +7 -7
  14. package/dist/locales.js +35 -33
  15. package/dist/receiver.compiled.debug.js +1 -1
  16. package/dist/receiver.compiled.js +1 -1
  17. package/dist/shaka-player.compiled.d.ts +171 -3
  18. package/dist/shaka-player.compiled.debug.d.ts +171 -3
  19. package/dist/shaka-player.compiled.debug.externs.js +179 -1
  20. package/dist/shaka-player.compiled.debug.js +365 -344
  21. package/dist/shaka-player.compiled.debug.map +3 -3
  22. package/dist/shaka-player.compiled.externs.js +179 -1
  23. package/dist/shaka-player.compiled.js +806 -798
  24. package/dist/shaka-player.compiled.map +3 -3
  25. package/dist/shaka-player.ui.d.ts +171 -3
  26. package/dist/shaka-player.ui.debug.d.ts +171 -3
  27. package/dist/shaka-player.ui.debug.externs.js +181 -3
  28. package/dist/shaka-player.ui.debug.js +458 -435
  29. package/dist/shaka-player.ui.debug.map +4 -4
  30. package/dist/shaka-player.ui.externs.js +181 -3
  31. package/dist/shaka-player.ui.js +927 -918
  32. package/dist/shaka-player.ui.map +4 -4
  33. package/docs/tutorials/fairplay.md +1 -1
  34. package/docs/tutorials/faq.md +14 -0
  35. package/docs/tutorials/index.json +2 -2
  36. package/docs/tutorials/upgrade-v3.md +38 -0
  37. package/docs/tutorials/upgrade.md +3 -3
  38. package/externs/ima.js +4 -0
  39. package/externs/shaka/ads.js +2 -0
  40. package/externs/shaka/player.js +6 -0
  41. package/externs/shaka/text.js +10 -0
  42. package/karma.conf.js +1 -0
  43. package/lib/ads/ad_manager.js +29 -11
  44. package/lib/ads/client_side_ad_manager.js +76 -86
  45. package/lib/ads/server_side_ad_manager.js +26 -11
  46. package/lib/cast/cast_proxy.js +3 -2
  47. package/lib/cast/cast_receiver.js +2 -1
  48. package/lib/cast/cast_sender.js +2 -2
  49. package/lib/cea/sei_processor.js +24 -17
  50. package/lib/dash/dash_parser.js +100 -5
  51. package/lib/dash/segment_list.js +1 -1
  52. package/lib/dash/segment_template.js +7 -4
  53. package/lib/hls/hls_parser.js +44 -17
  54. package/lib/media/closed_caption_parser.js +3 -1
  55. package/lib/media/content_workarounds.js +12 -0
  56. package/lib/media/drm_engine.js +20 -1
  57. package/lib/media/gap_jumping_controller.js +8 -4
  58. package/lib/media/media_source_engine.js +1 -2
  59. package/lib/media/playhead.js +1 -1
  60. package/lib/media/presentation_timeline.js +3 -1
  61. package/lib/media/segment_reference.js +8 -0
  62. package/lib/media/streaming_engine.js +28 -19
  63. package/lib/net/networking_engine.js +2 -1
  64. package/lib/player.js +108 -54
  65. package/lib/polyfill/encryption_scheme.js +2 -0
  66. package/lib/polyfill/fullscreen.js +2 -0
  67. package/lib/polyfill/mathround.js +2 -0
  68. package/lib/polyfill/media_capabilities.js +76 -22
  69. package/lib/polyfill/mediasource.js +8 -0
  70. package/lib/polyfill/orientation.js +3 -1
  71. package/lib/polyfill/patchedmediakeys_apple.js +6 -4
  72. package/lib/polyfill/patchedmediakeys_ms.js +6 -4
  73. package/lib/polyfill/patchedmediakeys_nop.js +2 -0
  74. package/lib/polyfill/patchedmediakeys_webkit.js +6 -4
  75. package/lib/polyfill/pip_webkit.js +2 -0
  76. package/lib/polyfill/storage_estimate.js +2 -0
  77. package/lib/polyfill/video_play_promise.js +2 -0
  78. package/lib/polyfill/videoplaybackquality.js +2 -0
  79. package/lib/polyfill/vttcue.js +2 -0
  80. package/lib/text/cue.js +17 -0
  81. package/lib/text/mp4_ttml_parser.js +3 -0
  82. package/lib/text/text_engine.js +14 -2
  83. package/lib/text/ttml_text_parser.js +135 -87
  84. package/lib/text/ui_text_displayer.js +233 -83
  85. package/lib/text/vtt_text_parser.js +4 -2
  86. package/lib/util/fake_event.js +53 -7
  87. package/lib/util/mp4_box_parsers.js +1 -1
  88. package/lib/util/periods.js +111 -35
  89. package/lib/util/platform.js +13 -1
  90. package/lib/util/stream_utils.js +79 -10
  91. package/lib/util/xml_utils.js +19 -0
  92. package/package.json +2 -2
  93. package/test/cast/cast_proxy_unit.js +12 -6
  94. package/test/cast/cast_receiver_integration.js +1 -1
  95. package/test/cast/cast_utils_unit.js +1 -1
  96. package/test/cea/mp4_cea_parser_unit.js +26 -0
  97. package/test/dash/dash_parser_live_unit.js +1 -0
  98. package/test/dash/dash_parser_manifest_unit.js +220 -2
  99. package/test/dash/dash_parser_segment_template_unit.js +3 -3
  100. package/test/hls/hls_parser_unit.js +5 -1
  101. package/test/media/closed_caption_parser_unit.js +20 -0
  102. package/test/media/drm_engine_unit.js +56 -0
  103. package/test/media/playhead_unit.js +27 -1
  104. package/test/media/presentation_timeline_unit.js +19 -0
  105. package/test/media/streaming_engine_integration.js +2 -1
  106. package/test/media/streaming_engine_unit.js +148 -3
  107. package/test/player_integration.js +38 -0
  108. package/test/player_unit.js +101 -0
  109. package/test/test/assets/3675/chunk-stream0-00001.m4s +0 -0
  110. package/test/test/assets/3675/chunk-stream0-00002.m4s +0 -0
  111. package/test/test/assets/3675/chunk-stream0-00003.m4s +0 -0
  112. package/test/test/assets/3675/chunk-stream0-00004.m4s +0 -0
  113. package/test/test/assets/3675/chunk-stream0-00005.m4s +0 -0
  114. package/test/test/assets/3675/chunk-stream0-00006.m4s +0 -0
  115. package/test/test/assets/3675/chunk-stream0-00007.m4s +0 -0
  116. package/test/test/assets/3675/dash_0.mpd +30 -0
  117. package/test/test/assets/3675/dash_1.mpd +30 -0
  118. package/test/test/assets/3675/dash_2.mpd +30 -0
  119. package/test/test/assets/3675/dash_3.mpd +30 -0
  120. package/test/test/assets/3675/dash_4.mpd +30 -0
  121. package/test/test/assets/3675/dash_5.mpd +26 -0
  122. package/test/test/assets/3675/init-stream0.m4s +0 -0
  123. package/test/test/assets/empty_caption_video_init.mp4 +0 -0
  124. package/test/test/assets/empty_caption_video_segment.mp4 +0 -0
  125. package/test/test/util/fake_ad_manager.js +4 -1
  126. package/test/test/util/simple_fakes.js +5 -3
  127. package/test/test/util/ttml_utils.js +81 -0
  128. package/test/text/mp4_ttml_parser_unit.js +11 -18
  129. package/test/text/ttml_text_parser_unit.js +542 -220
  130. package/test/text/ui_text_displayer_unit.js +95 -18
  131. package/test/text/vtt_text_parser_unit.js +17 -1
  132. package/test/ui/localization_unit.js +15 -14
  133. package/test/ui/text_displayer_layout_unit.js +52 -1
  134. package/test/util/mp4_box_parsers_unit.js +28 -0
  135. package/test/util/periods_unit.js +190 -2
  136. package/test/util/stream_utils_unit.js +59 -2
  137. package/ui/airplay_button.js +5 -0
  138. package/ui/big_play_button.js +10 -0
  139. package/ui/cast_button.js +2 -3
  140. package/ui/controls.js +8 -6
  141. package/ui/less/buttons.less +0 -4
  142. package/ui/less/containers.less +10 -5
  143. package/ui/locales/en.json +1 -0
  144. package/ui/locales/ru.json +6 -6
  145. package/ui/locales/source.json +4 -0
  146. package/ui/localization.js +28 -51
  147. package/ui/pip_button.js +2 -3
  148. package/ui/play_button.js +10 -10
  149. package/ui/small_play_button.js +12 -0
  150. package/ui/text_selection.js +1 -0
  151. package/docs/tutorials/upgrade-v2-4.md +0 -481
@@ -1,481 +0,0 @@
1
- # Shaka Upgrade Guide, v2.4 => v3.0
2
-
3
- This is a detailed guide for upgrading from Shaka Player v2.4 to v3.0.
4
- Feel free to skim or to search for the class and method names you are using in
5
- your application.
6
-
7
-
8
- #### What's New in v3.0?
9
-
10
- Shaka v3.0 introduces several improvements over v2.4, including:
11
- - An official Shaka Player UI library to provide customizable and styleable
12
- video controls
13
- - Load dist/shaka-player.ui.js
14
- - See tutorial in docs/tutorials/ui.md
15
- - Ad-insertion APIs (integrated with the Google IMA SDK)
16
- - Complete redesign of the demo app
17
- - FairPlay support
18
- - Native HLS support on iOS and Safari
19
- - Support for single-file playback
20
- - Network requests can be aborted when switching streams
21
- - Offline storage operations can be aborted
22
- - Support for concurrent operations in a single shaka.offline.Storage instance
23
- - Stable Track objects across DASH Periods
24
- - Partial support for SMPTE-TT subtitles
25
- - Improved service worker in demo app PWA
26
- - Drift tolerance for live DASH streams (on by default)
27
- - PlayReady license URL parsing (ms:laurl)
28
- - Support for CEA captions in DASH
29
- - Merged CEA captions in text tracks API
30
- - New config field to ignore manifest minBufferTime
31
- - New config field `streaming.inaccurateManifestTolerance` to control
32
- assumptions about manifest accuracy
33
- - New fields in getStats()
34
- - Configuration for presentation delay
35
- - Offline storage without a Player instance
36
- - A safe margin parameter was added for clearing the buffer
37
- - Widevine SAMPLE-AES support in HLS
38
-
39
-
40
- #### Extern namespace change
41
-
42
- If you use the Closure Compiler in your own project, you need to know that v3.0
43
- changes the namespace for our externs, such as plugin interfaces and manifest
44
- types. The namespace has changed from `shakaExtern` to `shaka.extern`. You
45
- MUST update any references to `shakaExtern`.
46
-
47
- ```js
48
- // v2.4:
49
- /**
50
- * @param {shaka.net.NetworkingEngine.RequestType} type
51
- * @param {shakaExtern.Request} request
52
- * @return {!Promise}
53
- */
54
- function myFilter(type, request) { /* ... */ }
55
-
56
- // v3.0:
57
- /**
58
- * @param {shaka.net.NetworkingEngine.RequestType} type
59
- * @param {shaka.extern.Request} request
60
- * @return {!Promise}
61
- */
62
- function myFilter(type, request) { /* ... */ }
63
- ```
64
-
65
-
66
- #### Player Factory parameter change
67
-
68
- The optional `Factory` parameter in `Player.load()` and `Storage.store()` has
69
- been changed to a MIME type string. The `Factory` parameter was deprecated in
70
- v2.5 and removed in v3.0. Applications MUST update to use MIME types instead of
71
- explicit factories. Any registered factory can be referenced by its registered
72
- MIME type.
73
-
74
- ```js
75
- // v2.4:
76
- player.load('foo.mpd', /* startTime= */ 0,
77
- /* factory= */ shaka.dash.DashParser);
78
-
79
- // v3.0:
80
- player.load('foo.mpd', /* startTime= */ 0,
81
- /* mimeType= */ 'application/dash+xml');
82
- ```
83
-
84
- See {@link shaka.Player#load} for details.
85
-
86
-
87
- #### Manifest URI API change
88
-
89
- The method `Player.getManifestUri()` has been renamed to `Player.getAssetUri()`.
90
- The older method was deprecated in v2.5 and was removed in v3.0. Applications
91
- MUST update to the new method, whose name more accurately reflects our support
92
- for non-manifest content.
93
-
94
- ```js
95
- // v2.4:
96
- const uri = player.getManifestUri();
97
-
98
- // v3.0:
99
- const uri = player.getAssetUri();
100
- ```
101
-
102
-
103
- #### Embedded text (CEA 608/708) API change
104
-
105
- The CEA-specific methods `Player.selectEmbeddedTextTrack()` and
106
- `Player.usingEmbeddedTextTrack()` were deprecated in v2.5 and were removed in
107
- v3.0. CEA captions now show up in the standard text track APIs:
108
- `getTextTracks()`, `selectTextTrack()`, `getTextLanguages()`,
109
- `getTextLanguagesAndRoles()`, and `selectTextLanguage()`. Applications MUST
110
- update to using the track APIs. If you have content with VTT or TTML subtitles,
111
- you should already be using these APIs.
112
-
113
- ```js
114
- // v2.4:
115
- player.selectEmbeddedTextTrack();
116
-
117
- // v3.0:
118
- const tracks = player.getTextTracks();
119
- const desiredTrack = someProcessToChooseOne(tracks);
120
- player.selectTextTrack(desiredTrack);
121
- ```
122
-
123
-
124
- #### Utility method changes
125
-
126
- In v3.0, the method `shaka.util.Uint8ArrayUtils.equal` has been moved to
127
- `shaka.util.BufferUtils.equal`. The new method supports both `ArrayBuffer` and
128
- subclasses of `ArrayBufferView` like `Uint8Array`.
129
-
130
- Backward compatibility will be provided until v4.0. Applications SHOULD update
131
- to use the new location.
132
-
133
- ```js
134
- // v2.4:
135
- if (shaka.util.Uint8ArrayUtils.equal(array1, array2) { ...
136
-
137
- // v3.0:
138
- if (shaka.util.BufferUtils.equal(array1, array2) { ...
139
- ```
140
-
141
-
142
- #### Configurable factory changes
143
-
144
- All configuration fields and plugin registration interfaces that accept
145
- factories have been changed in v3.0. These factories SHOULD now be functions
146
- that return an object and MAY be arrow functions. This makes our configuration
147
- and plugin registration interfaces consistent and improves usability in some
148
- cases.
149
-
150
- Backward compatibility is provided until v4.0. If we detect that a factory
151
- needs to be called with `new`, we will do so and log a deprecation warning.
152
- Applications SHOULD update their factories.
153
-
154
- This change affects the following types:
155
-
156
- - {@link shaka.extern.AbrManager.Factory}
157
- - {@link shaka.extern.ManifestParser.Factory}
158
- - {@link shaka.extern.TextDisplayer.Factory}
159
- - {@link shaka.extern.TextParserPlugin}
160
-
161
- ```js
162
- // v2.4:
163
- class MyAbrManager {
164
- // ...
165
- }
166
- player.configure('abrFactory', MyAbrManager);
167
-
168
- class MyManifestParser {
169
- // ...
170
- }
171
- shaka.media.ManifestParser.registerParserByMime('text/foo', MyManifestParser);
172
-
173
- // v3.0:
174
- player.configure('abrFactory', () => new MyAbrManager());
175
- shaka.media.ManifestParser.registerParserByMime(
176
- 'text/foo', () => new MyManifestParser());
177
- ```
178
-
179
-
180
- #### Misc configuration changes
181
-
182
- The configurable callback `manifest.dash.customScheme` has been removed in v3.0
183
- and is no longer supported.
184
-
185
- The config field `manifest.dash.defaultPresentationDelay` has been moved to
186
- `manifest.defaultPresentationDelay`. Backward compatibility is provided until
187
- v4.0. Applications using this field SHOULD update to use the new location.
188
-
189
- The `manifest.defaultPresentationDelay` field now affects both DASH and HLS
190
- content. The default value is `0`, which is interpreted differently for DASH
191
- and HLS:
192
-
193
- - In DASH, `0` means a default of `1.5 * minBufferTime`.
194
- - In HLS, `0` means a default of `3 * segment duration`.
195
-
196
- The config field `manifest.dash.initialSegmentLimit` has been added to control
197
- memory usage during DASH `<SegmentTemplate>` parsing.
198
-
199
- The config field `streaming.inaccurateManifestTolerance` (in seconds) has been
200
- added to control off-by-one behavior in streaming. Compared with v2.4.x
201
- behavior, the default for this field should reduce the frequency with which we
202
- have to fetch an additional segment before a seek target. For less accurate
203
- manifests, the tolerance can be increased. For completely accurate manifests,
204
- applications may set this to `0`.
205
-
206
- See {@link shaka.extern.ManifestConfiguration} and
207
- {@link shaka.extern.StreamingConfiguration} for details.
208
-
209
-
210
- #### Offline API changes
211
-
212
- In v3.0, there is no longer any restriction on concurrent operations.
213
-
214
- The method `Storage.store()` now returns an instance of `IAbortableOperation`
215
- instead of `Promise`. This allows applications to call `op.abort()` to stop an
216
- operation in progress. The operation `Promise` can now be found on
217
- `op.promise`. Backward compatibility is provided until v4.0; these operations
218
- will work like `Promise`s in v3.0. (Applications MAY `await` them or call
219
- `.then()` on them.) In v4.0, these returned operations will no longer be
220
- `Promise`-like, so applications SHOULD update at this time to use `op.promise`.
221
-
222
- ```js
223
- // v2.4:
224
- try {
225
- const result = await storage.store();
226
- } catch (error) {
227
- // Store failed!
228
- }
229
-
230
- // v3.0:
231
- const op = storage.store();
232
- cancelButton.onclick = async () => {
233
- await op.abort();
234
- };
235
-
236
- try {
237
- const result = await op.promise;
238
- } catch (error) {
239
- if (error.code == shaka.util.Error.Code.OPERATION_ABORTED) {
240
- // Store aborted by the user!
241
- } else {
242
- // Store failed!
243
- }
244
- }
245
- ```
246
-
247
- In v3.0, `shaka.offline.Storage.configure()` now takes a complete `Player`
248
- configuration object instead of a separate one. The fields that were previously
249
- part of the `Storage` config (`trackSelectionCallback`, `progressCallback`, and
250
- `usePersistentLicense`) have been moved inside the `offline` field. The old
251
- field locations were deprecated in v2.5 and removed in v3.0. Applications MUST
252
- update to use the new field locations.
253
-
254
- ```js
255
- // v2.4:
256
- storage.configure({
257
- trackSelectionCallback: myTrackSelectionCallback,
258
- });
259
-
260
- // v3.0:
261
- const storage = new shaka.offline.Storage();
262
- storage.configure({
263
- offline: {
264
- trackSelectionCallback: myTrackSelectionCallback,
265
- },
266
- });
267
-
268
- // OR use shared Player configuration:
269
- const storage = new shaka.offline.Storage(player);
270
- player.configure({
271
- offline: {
272
- trackSelectionCallback: myTrackSelectionCallback,
273
- },
274
- });
275
-
276
- // OR use shared Player configuration and two-argument configure():
277
- const storage = new shaka.offline.Storage(player);
278
- player.configure('offline.trackSelectionCallback', myTrackSelectionCallback);
279
- ```
280
-
281
- A new method has been introduced to allow an application to clean up and release
282
- any offline EME sessions that were not cleanly released:
283
- `Storage.removeEmeSessions()`. Applications MAY use this if desired.
284
-
285
- See {@link shaka.offline.Storage} for details.
286
-
287
-
288
- #### NetworkingEngine API changes
289
-
290
- The fields `Request.body` and `Response.data` can now be either `ArrayBuffer` or
291
- an `ArrayBufferView` (e.g. `Uint8Array`). This means your request and response
292
- filters no longer have to convert a `Uint8Array` to `ArrayBuffer` to assign to
293
- `Request.body` or `Response.data`. However, this also means such filters MUST
294
- not assume one type or the other if they read those fields.
295
-
296
- Applications SHOULD use these provided utilities to simplify common conversions:
297
-
298
- - {@link shaka.util.BufferUtils}
299
- - {@link shaka.util.StringUtils}
300
- - {@link shaka.util.Uint8ArrayUtils}
301
-
302
-
303
- #### Track API changes
304
-
305
- The track APIs on `Player` have changed. Tracks now represent the entire
306
- presentation across DASH Periods, and will no longer change at Period
307
- boundaries. The `originalId` field is now a combination of the original IDs of
308
- the DASH Representations that make up the track.
309
-
310
-
311
- #### Stats changes
312
-
313
- The stats returned by `Player.getStats()` have changed.
314
-
315
- The `streamBandwidth` field now accounts for the current playback rate when
316
- reporting the bandwidth requirements of a stream. For example, if the content
317
- is playing at 2x, the bandwidth requirement to play it is also doubled.
318
-
319
- The following new fields have been added:
320
-
321
- - `manifestTimeSeconds`
322
- - `drmTimeSeconds`
323
- - `liveLatency`
324
-
325
- See {@link shaka.extern.Stats stats} for details.
326
-
327
-
328
- #### Network scheme plugin changes
329
-
330
- In v2.5, we added a new parameter to network scheme plugins to allow plugins to
331
- provide progress events. This callback is only provided to your plugin for
332
- segment requests, so you must handle the case where this is not provided. The
333
- use of this callback enables `StreamingEngine` to converge more quickly on the
334
- ideal bandwidth estimate. Applications SHOULD update their custom network
335
- scheme plugins to provide progress events if feasible.
336
-
337
- ```js
338
- // v3.0:
339
- function mySchemePlugin(uri, request, requestType, progressUpdated) {
340
- /// ...
341
-
342
- if (progressUpdated) {
343
- progressUpdated(/* timeElapsedMilliseconds= */ currentTime - lastTime,
344
- /* bytesLoaded= */, loaded - lastLoaded,
345
- /* byteRemaining= */, contentLength - loaded);
346
- lastTime = currentTime;
347
- lastLoaded = loaded;
348
- }
349
-
350
- /// ...
351
- }
352
- shaka.net.NetworkingEngine.registerScheme('foo', mySchemePlugin);
353
- ```
354
-
355
- See {@link shaka.extern.ProgressUpdated} and {@link shaka.extern.SchemePlugin}
356
- for details.
357
-
358
-
359
- #### Network filter changes
360
-
361
- A new request type was introduced in v2.5:
362
- `shaka.net.NetworkingEngine.RequestType.TIMING`. This is used for time sync
363
- requests in the DASH parser. Previously, these requests used the type
364
- `MANIFEST`. Applications which look for specific request types in a filter MAY
365
- use this information if desired.
366
-
367
-
368
- #### NetworkingEngine changes
369
-
370
- In v2.3, the `request()` method on `shaka.net.NetworkingEngine` returned a
371
- `Promise`. In v2.5, it returns an implementation of
372
- `IAbortableOperation.<shaka.extern.Response>`, which contains a `Promise`.
373
-
374
- All applications which make application-level requests via `NetworkingEngine`
375
- MUST update to the new API. The old API was removed in v2.5.
376
-
377
- ```js
378
- // v2.3:
379
- try {
380
- const response = await player.getNetworkingEngine().request(type, request);
381
- } catch (error) {
382
- // Request failed!
383
- }
384
-
385
- // v3.0:
386
- const operation = player.getNetworkingEngine().request(type, request);
387
-
388
- // The operation can also be aborted on some condition.
389
- onSomeCondition(() => {
390
- operation.abort();
391
- });
392
-
393
- // Use operation.promise to get the response.
394
- try {
395
- const response = await operation.promise;
396
- } catch (error) {
397
- if (error.code == shaka.util.Error.Code.OPERATION_ABORTED) {
398
- // Request aborted!
399
- } else {
400
- // Request failed!
401
- }
402
- }
403
- ```
404
-
405
- See {@link shaka.net.NetworkingEngine} for details.
406
-
407
-
408
- #### AbrManager plugin changes
409
-
410
- In v3.0, we added a method to the `shaka.extern.AbrManager` interface called
411
- `playbackRateChanged(rate)`. This allows implementations to consider the
412
- current playback rate in their ABR decisions.
413
-
414
- Backward compatibility will be provided until v4.0. Applications with custom
415
- `AbrManager` plugins SHOULD update to add this method to their implementations.
416
-
417
- See {@link shaka.extern.AbrManager} for details.
418
-
419
-
420
- #### TextDisplayer plugin changes
421
-
422
- The `Cue` objects consumed by `TextDisplayer` have changed in v2.5 and v3.0.
423
-
424
- - `Cue.writingDirection` has been split into `Cue.writingMode` and
425
- `Cue.direction` to fix bugs in the handling of these attributes
426
- - `Cue.size` now defaults to `0`, which should be interpreted as "auto" (fit
427
- to text).
428
-
429
- All application-specific TextDisplayer plugins MUST be updated.
430
- v3.0 does not have backward compatibility for this!
431
-
432
- In addition, the following new fields have been added and MAY be used by
433
- `TextDisplayer` plugins:
434
-
435
- - `Cue.backgroundImage`
436
- - `Cue.border`
437
- - `Cue.cellResolution`
438
- - `Cue.letterSpacing`
439
- - `Cue.linePadding`
440
- - `Cue.opacity`
441
-
442
- See {@link shaka.extern.Cue} for details.
443
-
444
-
445
- #### Built-in network scheme plugin changes
446
-
447
- Some of the built-in network scheme plugins have changed their API. Instead of
448
- registering the class itself, they now register a static `parse()` method on
449
- the class. Any applications with scheme plugins that delegate to these
450
- built-in plugins MUST update to call the new methods.
451
-
452
- This affects the following classes:
453
-
454
- - {@link shaka.net.DataUriPlugin}
455
- - {@link shaka.net.HttpFetchPlugin}
456
- - {@link shaka.net.HttpXHRPlugin}
457
-
458
- ```js
459
- // v2.5:
460
- function MySchemePlugin(uri, request, requestType, progressUpdated) {
461
- return shaka.net.DataUriPlugin(
462
- uri, request, requestType, progressUpdated);
463
- }
464
- shaka.net.NetworkingEngine.registerScheme('data', MySchemePlugin);
465
-
466
- // v3.0:
467
- function MySchemePlugin(uri, request, requestType, progressUpdated) {
468
- return shaka.net.DataUriPlugin.parse(
469
- uri, request, requestType, progressUpdated);
470
- }
471
- ```
472
-
473
-
474
- #### Manifest parser plugin API changes
475
-
476
- v3.0 introduced many changes to the {@link shaka.extern.Manifest} structure.
477
- Any application with a custom {@link shaka.extern.ManifestParser} or which uses
478
- {@link shaka.Player#getManifest} MUST be upgraded for compatibility with v3.0.
479
-
480
- If your application meets either of these criteria, please refer to
481
- {@tutorial upgrade-manifest} for detailed instructions on upgrading.