shaka-player 4.2.9 → 4.2.10

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 (80) hide show
  1. package/.github/workflows/selenium-lab-tests.yaml +23 -1
  2. package/AUTHORS +2 -1
  3. package/CHANGELOG.md +27 -0
  4. package/CONTRIBUTORS +4 -1
  5. package/dist/controls.css +1 -1
  6. package/dist/demo.compiled.debug.js +154 -276
  7. package/dist/demo.compiled.debug.map +4 -4
  8. package/dist/demo.compiled.js +154 -276
  9. package/dist/demo.compiled.map +4 -4
  10. package/dist/deps.js +1 -1
  11. package/dist/locales.js +30 -30
  12. package/dist/receiver.compiled.debug.js +36 -65
  13. package/dist/receiver.compiled.debug.map +4 -4
  14. package/dist/receiver.compiled.js +36 -65
  15. package/dist/receiver.compiled.map +4 -4
  16. package/dist/shaka-player.compiled.d.ts +12 -3
  17. package/dist/shaka-player.compiled.debug.d.ts +12 -3
  18. package/dist/shaka-player.compiled.debug.externs.js +17 -12
  19. package/dist/shaka-player.compiled.debug.js +150 -147
  20. package/dist/shaka-player.compiled.debug.map +4 -4
  21. package/dist/shaka-player.compiled.externs.js +17 -12
  22. package/dist/shaka-player.compiled.js +822 -820
  23. package/dist/shaka-player.compiled.map +3 -3
  24. package/dist/shaka-player.ui.d.ts +12 -3
  25. package/dist/shaka-player.ui.debug.d.ts +12 -3
  26. package/dist/shaka-player.ui.debug.externs.js +5 -0
  27. package/dist/shaka-player.ui.debug.js +160 -157
  28. package/dist/shaka-player.ui.debug.map +3 -3
  29. package/dist/shaka-player.ui.externs.js +5 -0
  30. package/dist/shaka-player.ui.js +952 -949
  31. package/dist/shaka-player.ui.map +3 -3
  32. package/docs/tutorials/a11y.md +0 -4
  33. package/docs/tutorials/ad_monetization.md +0 -4
  34. package/docs/tutorials/basic-usage.md +0 -5
  35. package/docs/tutorials/config.md +0 -5
  36. package/docs/tutorials/debugging.md +0 -5
  37. package/docs/tutorials/drm-config.md +0 -5
  38. package/docs/tutorials/fairplay.md +2 -2
  39. package/docs/tutorials/license-server-auth.md +0 -5
  40. package/docs/tutorials/license-wrapping.md +0 -5
  41. package/docs/tutorials/network-and-buffering-config.md +0 -5
  42. package/docs/tutorials/ui-customization.md +0 -5
  43. package/docs/tutorials/ui.md +0 -7
  44. package/docs/tutorials/welcome.md +0 -5
  45. package/externs/network_information.js +7 -2
  46. package/externs/shaka/abr_manager.js +6 -0
  47. package/externs/shaka/net.js +1 -0
  48. package/externs/shaka/player.js +13 -7
  49. package/lib/abr/simple_abr_manager.js +27 -3
  50. package/lib/ads/client_side_ad_manager.js +6 -3
  51. package/lib/dash/dash_parser.js +49 -48
  52. package/lib/debug/log.js +9 -13
  53. package/lib/media/media_source_engine.js +11 -4
  54. package/lib/media/segment_index.js +2 -0
  55. package/lib/media/streaming_engine.js +8 -3
  56. package/lib/net/http_fetch_plugin.js +79 -57
  57. package/lib/net/networking_engine.js +1 -0
  58. package/lib/player.js +22 -3
  59. package/lib/polyfill/media_capabilities.js +13 -0
  60. package/lib/text/mp4_vtt_parser.js +4 -0
  61. package/lib/text/text_engine.js +1 -0
  62. package/lib/util/manifest_parser_utils.js +1 -2
  63. package/lib/util/mime_utils.js +11 -0
  64. package/lib/util/periods.js +5 -5
  65. package/lib/util/stream_utils.js +2 -2
  66. package/maintained-branches.md +3 -4
  67. package/package.json +1 -1
  68. package/test/media/content_workarounds_unit.js +43 -0
  69. package/test/media/drm_engine_integration.js +4 -17
  70. package/test/media/streaming_engine_unit.js +6 -1
  71. package/test/net/networking_engine_unit.js +6 -1
  72. package/test/player_integration.js +39 -0
  73. package/test/player_unit.js +57 -0
  74. package/test/polyfill/media_capabilities_unit.js +0 -1
  75. package/test/test/assets/text-clip-alt.vtt +63 -0
  76. package/test/test/util/fake_drm_engine.js +3 -0
  77. package/test/test/util/simple_fakes.js +6 -0
  78. package/test/test/util/test_scheme.js +9 -14
  79. package/test/text/mp4_vtt_parser_unit.js +8 -0
  80. package/test/util/mime_utils_unit.js +10 -0
