shaka-player 3.1.4 → 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 (43) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/controls.css +2 -2
  3. package/dist/controls.css.map +1 -1
  4. package/dist/locales.js +29 -29
  5. package/dist/shaka-player.compiled.d.ts +14 -0
  6. package/dist/shaka-player.compiled.debug.d.ts +14 -0
  7. package/dist/shaka-player.compiled.debug.externs.js +11 -0
  8. package/dist/shaka-player.compiled.debug.js +170 -168
  9. package/dist/shaka-player.compiled.debug.map +3 -3
  10. package/dist/shaka-player.compiled.externs.js +11 -0
  11. package/dist/shaka-player.compiled.js +650 -650
  12. package/dist/shaka-player.compiled.map +2 -2
  13. package/dist/shaka-player.ui.d.ts +14 -0
  14. package/dist/shaka-player.ui.debug.d.ts +14 -0
  15. package/dist/shaka-player.ui.debug.externs.js +11 -0
  16. package/dist/shaka-player.ui.debug.js +178 -176
  17. package/dist/shaka-player.ui.debug.map +3 -3
  18. package/dist/shaka-player.ui.externs.js +11 -0
  19. package/dist/shaka-player.ui.js +792 -792
  20. package/dist/shaka-player.ui.map +2 -2
  21. package/externs/shaka/text.js +10 -0
  22. package/lib/dash/dash_parser.js +4 -2
  23. package/lib/media/streaming_engine.js +5 -2
  24. package/lib/player.js +1 -1
  25. package/lib/polyfill/media_capabilities.js +30 -15
  26. package/lib/text/cue.js +6 -0
  27. package/lib/text/ttml_text_parser.js +84 -58
  28. package/lib/text/ui_text_displayer.js +17 -11
  29. package/lib/util/stream_utils.js +58 -7
  30. package/lib/util/xml_utils.js +19 -0
  31. package/package.json +2 -2
  32. package/test/dash/dash_parser_manifest_unit.js +33 -1
  33. package/test/media/drm_engine_unit.js +3 -3
  34. package/test/media/streaming_engine_integration.js +2 -1
  35. package/test/media/streaming_engine_unit.js +145 -0
  36. package/test/player_unit.js +5 -5
  37. package/test/test/util/ttml_utils.js +81 -0
  38. package/test/text/mp4_ttml_parser_unit.js +11 -18
  39. package/test/text/ttml_text_parser_unit.js +495 -228
  40. package/test/util/stream_utils_unit.js +35 -29
  41. package/ui/less/buttons.less +0 -4
  42. package/ui/text_selection.js +1 -0
  43. package/externs/media_capabilities.js +0 -16
