shaka-player 4.2.3 → 4.3.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/workflows/sync-labels.yaml +1 -1
- package/.github/workflows/update-issues.yaml +1 -1
- package/AUTHORS +5 -0
- package/CHANGELOG.md +85 -39
- package/CONTRIBUTORS +5 -0
- package/README.md +14 -0
- package/demo/common/assets.js +58 -0
- package/demo/common/message_ids.js +22 -1
- package/demo/config.js +89 -5
- package/demo/demo.less +7 -1
- package/demo/index.html +8 -1
- package/demo/locales/en.json +21 -1
- package/demo/locales/source.json +82 -2
- package/demo/main.js +57 -1
- package/demo/search.js +2 -0
- package/demo/visualizer.js +337 -0
- package/demo/visualizer_button.js +103 -0
- package/dist/controls.css +1 -1
- package/dist/controls.css.map +1 -1
- package/dist/demo.compiled.debug.js +83 -58
- package/dist/demo.compiled.debug.map +4 -4
- package/dist/demo.compiled.js +83 -58
- package/dist/demo.compiled.map +4 -4
- package/dist/demo.css +1 -1
- package/dist/demo.css.map +1 -1
- package/dist/deps.js +18 -11
- package/dist/locales.js +32 -32
- package/dist/receiver.compiled.debug.js +23 -19
- package/dist/receiver.compiled.debug.map +3 -3
- package/dist/receiver.compiled.js +23 -19
- package/dist/receiver.compiled.map +3 -3
- package/dist/shaka-player.compiled.d.ts +178 -27
- package/dist/shaka-player.compiled.debug.d.ts +178 -27
- package/dist/shaka-player.compiled.debug.externs.js +163 -32
- package/dist/shaka-player.compiled.debug.js +488 -422
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +163 -32
- package/dist/shaka-player.compiled.js +895 -857
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +178 -27
- package/dist/shaka-player.ui.debug.d.ts +178 -27
- package/dist/shaka-player.ui.debug.externs.js +163 -32
- package/dist/shaka-player.ui.debug.js +519 -450
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +163 -32
- package/dist/shaka-player.ui.js +1053 -1015
- package/dist/shaka-player.ui.map +4 -4
- package/docs/design/lcevc-architecture.png +0 -0
- package/docs/design/lcevc-demo.png +0 -0
- package/docs/design/lcevc-integration.md +72 -0
- package/docs/tutorials/fairplay.md +7 -0
- package/docs/tutorials/faq.md +1 -1
- package/docs/tutorials/ui.md +7 -7
- package/docs/tutorials/upgrade.md +6 -0
- package/externs/ima.js +13 -1
- package/externs/lcevc.js +81 -0
- package/externs/mux.js +4 -42
- package/externs/shaka/ads.js +11 -1
- package/externs/shaka/manifest_parser.js +5 -1
- package/externs/shaka/player.js +178 -15
- package/lib/abr/simple_abr_manager.js +7 -0
- package/lib/ads/ad_manager.js +0 -8
- package/lib/ads/client_side_ad.js +15 -0
- package/lib/ads/client_side_ad_manager.js +21 -8
- package/lib/ads/server_side_ad.js +15 -0
- package/lib/ads/server_side_ad_manager.js +3 -3
- package/lib/cast/cast_proxy.js +2 -1
- package/lib/cast/cast_receiver.js +19 -5
- package/lib/cast/cast_sender.js +2 -1
- package/lib/cast/cast_utils.js +18 -6
- package/lib/cea/dummy_cea_parser.js +28 -0
- package/lib/cea/i_cea_parser.js +14 -2
- package/lib/cea/mp4_cea_parser.js +87 -5
- package/lib/config/auto_show_text.js +33 -0
- package/lib/dash/dash_parser.js +1 -1
- package/lib/hls/hls_parser.js +799 -376
- package/lib/lcevc/lcevc_dil.js +152 -0
- package/lib/media/closed_caption_parser.js +9 -6
- package/lib/media/drm_engine.js +14 -6
- package/lib/media/media_source_engine.js +112 -26
- package/lib/media/playhead.js +23 -1
- package/lib/media/presentation_timeline.js +26 -11
- package/lib/media/segment_reference.js +49 -1
- package/lib/media/streaming_engine.js +145 -24
- package/lib/media/transmuxer.js +79 -18
- package/lib/offline/storage.js +1 -0
- package/lib/player.js +477 -85
- package/lib/polyfill/patchedmediakeys_apple.js +55 -1
- package/lib/text/ui_text_displayer.js +5 -5
- package/lib/text/vtt_text_parser.js +35 -1
- package/lib/util/dom_utils.js +0 -1
- package/lib/util/error.js +17 -0
- package/lib/util/fake_event.js +2 -0
- package/lib/util/id3_utils.js +300 -0
- package/lib/util/manifest_parser_utils.js +4 -0
- package/lib/util/mime_utils.js +3 -6
- package/lib/util/mp4_box_parsers.js +15 -5
- package/lib/util/platform.js +9 -1
- package/lib/util/player_configuration.js +23 -1
- package/lib/util/ts_parser.js +499 -0
- package/maintained-branches.md +2 -2
- package/package.json +4 -1
- package/roadmap.md +27 -7
- package/test/ads/ad_manager_unit.js +180 -29
- package/test/cast/cast_receiver_integration.js +97 -16
- package/test/cast/cast_receiver_unit.js +17 -12
- package/test/cast/cast_utils_unit.js +4 -1
- package/test/dash/dash_parser_content_protection_unit.js +1 -0
- package/test/dash/dash_parser_live_unit.js +1 -0
- package/test/dash/dash_parser_manifest_unit.js +93 -1
- package/test/dash/dash_parser_segment_base_unit.js +1 -0
- package/test/dash/dash_parser_segment_list_unit.js +1 -0
- package/test/dash/dash_parser_segment_template_unit.js +1 -0
- package/test/demo/demo_unit.js +2 -1
- package/test/hls/hls_live_unit.js +253 -19
- package/test/hls/hls_parser_unit.js +500 -12
- package/test/media/closed_caption_parser_unit.js +2 -1
- package/test/media/drm_engine_integration.js +3 -1
- package/test/media/media_source_engine_integration.js +102 -6
- package/test/media/media_source_engine_unit.js +10 -5
- package/test/media/playhead_unit.js +41 -0
- package/test/media/streaming_engine_integration.js +17 -1
- package/test/media/streaming_engine_unit.js +180 -24
- package/test/media/transmuxer_integration.js +21 -10
- package/test/player_integration.js +224 -82
- package/test/player_unit.js +92 -2
- package/test/polyfill/patchedmediakeys_apple_unit.js +124 -0
- package/test/test/assets/id3-metadata.aac +0 -0
- package/test/test/assets/id3-metadata.ts +0 -0
- package/test/test/assets/thumbnails-sprites.vtt +10 -0
- package/test/test/assets/thumbnails.vtt +10 -0
- package/test/test/util/dash_parser_util.js +2 -0
- package/test/test/util/fake_ad.js +21 -0
- package/test/test/util/fake_media_source_engine.js +7 -0
- package/test/test/util/id3_generator.js +100 -0
- package/test/test/util/manifest_generator.js +3 -6
- package/test/test/util/simple_fakes.js +7 -0
- package/test/test/util/stream_generator.js +38 -0
- package/test/test/util/test_scheme.js +43 -14
- package/test/text/vtt_text_parser_unit.js +11 -0
- package/test/ui/text_displayer_layout_unit.js +14 -0
- package/test/util/id3_utils_unit.js +116 -0
- package/test/util/ts_parser_unit.js +77 -0
- package/ui/controls.js +4 -1
- package/ui/less/containers.less +7 -0
- package/ui/settings_menu.js +11 -2
- package/ui/ui.js +43 -4
package/ui/ui.js
CHANGED
|
@@ -290,6 +290,12 @@ shaka.ui.Overlay = class {
|
|
|
290
290
|
const videos = document.querySelectorAll(
|
|
291
291
|
'[data-shaka-player]');
|
|
292
292
|
|
|
293
|
+
// Look for elements marked 'data-shaka-player-canvas'
|
|
294
|
+
// on the page. These will be used to create our default
|
|
295
|
+
// UI.
|
|
296
|
+
const canvases = document.querySelectorAll(
|
|
297
|
+
'[data-shaka-player-canvas]');
|
|
298
|
+
|
|
293
299
|
if (!videos.length && !containers.length) {
|
|
294
300
|
// No elements have been tagged with shaka attributes.
|
|
295
301
|
} else if (videos.length && !containers.length) {
|
|
@@ -307,8 +313,21 @@ shaka.ui.Overlay = class {
|
|
|
307
313
|
const videoParent = video.parentElement;
|
|
308
314
|
videoParent.replaceChild(container, video);
|
|
309
315
|
container.appendChild(video);
|
|
310
|
-
|
|
311
|
-
|
|
316
|
+
let currentCanvas = null;
|
|
317
|
+
for (const canvas of canvases) {
|
|
318
|
+
goog.asserts.assert(canvas.tagName.toLowerCase() == 'canvas',
|
|
319
|
+
'Should be a canvas element!');
|
|
320
|
+
if (canvas.parentElement == container) {
|
|
321
|
+
currentCanvas = canvas;
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
if (!currentCanvas) {
|
|
326
|
+
currentCanvas = document.createElement('canvas');
|
|
327
|
+
currentCanvas.classList.add('shaka-canvas-container');
|
|
328
|
+
container.appendChild(currentCanvas);
|
|
329
|
+
}
|
|
330
|
+
shaka.ui.Overlay.setupUIandAutoLoad_(container, video, currentCanvas);
|
|
312
331
|
}
|
|
313
332
|
} else {
|
|
314
333
|
for (const container of containers) {
|
|
@@ -336,9 +355,25 @@ shaka.ui.Overlay = class {
|
|
|
336
355
|
container.appendChild(currentVideo);
|
|
337
356
|
}
|
|
338
357
|
|
|
358
|
+
let currentCanvas = null;
|
|
359
|
+
for (const canvas of canvases) {
|
|
360
|
+
goog.asserts.assert(canvas.tagName.toLowerCase() == 'canvas',
|
|
361
|
+
'Should be a canvas element!');
|
|
362
|
+
if (canvas.parentElement == container) {
|
|
363
|
+
currentCanvas = canvas;
|
|
364
|
+
break;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
if (!currentCanvas) {
|
|
368
|
+
currentCanvas = document.createElement('canvas');
|
|
369
|
+
currentCanvas.classList.add('shaka-canvas-container');
|
|
370
|
+
container.appendChild(currentCanvas);
|
|
371
|
+
}
|
|
372
|
+
|
|
339
373
|
try {
|
|
340
374
|
// eslint-disable-next-line no-await-in-loop
|
|
341
|
-
await shaka.ui.Overlay.setupUIandAutoLoad_(
|
|
375
|
+
await shaka.ui.Overlay.setupUIandAutoLoad_(
|
|
376
|
+
container, currentVideo, currentCanvas);
|
|
342
377
|
} catch (e) {
|
|
343
378
|
// This can fail if, for example, not every player file has loaded.
|
|
344
379
|
// Ad-block is a likely cause for this sort of failure.
|
|
@@ -377,9 +412,10 @@ shaka.ui.Overlay = class {
|
|
|
377
412
|
/**
|
|
378
413
|
* @param {!Element} container
|
|
379
414
|
* @param {!Element} video
|
|
415
|
+
* @param {!Element} canvas
|
|
380
416
|
* @private
|
|
381
417
|
*/
|
|
382
|
-
static async setupUIandAutoLoad_(container, video) {
|
|
418
|
+
static async setupUIandAutoLoad_(container, video, canvas) {
|
|
383
419
|
// Create the UI
|
|
384
420
|
const player = new shaka.Player(
|
|
385
421
|
shaka.util.Dom.asHTMLMediaElement(video));
|
|
@@ -387,6 +423,9 @@ shaka.ui.Overlay = class {
|
|
|
387
423
|
shaka.util.Dom.asHTMLElement(container),
|
|
388
424
|
shaka.util.Dom.asHTMLMediaElement(video));
|
|
389
425
|
|
|
426
|
+
// Attach Canvas used for LCEVC Decoding
|
|
427
|
+
player.attachCanvas(/** @type {HTMLCanvasElement} */(canvas));
|
|
428
|
+
|
|
390
429
|
// Get and configure cast app id.
|
|
391
430
|
let castAppId = '';
|
|
392
431
|
|