@@ -0,0 +1,63 @@
1
+ WEBVTT
2
+
3
+ 00:04.000 --> 00:07.300
4
+ Journal de bord du capitaine.
5
+ Date stellaire 41636.9.
6
+
7
+ 00:07.500 --> 00:11.800
8
+ Comme nous le craignions, l'épave
9
+ du cargo Odin de la Fédération,
10
+
11
+ 00:12.100 --> 00:16.400
12
+ percuté par un astéroïde,
13
+ ne révèle aucun signe de vie.
14
+
15
+ 00:16.700 --> 00:19.000
16
+ Mais trois nacelles
17
+ de sauvetage manquaient,
18
+
19
+ 00:19.300 --> 00:21.900
20
+ laissant supposer
21
+ qu'il y aurait des survivants.
22
+
23
+ 00:22.700 --> 00:27.700
24
+ - Mise sur orbite Angel One, paré.
25
+ - Quel genre d'endroit, Data ?
26
+
27
+ 00:28.200 --> 00:31.600
28
+ Planète de Classe-M.
29
+ Faune et flore à base de carbone.
30
+
31
+ 00:31.900 --> 00:34.300
32
+ Population éparse
33
+ et forme de vie intelligente.
34
+
35
+ 00:34.600 --> 00:38.400
36
+ Développement technique équivalent
37
+ au milieu du 20ème siècle terrien.
38
+
39
+ 00:38.800 --> 00:41.000
40
+ C'est presque un retour aux sources.
41
+
42
+ 00:41.300 --> 00:43.600
43
+ Si jamais des survivants
44
+ ont pu aller si loin,
45
+
46
+ 00:43.800 --> 00:49.000
47
+ c'était la planète la plus proche.
48
+ La distance qui nous a pris 2 jours
49
+
50
+ 00:49.500 --> 00:52.400
51
+ aurait pris 5 mois aux nacelles
52
+ de sauvetage du Odin.
53
+
54
+ 00:52.600 --> 00:54.700
55
+ Cinq mois, six jours, onze heures,
56
+ deux min...
57
+
58
+ 00:54.900 --> 00:58.400
59
+ - Merci, Data.
60
+ - ..et 57 secondes.
61
+
62
+ 00:58.600 --> 01:01.300
63
+ Signal audio provenant d'Angel One.
@@ -81,6 +81,9 @@ shaka.test.FakeDrmEngine = class {
81
81
  /** @type {!jasmine.Spy} */
82
82
  this.supportsVariant = jasmine.createSpy('supportsVariant');
83
83
  this.supportsVariant.and.returnValue(true);
84
+
85
+ /** @type {!jasmine.Spy} */
86
+ this.setSrcEquals = jasmine.createSpy('setSrcEquals');
84
87
  }
85
88
 
86
89
  /**
@@ -35,6 +35,9 @@ shaka.test.FakeAbrManager = class {
35
35
  /** @type {!jasmine.Spy} */
36
36
  this.stop = jasmine.createSpy('stop');
37
37
 
38
+ /** @type {!jasmine.Spy} */
39
+ this.release = jasmine.createSpy('release');
40
+
38
41
  /** @type {!jasmine.Spy} */
39
42
  this.enable = jasmine.createSpy('enable');
40
43
 
@@ -225,6 +228,9 @@ shaka.test.FakeVideo = class {
225
228
 
226
229
  /** @type {!jasmine.Spy} */
227
230
  this.dispatchEvent = jasmine.createSpy('dispatchEvent');
231
+
232
+ /** @type {!jasmine.Spy} */
233
+ this.canPlayType = jasmine.createSpy('canPlayType');
228
234
  }
229
235
  };
230
236
 
