shaka-player 4.5.0 → 4.6.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/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
- package/AUTHORS +2 -0
- package/CHANGELOG.md +98 -0
- package/CODE_OF_CONDUCT.md +1 -1
- package/CONTRIBUTORS +2 -0
- package/README.md +38 -32
- package/demo/common/asset.js +11 -17
- package/demo/common/assets.js +117 -11
- package/demo/config.js +28 -1
- package/demo/custom.js +52 -38
- package/demo/main.js +11 -3
- package/demo/search.js +7 -0
- package/dist/controls.css +1 -1
- package/dist/controls.css.map +1 -1
- package/dist/demo.compiled.debug.js +133 -124
- package/dist/demo.compiled.debug.map +3 -3
- package/dist/demo.compiled.js +133 -124
- package/dist/demo.compiled.map +3 -3
- package/dist/deps.js +20 -18
- package/dist/locales.js +35 -31
- package/dist/receiver.compiled.debug.js +58 -50
- package/dist/receiver.compiled.debug.map +3 -3
- package/dist/receiver.compiled.js +58 -50
- package/dist/receiver.compiled.map +3 -3
- package/dist/shaka-player.compiled.d.ts +440 -390
- package/dist/shaka-player.compiled.debug.d.ts +440 -390
- package/dist/shaka-player.compiled.debug.externs.js +162 -77
- package/dist/shaka-player.compiled.debug.js +786 -736
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +162 -77
- package/dist/shaka-player.compiled.js +1154 -1121
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +491 -437
- package/dist/shaka-player.ui.debug.d.ts +491 -437
- package/dist/shaka-player.ui.debug.externs.js +167 -77
- package/dist/shaka-player.ui.debug.js +877 -811
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +167 -77
- package/dist/shaka-player.ui.js +1362 -1318
- package/dist/shaka-player.ui.map +4 -4
- package/docs/tutorials/ad_monetization.md +54 -0
- package/docs/tutorials/basic-usage.md +2 -1
- package/docs/tutorials/errors.md +2 -1
- package/docs/tutorials/offline.md +10 -8
- package/docs/tutorials/plugins.md +5 -0
- package/docs/tutorials/ui-customization.md +13 -0
- package/docs/tutorials/ui.md +2 -1
- package/docs/tutorials/upgrade.md +3 -0
- package/externs/managedmediasource.js +24 -0
- package/externs/shaka/abr_manager.js +6 -2
- package/externs/shaka/cea.js +7 -0
- package/externs/shaka/codecs.js +5 -3
- package/externs/shaka/manifest.js +21 -5
- package/externs/shaka/manifest_parser.js +17 -0
- package/externs/shaka/net.js +2 -2
- package/externs/shaka/offline.js +9 -2
- package/externs/shaka/player.js +53 -7
- package/externs/shaka/text.js +3 -1
- package/externs/shaka/transmuxer.js +1 -1
- package/lib/abr/simple_abr_manager.js +25 -8
- package/lib/ads/media_tailor_ad_manager.js +14 -3
- package/lib/cast/cast_receiver.js +1 -1
- package/lib/cea/cea_decoder.js +28 -0
- package/lib/cea/dummy_caption_decoder.js +5 -0
- package/lib/dash/dash_parser.js +249 -83
- package/lib/dash/mpd_utils.js +52 -31
- package/lib/dash/segment_base.js +4 -5
- package/lib/dash/segment_list.js +5 -4
- package/lib/dash/segment_template.js +83 -26
- package/lib/hls/hls_classes.js +28 -43
- package/lib/hls/hls_parser.js +761 -649
- package/lib/hls/hls_utils.js +64 -5
- package/lib/hls/manifest_text_parser.js +7 -11
- package/lib/media/adaptation_set.js +20 -13
- package/lib/media/adaptation_set_criteria.js +70 -18
- package/lib/media/closed_caption_parser.js +13 -0
- package/lib/media/content_workarounds.js +6 -0
- package/lib/media/drm_engine.js +8 -13
- package/lib/media/manifest_parser.js +8 -113
- package/lib/media/media_source_capabilities.js +10 -3
- package/lib/media/media_source_engine.js +75 -21
- package/lib/media/play_rate_controller.js +8 -38
- package/lib/media/presentation_timeline.js +7 -1
- package/lib/media/quality_observer.js +1 -1
- package/lib/media/segment_index.js +5 -5
- package/lib/media/segment_prefetch.js +92 -24
- package/lib/media/segment_reference.js +67 -1
- package/lib/media/segment_utils.js +343 -0
- package/lib/media/stall_detector.js +0 -3
- package/lib/media/streaming_engine.js +41 -21
- package/lib/mss/mss_parser.js +18 -2
- package/lib/net/networking_engine.js +66 -12
- package/lib/net/networking_utils.js +95 -0
- package/lib/offline/indexeddb/v1_storage_cell.js +2 -0
- package/lib/offline/indexeddb/v2_storage_cell.js +2 -0
- package/lib/offline/manifest_converter.js +2 -0
- package/lib/offline/offline_manifest_parser.js +10 -0
- package/lib/offline/storage.js +11 -7
- package/lib/player.js +993 -1502
- package/lib/polyfill/mediasource.js +22 -1
- package/lib/text/mp4_ttml_parser.js +2 -2
- package/lib/text/srt_text_parser.js +2 -2
- package/lib/text/stub_text_displayer.js +51 -0
- package/lib/text/text_engine.js +3 -2
- package/lib/text/ttml_text_parser.js +28 -5
- package/lib/text/ui_text_displayer.js +4 -0
- package/lib/text/vtt_text_parser.js +7 -2
- package/lib/transmuxer/aac_transmuxer.js +1 -1
- package/lib/transmuxer/ac3_transmuxer.js +1 -1
- package/lib/transmuxer/ec3_transmuxer.js +1 -1
- package/lib/transmuxer/h264.js +5 -4
- package/lib/transmuxer/h265.js +5 -4
- package/lib/transmuxer/mp3_transmuxer.js +1 -1
- package/lib/transmuxer/mpeg_ts_transmuxer.js +1 -1
- package/lib/transmuxer/mss_transmuxer.js +1 -1
- package/lib/transmuxer/ts_transmuxer.js +33 -13
- package/lib/util/buffer_utils.js +26 -4
- package/lib/util/content_steering_manager.js +358 -0
- package/lib/util/error.js +2 -6
- package/lib/util/fairplay_utils.js +1 -1
- package/lib/util/fake_event.js +5 -1
- package/lib/util/id3_utils.js +50 -1
- package/lib/util/manifest_parser_utils.js +12 -8
- package/lib/util/mp4_generator.js +2 -4
- package/lib/util/mutex.js +59 -0
- package/lib/util/object_utils.js +1 -1
- package/lib/util/periods.js +154 -179
- package/lib/util/platform.js +4 -3
- package/lib/util/player_configuration.js +35 -6
- package/lib/util/stream_utils.js +105 -98
- package/lib/util/ts_parser.js +124 -73
- package/lib/util/uint8array_utils.js +5 -1
- package/lib/util/xml_utils.js +5 -0
- package/maintained-branches.md +2 -2
- package/package.json +1 -1
- package/roadmap.md +15 -5
- package/shaka-player.uncompiled.js +0 -1
- package/test/abr/simple_abr_manager_unit.js +33 -33
- package/test/ads/ad_manager_unit.js +3 -2
- package/test/cast/cast_receiver_integration.js +3 -4
- package/test/cast/cast_utils_unit.js +2 -0
- package/test/cea/cea_decoder_unit.js +7 -0
- package/test/codec_switching/codec_switching_integration.js +2 -1
- package/test/dash/dash_parser_integration.js +2 -1
- package/test/dash/dash_parser_live_unit.js +0 -19
- package/test/dash/dash_parser_manifest_unit.js +494 -2
- package/test/dash/mpd_utils_unit.js +61 -30
- package/test/hls/hls_live_unit.js +12 -3
- package/test/hls/hls_parser_unit.js +377 -27
- package/test/hls/manifest_text_parser_unit.js +32 -99
- package/test/media/adaptation_set_criteria_unit.js +172 -21
- package/test/media/adaptation_set_unit.js +1 -0
- package/test/media/content_workarounds_unit.js +1 -1
- package/test/media/drm_engine_unit.js +3 -3
- package/test/media/media_source_engine_unit.js +1 -1
- package/test/media/play_rate_controller_unit.js +0 -48
- package/test/media/segment_index_unit.js +2 -1
- package/test/mss/mss_player_integration.js +3 -2
- package/test/net/networking_engine_unit.js +3 -3
- package/test/{media/manifest_parser_unit.js → net/networking_utils_unit.js} +2 -2
- package/test/offline/manifest_convert_unit.js +9 -0
- package/test/offline/offline_integration.js +2 -1
- package/test/offline/storage_integration.js +21 -9
- package/test/player_external.js +4 -2
- package/test/player_integration.js +15 -4
- package/test/player_load_graph_integration.js +47 -151
- package/test/player_src_equals_external.js +1 -0
- package/test/player_src_equals_integration.js +71 -4
- package/test/player_unit.js +80 -27
- package/test/test/util/fake_media_source_engine.js +5 -0
- package/test/test/util/fake_networking_engine.js +9 -1
- package/test/test/util/fake_segment_prefetch.js +3 -0
- package/test/test/util/manifest_generator.js +4 -0
- package/test/test/util/manifest_parser_util.js +14 -2
- package/test/test/util/offline_utils.js +1 -0
- package/test/test/util/simple_fakes.js +2 -2
- package/test/test/util/streaming_engine_util.js +3 -0
- package/test/test/util/test_scheme.js +6 -0
- package/test/test/util/ui_utils.js +4 -3
- package/test/text/mp4_ttml_parser_unit.js +4 -4
- package/test/text/srt_text_parser_unit.js +1 -1
- package/test/text/text_displayer_layout_unit.js +1 -1
- package/test/text/text_engine_unit.js +6 -0
- package/test/text/ttml_text_parser_unit.js +33 -2
- package/test/transmuxer/transmuxer_engine_integration.js +9 -0
- package/test/transmuxer/transmuxer_integration.js +33 -3
- package/test/ui/ad_ui_unit.js +2 -2
- package/test/ui/ui_customization_unit.js +17 -16
- package/test/ui/ui_integration.js +30 -20
- package/test/ui/ui_unit.js +25 -19
- package/test/util/buffer_utils_unit.js +1 -1
- package/test/util/content_steering_manager_unit.js +427 -0
- package/test/util/id3_utils_unit.js +52 -0
- package/test/util/stream_utils_unit.js +17 -113
- package/test/util/ts_parser_unit.js +3 -3
- package/third_party/closure-uri/uri.js +13 -1
- package/ui/audio_language_selection.js +9 -2
- package/ui/externs/ui.js +17 -2
- package/ui/language_utils.js +43 -8
- package/ui/less/range_elements.less +33 -0
- package/ui/locales/en.json +1 -0
- package/ui/locales/es-419.json +1 -0
- package/ui/locales/es.json +1 -0
- package/ui/locales/source.json +4 -0
- package/ui/localization.js +10 -0
- package/ui/remote_button.js +3 -1
- package/ui/resolution_selection.js +47 -10
- package/ui/seek_bar.js +296 -3
- package/ui/text_selection.js +2 -1
- package/ui/ui.js +6 -2
- package/lib/routing/node.js +0 -23
- package/lib/routing/payload.js +0 -47
- package/lib/routing/walker.js +0 -587
- package/test/routing/walker_unit.js +0 -505
package/lib/util/xml_utils.js
CHANGED
|
@@ -397,6 +397,11 @@ shaka.util.XmlUtils = class {
|
|
|
397
397
|
return null;
|
|
398
398
|
}
|
|
399
399
|
|
|
400
|
+
// Cobalt browser doesn't support document.createNodeIterator.
|
|
401
|
+
if (!('createNodeIterator' in document)) {
|
|
402
|
+
return rootElem;
|
|
403
|
+
}
|
|
404
|
+
|
|
400
405
|
// SECURITY: Verify that the document does not contain elements from the
|
|
401
406
|
// HTML or SVG namespaces, which could trigger script execution and XSS.
|
|
402
407
|
const iterator = document.createNodeIterator(
|
package/maintained-branches.md
CHANGED
package/package.json
CHANGED
package/roadmap.md
CHANGED
|
@@ -13,18 +13,28 @@ Candidate features for future release cycles:
|
|
|
13
13
|
https://github.com/shaka-project/shaka-player/issues/1030
|
|
14
14
|
- Background fetch for offline storage
|
|
15
15
|
https://github.com/shaka-project/shaka-player/issues/879
|
|
16
|
+
- A method to stitch together clips
|
|
17
|
+
https://github.com/shaka-project/shaka-player/issues/764
|
|
18
|
+
- Predict next segment in DASH SegmentTimeline
|
|
19
|
+
https://github.com/shaka-project/shaka-player/issues/898
|
|
16
20
|
- Smaller, more modular binary
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
- Content Steering
|
|
20
|
-
https://github.com/shaka-project/shaka-player/issues/5704
|
|
22
|
+
v5.0 - 2024 Q1
|
|
21
23
|
- Preload API
|
|
22
24
|
https://github.com/shaka-project/shaka-player/issues/880
|
|
25
|
+
- Common Media Server Data (CMSD)
|
|
26
|
+
https://github.com/shaka-project/shaka-player/issues/5890
|
|
27
|
+
|
|
28
|
+
=====
|
|
29
|
+
|
|
30
|
+
v4.6 - 2023 Q4
|
|
31
|
+
- Content Steering
|
|
32
|
+
https://github.com/shaka-project/shaka-player/issues/5704
|
|
23
33
|
- New DASH protocol for Low Latency.
|
|
24
34
|
- ManagedMediaSource
|
|
25
35
|
https://github.com/shaka-project/shaka-player/issues/5271
|
|
26
|
-
|
|
27
|
-
|
|
36
|
+
- Add thumbnails support in src=
|
|
37
|
+
- Remove state engine
|
|
28
38
|
|
|
29
39
|
v4.5 - 2023 Q4
|
|
30
40
|
- Built-in transmuxer support for muxed content streams (audio+video)
|
|
@@ -50,7 +50,6 @@ goog.require('shaka.polyfill.VTTCue');
|
|
|
50
50
|
goog.require('shaka.polyfill.VideoPlayPromise');
|
|
51
51
|
goog.require('shaka.polyfill.VideoPlaybackQuality');
|
|
52
52
|
goog.require('shaka.polyfill');
|
|
53
|
-
goog.require('shaka.routing.Walker');
|
|
54
53
|
goog.require('shaka.text.Cue');
|
|
55
54
|
goog.require('shaka.text.LrcTextParser');
|
|
56
55
|
goog.require('shaka.text.Mp4TtmlParser');
|
|
@@ -145,14 +145,14 @@ describe('SimpleAbrManager', () => {
|
|
|
145
145
|
abrManager.setVariants(variants);
|
|
146
146
|
abrManager.chooseVariant();
|
|
147
147
|
|
|
148
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
149
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
148
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
149
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
150
150
|
|
|
151
151
|
abrManager.enable();
|
|
152
152
|
|
|
153
153
|
// Make another call to segmentDownloaded() so switchCallback() is
|
|
154
154
|
// called.
|
|
155
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
155
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
156
156
|
|
|
157
157
|
// Expect variants 2 to be chosen for bandwidth = 5e5
|
|
158
158
|
// and variant 5 - for bandwidth = 6e5
|
|
@@ -173,12 +173,12 @@ describe('SimpleAbrManager', () => {
|
|
|
173
173
|
abrManager.chooseVariant();
|
|
174
174
|
|
|
175
175
|
// 0 duration segment shouldn't cause us to get stuck on the lowest variant
|
|
176
|
-
abrManager.segmentDownloaded(0, bytesPerSecond);
|
|
177
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
176
|
+
abrManager.segmentDownloaded(0, bytesPerSecond, true);
|
|
177
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
178
178
|
|
|
179
179
|
abrManager.enable();
|
|
180
180
|
|
|
181
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
181
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
182
182
|
|
|
183
183
|
expect(abrManager.getBandwidthEstimate()).toBeTruthy();
|
|
184
184
|
});
|
|
@@ -193,14 +193,14 @@ describe('SimpleAbrManager', () => {
|
|
|
193
193
|
// bandwidth.
|
|
194
194
|
const bytesPerSecond = sufficientBWMultiplier * bandwidth / 8.0;
|
|
195
195
|
|
|
196
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
197
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
196
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
197
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
198
198
|
|
|
199
199
|
abrManager.enable();
|
|
200
200
|
|
|
201
201
|
// Make another call to segmentDownloaded() so switchCallback() is
|
|
202
202
|
// called.
|
|
203
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
203
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
204
204
|
|
|
205
205
|
// Expect variants 4 to be chosen
|
|
206
206
|
const expectedVariant = variants[3];
|
|
@@ -216,9 +216,9 @@ describe('SimpleAbrManager', () => {
|
|
|
216
216
|
abrManager.chooseVariant();
|
|
217
217
|
|
|
218
218
|
// Don't enable AbrManager.
|
|
219
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
220
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
221
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
219
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
220
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
221
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
222
222
|
expect(switchCallback).not.toHaveBeenCalled();
|
|
223
223
|
});
|
|
224
224
|
|
|
@@ -229,12 +229,12 @@ describe('SimpleAbrManager', () => {
|
|
|
229
229
|
abrManager.setVariants(variants);
|
|
230
230
|
abrManager.chooseVariant();
|
|
231
231
|
|
|
232
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
233
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
232
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
233
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
234
234
|
|
|
235
235
|
abrManager.enable();
|
|
236
236
|
|
|
237
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
237
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
238
238
|
expect(switchCallback).toHaveBeenCalled();
|
|
239
239
|
switchCallback.calls.reset();
|
|
240
240
|
|
|
@@ -242,23 +242,23 @@ describe('SimpleAbrManager', () => {
|
|
|
242
242
|
bandwidth = 2e6;
|
|
243
243
|
bytesPerSecond = sufficientBWMultiplier * bandwidth / 8.0;
|
|
244
244
|
|
|
245
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
246
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
247
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
248
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
249
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
250
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
251
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
245
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
246
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
247
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
248
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
249
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
250
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
251
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
252
252
|
|
|
253
253
|
// Stay inside switch interval.
|
|
254
254
|
Date.now = () => (config.switchInterval - 2) * 1e3;
|
|
255
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
255
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
256
256
|
|
|
257
257
|
expect(switchCallback).not.toHaveBeenCalled();
|
|
258
258
|
|
|
259
259
|
// Move outside switch interval.
|
|
260
260
|
Date.now = () => (config.switchInterval + 2) * 1e3;
|
|
261
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
261
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
262
262
|
|
|
263
263
|
expect(switchCallback).toHaveBeenCalled();
|
|
264
264
|
});
|
|
@@ -272,14 +272,14 @@ describe('SimpleAbrManager', () => {
|
|
|
272
272
|
abrManager.setVariants(variants);
|
|
273
273
|
abrManager.chooseVariant();
|
|
274
274
|
|
|
275
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
276
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
275
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
276
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
277
277
|
|
|
278
278
|
abrManager.enable();
|
|
279
279
|
|
|
280
280
|
// Make another call to segmentDownloaded(). switchCallback() will be
|
|
281
281
|
// called to upgrade.
|
|
282
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
282
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
283
283
|
|
|
284
284
|
// The second parameter is missing to indicate that the buffer should not be
|
|
285
285
|
// cleared.
|
|
@@ -300,14 +300,14 @@ describe('SimpleAbrManager', () => {
|
|
|
300
300
|
abrManager.setVariants(variants);
|
|
301
301
|
abrManager.chooseVariant();
|
|
302
302
|
|
|
303
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
304
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
303
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
304
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
305
305
|
|
|
306
306
|
abrManager.enable();
|
|
307
307
|
|
|
308
308
|
// Make another call to segmentDownloaded(). switchCallback() will be
|
|
309
309
|
// called to upgrade.
|
|
310
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
310
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
311
311
|
|
|
312
312
|
// The second parameter is missing to indicate that the buffer should not be
|
|
313
313
|
// cleared.
|
|
@@ -327,14 +327,14 @@ describe('SimpleAbrManager', () => {
|
|
|
327
327
|
abrManager.setVariants(variants);
|
|
328
328
|
abrManager.chooseVariant();
|
|
329
329
|
|
|
330
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
331
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
330
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
331
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
332
332
|
|
|
333
333
|
abrManager.enable();
|
|
334
334
|
|
|
335
335
|
// Make another call to segmentDownloaded(). switchCallback() will be
|
|
336
336
|
// called to downgrade.
|
|
337
|
-
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
337
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond, true);
|
|
338
338
|
|
|
339
339
|
// The second parameter is missing to indicate that the buffer should not be
|
|
340
340
|
// cleared.
|
|
@@ -16,10 +16,11 @@ describe('Ad manager', () => {
|
|
|
16
16
|
/** @type {google.ima.AdsRenderingSettings} */
|
|
17
17
|
let adsRenderingSettings;
|
|
18
18
|
|
|
19
|
-
beforeEach(() => {
|
|
19
|
+
beforeEach(async () => {
|
|
20
20
|
window['google'] = null;
|
|
21
21
|
mockVideo = new shaka.test.FakeVideo();
|
|
22
|
-
player = new shaka.Player(
|
|
22
|
+
player = new shaka.Player();
|
|
23
|
+
await player.attach(mockVideo, /* initializeMediaSource= */ false);
|
|
23
24
|
adManager = player.getAdManager();
|
|
24
25
|
expect(adManager instanceof shaka.ads.AdManager).toBe(true);
|
|
25
26
|
|
|
@@ -65,7 +65,7 @@ filterDescribe('CastReceiver', castReceiverIntegrationSupport, () => {
|
|
|
65
65
|
support = await shaka.media.DrmEngine.probeSupport();
|
|
66
66
|
});
|
|
67
67
|
|
|
68
|
-
beforeEach(() => {
|
|
68
|
+
beforeEach(async () => {
|
|
69
69
|
mockReceiverApi = createMockReceiverApi();
|
|
70
70
|
|
|
71
71
|
const mockCanDisplayType = jasmine.createSpy('canDisplayType');
|
|
@@ -87,7 +87,8 @@ filterDescribe('CastReceiver', castReceiverIntegrationSupport, () => {
|
|
|
87
87
|
|
|
88
88
|
document.body.appendChild(video);
|
|
89
89
|
|
|
90
|
-
player = new shaka.Player(
|
|
90
|
+
player = new shaka.Player();
|
|
91
|
+
await player.attach(video);
|
|
91
92
|
receiver = new CastReceiver(video, player);
|
|
92
93
|
|
|
93
94
|
toRestore = [];
|
|
@@ -320,8 +321,6 @@ filterDescribe('CastReceiver', castReceiverIntegrationSupport, () => {
|
|
|
320
321
|
// Add wrappers to various methods along player.load to make sure that,
|
|
321
322
|
// at each stage, the cast receiver can form an update message without
|
|
322
323
|
// causing an error.
|
|
323
|
-
waitForUpdateMessageWrapper(
|
|
324
|
-
shaka.media.ManifestParser, 'ManifestParser', 'getFactory');
|
|
325
324
|
waitForUpdateMessageWrapper(
|
|
326
325
|
// eslint-disable-next-line no-restricted-syntax
|
|
327
326
|
shaka.test.TestScheme.ManifestParser.prototype, 'ManifestParser',
|
|
@@ -21,11 +21,13 @@ describe('CastUtils', () => {
|
|
|
21
21
|
'getMediaElement', // Handled specially
|
|
22
22
|
'setMaxHardwareResolution',
|
|
23
23
|
'destroy', // Should use CastProxy.destroy instead
|
|
24
|
+
'getAllThumbnails', // Too large to proxy.
|
|
24
25
|
'drmInfo', // Too large to proxy
|
|
25
26
|
'getManifest', // Too large to proxy
|
|
26
27
|
'getManifestParserFactory', // Would not serialize.
|
|
27
28
|
'setVideoContainer',
|
|
28
29
|
'getActiveSessionsMetadata',
|
|
30
|
+
'releaseAllMutexes', // Very specific to the inner workings of the player.
|
|
29
31
|
|
|
30
32
|
// Test helper methods (not @export'd)
|
|
31
33
|
'createDrmEngine',
|
|
@@ -519,6 +519,13 @@ describe('CeaDecoder', () => {
|
|
|
519
519
|
|
|
520
520
|
expect(decoder.reset).toHaveBeenCalledTimes(1);
|
|
521
521
|
});
|
|
522
|
+
|
|
523
|
+
it('does not attempt to extract SEI packet that is too short', () => {
|
|
524
|
+
const badData = new Uint8Array([0xb5]);
|
|
525
|
+
decoder.extract(badData, 0);
|
|
526
|
+
const captions = decoder.decode();
|
|
527
|
+
expect(captions.length).toBe(0);
|
|
528
|
+
});
|
|
522
529
|
});
|
|
523
530
|
|
|
524
531
|
describe('decodes CEA-708', () => {
|
|
@@ -26,7 +26,8 @@ describe('Codec Switching', () => {
|
|
|
26
26
|
|
|
27
27
|
beforeEach(async () => {
|
|
28
28
|
await shaka.test.TestScheme.createManifests(compiledShaka, '_compiled');
|
|
29
|
-
player = new compiledShaka.Player(
|
|
29
|
+
player = new compiledShaka.Player();
|
|
30
|
+
await player.attach(video);
|
|
30
31
|
|
|
31
32
|
// Disable stall detection, which can interfere with playback tests.
|
|
32
33
|
player.configure('streaming.stallEnabled', false);
|
|
@@ -31,7 +31,8 @@ describe('DashParser', () => {
|
|
|
31
31
|
|
|
32
32
|
beforeEach(async () => {
|
|
33
33
|
await shaka.test.TestScheme.createManifests(compiledShaka, '_compiled');
|
|
34
|
-
player = new compiledShaka.Player(
|
|
34
|
+
player = new compiledShaka.Player();
|
|
35
|
+
await player.attach(video);
|
|
35
36
|
|
|
36
37
|
// Disable stall detection, which can interfere with playback tests.
|
|
37
38
|
player.configure('streaming.stallEnabled', false);
|
|
@@ -661,25 +661,6 @@ describe('DashParser Live', () => {
|
|
|
661
661
|
expect(delay).toBe(updateTime);
|
|
662
662
|
});
|
|
663
663
|
|
|
664
|
-
it('still updates when @minimumUpdatePeriod is zero', async () => {
|
|
665
|
-
const lines = [
|
|
666
|
-
'<SegmentTemplate startNumber="1" media="s$Number$.mp4" duration="2" />',
|
|
667
|
-
];
|
|
668
|
-
// updateTime parameter sets @minimumUpdatePeriod in the manifest.
|
|
669
|
-
const manifestText = makeSimpleLiveManifestText(lines, /* updateTime= */ 0);
|
|
670
|
-
|
|
671
|
-
/** @type {!jasmine.Spy} */
|
|
672
|
-
const tickAfter = updateTickSpy();
|
|
673
|
-
Date.now = () => 0;
|
|
674
|
-
|
|
675
|
-
fakeNetEngine.setResponseText('dummy://foo', manifestText);
|
|
676
|
-
await parser.start('dummy://foo', playerInterface);
|
|
677
|
-
|
|
678
|
-
expect(tickAfter).toHaveBeenCalledTimes(1);
|
|
679
|
-
const delay = tickAfter.calls.mostRecent().args[0];
|
|
680
|
-
expect(delay).toBe(0);
|
|
681
|
-
});
|
|
682
|
-
|
|
683
664
|
it('does not update when @minimumUpdatePeriod is missing', async () => {
|
|
684
665
|
const lines = [
|
|
685
666
|
'<SegmentTemplate startNumber="1" media="s$Number$.mp4" duration="2" />',
|