shaka-player 3.2.2 → 3.2.3

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 (51) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/controls.css +2 -2
  3. package/dist/controls.css.map +1 -1
  4. package/dist/locales.js +30 -30
  5. package/dist/shaka-player.compiled.d.ts +21 -2
  6. package/dist/shaka-player.compiled.debug.d.ts +21 -2
  7. package/dist/shaka-player.compiled.debug.externs.js +22 -1
  8. package/dist/shaka-player.compiled.debug.js +205 -202
  9. package/dist/shaka-player.compiled.debug.map +3 -3
  10. package/dist/shaka-player.compiled.externs.js +22 -1
  11. package/dist/shaka-player.compiled.js +727 -723
  12. package/dist/shaka-player.compiled.map +4 -4
  13. package/dist/shaka-player.ui.d.ts +21 -2
  14. package/dist/shaka-player.ui.debug.d.ts +21 -2
  15. package/dist/shaka-player.ui.debug.externs.js +22 -1
  16. package/dist/shaka-player.ui.debug.js +221 -218
  17. package/dist/shaka-player.ui.debug.map +3 -3
  18. package/dist/shaka-player.ui.externs.js +22 -1
  19. package/dist/shaka-player.ui.js +829 -825
  20. package/dist/shaka-player.ui.map +4 -4
  21. package/externs/shaka/player.js +8 -0
  22. package/externs/shaka/text.js +10 -0
  23. package/lib/dash/dash_parser.js +4 -2
  24. package/lib/hls/hls_parser.js +30 -0
  25. package/lib/media/segment_index.js +2 -1
  26. package/lib/media/segment_reference.js +19 -1
  27. package/lib/media/streaming_engine.js +5 -2
  28. package/lib/player.js +20 -13
  29. package/lib/polyfill/media_capabilities.js +30 -15
  30. package/lib/text/cue.js +6 -0
  31. package/lib/text/ttml_text_parser.js +84 -58
  32. package/lib/text/ui_text_displayer.js +17 -11
  33. package/lib/util/stream_utils.js +86 -10
  34. package/lib/util/xml_utils.js +19 -0
  35. package/package.json +2 -2
  36. package/test/dash/dash_parser_manifest_unit.js +33 -1
  37. package/test/media/drm_engine_unit.js +3 -3
  38. package/test/media/streaming_engine_integration.js +2 -1
  39. package/test/media/streaming_engine_unit.js +145 -0
  40. package/test/player_integration.js +41 -8
  41. package/test/player_src_equals_integration.js +41 -8
  42. package/test/player_unit.js +19 -9
  43. package/test/test/assets/chapters.vtt +2 -2
  44. package/test/test/assets/chapters2.vtt +10 -0
  45. package/test/test/util/ttml_utils.js +81 -0
  46. package/test/text/mp4_ttml_parser_unit.js +11 -18
  47. package/test/text/ttml_text_parser_unit.js +495 -228
  48. package/test/util/stream_utils_unit.js +36 -30
  49. package/ui/less/buttons.less +0 -4
  50. package/ui/text_selection.js +1 -0
  51. 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
 
@@ -861,7 +867,7 @@ describe('StreamUtils', () => {
861
867
  });
862
868
  });
863
869
  });
864
- window.shakaMediaCapabilities.decodingInfo =
870
+ navigator.mediaCapabilities.decodingInfo =
865
871
  shaka.test.Util.spyFunc(decodingInfoSpy);
866
872
  decodingInfoSpy.and.callFake((config) => {
867
873
  const res = config.video.contentType.includes('notsmooth') ?
@@ -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] {
@@ -64,6 +64,7 @@ shaka.ui.TextSelection = class extends shaka.ui.SettingsMenu {
64
64
 
65
65
  this.eventManager.listen(this.player, 'texttrackvisibility', () => {
66
66
  this.onCaptionStateChange_();
67
+ this.updateTextLanguages_();
67
68
  });
68
69
 
69
70
  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;