@@ -447,6 +447,7 @@ const widevineDrmServers = {
447
447
 
448
448
  /** @type {AVMetadataType} */
449
449
  const axinomMultiDrmVideoSegment = {
450
+ // Taken from Axinom's v6 test vector.
450
451
  initSegmentUri: '/base/test/test/assets/multidrm-video-init.mp4',
451
452
  mdhdOffset: 0x1d1,
452
453
  segmentUri: '/base/test/test/assets/multidrm-video-segment.mp4',
@@ -461,6 +462,7 @@ const axinomMultiDrmVideoSegment = {
461
462
 
462
463
  /** @type {AVMetadataType} */
463
464
  const axinomMultiDrmAudioSegment = {
465
+ // Taken from Axinom's v6 test vector.
464
466
  initSegmentUri: '/base/test/test/assets/multidrm-audio-init.mp4',
465
467
  mdhdOffset: 0x192,
466
468
  segmentUri: '/base/test/test/assets/multidrm-audio-segment.mp4',
@@ -475,20 +477,15 @@ const axinomMultiDrmAudioSegment = {
475
477
 
476
478
  /** @type {!Object.<string, string>} */
477
479
  const axinomDrmServers = {
480
+ // NOTE: These are not Axinom's actual servers. These are test servers for
481
+ // Widevine and PlayReady that let us specify the known key IDs and keys for
482
+ // Axinom's v6 test vectors. Axinom's own servers started returning 403
483
+ // errors for these older test vectors, and we were forced to switch to
484
+ // something stable and independent.
478
485
  'com.widevine.alpha':
479
- 'https://drm-widevine-licensing.axtest.net/AcquireLicense',
486
+ 'https://cwip-shaka-proxy.appspot.com/specific_key?blodJidXR9eARuql0dNLWg=GX8m9XLIZNIzizrl0RTqnA',
480
487
  'com.microsoft.playready':
481
- 'https://drm-playready-licensing.axtest.net/AcquireLicense',
482
- };
483
-
484
- /** @type {!Object.<string, string>} */
485
- const axinomDrmHeaders = {
486
- 'X-AxDRM-Message':
487
- 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5' +
488
- 'X2lkIjoiNjllNTQwODgtZTllMC00NTMwLThjMWEtMWViNmRjZDBkMTRlIiwibWVzc' +
489
- '2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImtleXMiOlt7ImlkIj' +
490
- 'oiNmU1YTFkMjYtMjc1Ny00N2Q3LTgwNDYtZWFhNWQxZDM0YjVhIn1dfX0.yF7PflO' +
491
- 'Pv9qHnu3ZWJNZ12jgkqTabmwXbDWk_47tLNE',
488
+ 'https://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(kid:6e5a1d26-2757-47d7-8046-eaa5d1d34b5a,contentkey:GX8m9XLIZNIzizrl0RTqnA==,sl:150)',
492
489
  };
493
490
 
494
491
  /** @type {TextMetadataType} */
@@ -601,7 +598,6 @@ shaka.test.TestScheme.DATA = {
601
598
  audio: axinomMultiDrmAudioSegment,
602
599
  text: vttSegment,
603
600
  licenseServers: axinomDrmServers,
604
- licenseRequestHeaders: axinomDrmHeaders,
605
601
  duration: 30,
606
602
  sequenceMode: false,
607
603
  },
@@ -614,7 +610,6 @@ shaka.test.TestScheme.DATA = {
614
610
  initData: undefined,
615
611
  }),
616
612
  licenseServers: axinomDrmServers,
617
- licenseRequestHeaders: axinomDrmHeaders,
618
613
  duration: 30,
619
614
  sequenceMode: false,
620
615
  },
@@ -171,6 +171,14 @@ describe('Mp4VttParser', () => {
171
171
  verifyHelper(cues, result);
172
172
  });
173
173
 
174
+ it('handles empty media segments', () => {
175
+ const parser = new shaka.text.Mp4VttParser();
176
+ parser.parseInit(vttInitSegment);
177
+ const time = {periodStart: 0, segmentStart: 0, segmentEnd: 0, vttOffset: 0};
178
+ const result = parser.parseMedia(new Uint8Array(0), time);
179
+ verifyHelper([], result);
180
+ });
181
+
174
182
  it('rejects init segment with no vtt', () => {
175
183
  const error = shaka.test.Util.jasmineError(new shaka.util.Error(
176
184
  shaka.util.Error.Severity.CRITICAL,
@@ -51,4 +51,14 @@ describe('MimeUtils', () => {
51
51
  expect(getNormalizedCodec('dvh1.05')).toBe('dovi');
52
52
  expect(getNormalizedCodec('dvhe.05')).toBe('dovi');
53
53
  });
54
+
55
+ it('isHlsType', () => {
56
+ const isHlsType = (mimeType) => shaka.util.MimeUtils.isHlsType(mimeType);
57
+
58
+ expect(isHlsType('application/x-mpegurl')).toBe(true);
59
+ expect(isHlsType('application/vnd.apple.mpegurl')).toBe(true);
60
+ expect(isHlsType('application/dash+xml')).toBe(false);
61
+ expect(isHlsType('application/vnd.ms-sstr+xml')).toBe(false);
62
+ expect(isHlsType('foo')).toBe(false);
63
+ });
54
64
  });