@@ -16,14 +16,14 @@ describe('StreamUtils', () => {
16
16
  /** @type {!jasmine.Spy} */
17
17
  let decodingInfoSpy;
18
18
 
19
- const originalDecodingInfo = window.shakaMediaCapabilities.decodingInfo;
19
+ const originalDecodingInfo = navigator.mediaCapabilities.decodingInfo;
20
20
 
21
21
  beforeEach(() => {
22
22
  decodingInfoSpy = jasmine.createSpy('decodingInfo');
23
23
  });
24
24
 
25
25
  afterEach(() => {
26
- window.shakaMediaCapabilities.decodingInfo = originalDecodingInfo;
26
+ navigator.mediaCapabilities.decodingInfo = originalDecodingInfo;
27
27
  });
28
28
 
29
29
  describe('filterStreamsByLanguageAndRole', () => {
@@ -511,7 +511,7 @@ describe('StreamUtils', () => {
511
511
  });
512
512
 
513
513
  it('handles decodingInfo exception', async () => {
514
- window.shakaMediaCapabilities.decodingInfo =
514
+ navigator.mediaCapabilities.decodingInfo =
515
515
  shaka.test.Util.spyFunc(decodingInfoSpy);
516
516
  // If decodingInfo() fails, setDecodingInfo should finish without throwing
517
517
  // an exception, and the variant should have no decodingInfo result.
@@ -539,38 +539,44 @@ describe('StreamUtils', () => {
539
539
  });
540
540
 
541
541
  it('includes transferFunction in config when hdr', async () => {
542
- window.shakaMediaCapabilities.decodingInfo =
543
- shaka.test.Util.spyFunc(decodingInfoSpy);
542
+ const originalDecodingInfo = navigator.mediaCapabilities.decodingInfo;
544
543
 
545
- manifest = shaka.test.ManifestGenerator.generate((manifest) => {
546
- manifest.addVariant(0, (variant) => {
547
- variant.addVideo(0, (stream) => {
548
- stream.mime('video/mp4', 'avc1.640028');
549
- stream.hdr = 'SDR';
544
+ try {
545
+ navigator.mediaCapabilities.decodingInfo =
546
+ shaka.test.Util.spyFunc(decodingInfoSpy);
547
+
548
+ manifest = shaka.test.ManifestGenerator.generate((manifest) => {
549
+ manifest.addVariant(0, (variant) => {
550
+ variant.addVideo(0, (stream) => {
551
+ stream.mime('video/mp4', 'avc1.640028');
552
+ stream.hdr = 'SDR';
553
+ });
550
554
  });
551
- });
552
- manifest.addVariant(1, (variant) => {
553
- variant.addVideo(1, (stream) => {
554
- stream.mime('video/mp4', 'hvc1.2.4.L150.90');
555
- stream.hdr = 'PQ';
555
+ manifest.addVariant(1, (variant) => {
556
+ variant.addVideo(1, (stream) => {
557
+ stream.mime('video/mp4', 'hvc1.2.4.L150.90');
558
+ stream.hdr = 'PQ';
559
+ });
556
560
  });
557
- });
558
- manifest.addVariant(2, (variant) => {
559
- variant.addVideo(2, (stream) => {
560
- stream.mime('video/mp4', 'hvc1.2.4.L153.B0');
561
- stream.hdr = 'HLG';
561
+ manifest.addVariant(2, (variant) => {
562
+ variant.addVideo(2, (stream) => {
563
+ stream.mime('video/mp4', 'hvc1.2.4.L153.B0');
564
+ stream.hdr = 'HLG';
565
+ });
562
566
  });
563
567
  });
564
- });
565
568
 
566
- await StreamUtils.getDecodingInfosForVariants(manifest.variants,
567
- /* usePersistentLicenses= */ false, /* srcEquals= */ false);
568
- expect(decodingInfoSpy.calls.argsFor(0)[0].video.transferFunction)
569
- .toBe('srgb');
570
- expect(decodingInfoSpy.calls.argsFor(1)[0].video.transferFunction)
571
- .toBe('pq');
572
- expect(decodingInfoSpy.calls.argsFor(2)[0].video.transferFunction)
573
- .toBe('hlg');
569
+ await StreamUtils.getDecodingInfosForVariants(manifest.variants,
570
+ /* usePersistentLicenses= */ false, /* srcEquals= */ false);
571
+ expect(decodingInfoSpy.calls.argsFor(0)[0].video.transferFunction)
572
+ .toBe('srgb');
573
+ expect(decodingInfoSpy.calls.argsFor(1)[0].video.transferFunction)
574
+ .toBe('pq');
575
+ expect(decodingInfoSpy.calls.argsFor(2)[0].video.transferFunction)
576
+ .toBe('hlg');
577
+ } finally {
578
+ navigator.mediaCapabilities.decodingInfo = originalDecodingInfo;
579
+ }
574
580
  });
575
581
  });
576
582
 
@@ -75,10 +75,6 @@
75
75
  .shaka-current-time {
76
76
  font-size: 14px;
77
77
  color: rgb(255, 255, 255);
78
-
79
- /* Make the time element the right size for the text, instead of defaulting
80
- * to the same size as the rest of the controls. */
81
- height: auto;
82
78
  cursor: pointer;
83
79
 
84
80
  &[disabled] {
@@ -65,6 +65,7 @@ shaka.ui.TextSelection = class extends shaka.ui.SettingsMenu {
65
65
 
66
66
  this.eventManager.listen(this.player, 'texttrackvisibility', () => {
67
67
  this.onCaptionStateChange_();
68
+ this.updateTextLanguages_();
68
69
  });
69
70
 
70
71
  this.eventManager.listen(this.player, 'textchanged', () => {
@@ -1,16 +0,0 @@
1
- /*! @license
2
- * Shaka Player
3
- * Copyright 2016 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
-
7
- /**
8
- * @fileoverview Externs for Shaka MediaCapabilities which were missing in the
9
- * Closure compiler.
10
- *
11
- * @externs
12
- */
13
-
14
-
15
- /** @type {MediaCapabilities} */
16
- window.shakaMediaCapabilities;