shaka-player 4.3.0 → 4.3.2

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 (78) hide show
  1. package/.github/workflows/build-and-test.yaml +20 -0
  2. package/AUTHORS +2 -0
  3. package/CHANGELOG.md +44 -0
  4. package/CONTRIBUTORS +2 -0
  5. package/README.md +1 -1
  6. package/conditional/dummy_cast_proxy.js +120 -0
  7. package/dist/demo.compiled.debug.js +104 -110
  8. package/dist/demo.compiled.debug.map +3 -3
  9. package/dist/demo.compiled.js +104 -110
  10. package/dist/demo.compiled.map +3 -3
  11. package/dist/deps.js +8 -6
  12. package/dist/locales.js +32 -32
  13. package/dist/receiver.compiled.debug.js +54 -60
  14. package/dist/receiver.compiled.debug.map +3 -3
  15. package/dist/receiver.compiled.js +54 -60
  16. package/dist/receiver.compiled.map +3 -3
  17. package/dist/shaka-player.compiled.d.ts +19 -2
  18. package/dist/shaka-player.compiled.debug.d.ts +19 -2
  19. package/dist/shaka-player.compiled.debug.externs.js +102 -80
  20. package/dist/shaka-player.compiled.debug.js +657 -652
  21. package/dist/shaka-player.compiled.debug.map +4 -4
  22. package/dist/shaka-player.compiled.externs.js +102 -80
  23. package/dist/shaka-player.compiled.js +904 -901
  24. package/dist/shaka-player.compiled.map +4 -4
  25. package/dist/shaka-player.ui.d.ts +19 -2
  26. package/dist/shaka-player.ui.debug.d.ts +19 -2
  27. package/dist/shaka-player.ui.debug.externs.js +102 -80
  28. package/dist/shaka-player.ui.debug.js +703 -698
  29. package/dist/shaka-player.ui.debug.map +4 -4
  30. package/dist/shaka-player.ui.externs.js +102 -80
  31. package/dist/shaka-player.ui.js +1029 -1026
  32. package/dist/shaka-player.ui.map +4 -4
  33. package/docs/tutorials/welcome.md +2 -2
  34. package/externs/shaka/mp4_parser.js +3 -0
  35. package/externs/shaka/player.js +2 -1
  36. package/lib/ads/ad_manager.js +2 -2
  37. package/lib/cea/cea708_window.js +2 -2
  38. package/lib/cea/mp4_cea_parser.js +37 -16
  39. package/lib/dash/segment_template.js +1 -1
  40. package/lib/hls/hls_parser.js +49 -23
  41. package/lib/media/content_workarounds.js +12 -0
  42. package/lib/media/media_source_capabilities.js +36 -0
  43. package/lib/media/media_source_engine.js +28 -7
  44. package/lib/media/segment_reference.js +3 -0
  45. package/lib/media/streaming_engine.js +33 -10
  46. package/lib/media/transmuxer.js +6 -4
  47. package/lib/player.js +10 -6
  48. package/lib/polyfill/abort_controller.js +143 -0
  49. package/lib/polyfill/media_capabilities.js +65 -11
  50. package/lib/polyfill/patchedmediakeys_apple.js +33 -28
  51. package/lib/text/ttml_text_parser.js +32 -7
  52. package/lib/text/ui_text_displayer.js +17 -0
  53. package/lib/util/mp4_box_parsers.js +24 -0
  54. package/lib/util/mp4_parser.js +35 -0
  55. package/lib/util/player_configuration.js +10 -3
  56. package/lib/util/stream_utils.js +35 -13
  57. package/package.json +4 -4
  58. package/shaka-player.uncompiled.js +1 -0
  59. package/test/ads/ad_manager_unit.js +3 -1
  60. package/test/dash/dash_parser_manifest_unit.js +1 -0
  61. package/test/hls/hls_parser_unit.js +132 -0
  62. package/test/media/drm_engine_unit.js +11 -1
  63. package/test/media/media_source_engine_integration.js +78 -2
  64. package/test/player_integration.js +10 -3
  65. package/test/polyfill/media_capabilities_unit.js +259 -0
  66. package/test/polyfill/patchedmediakeys_apple_unit.js +6 -0
  67. package/test/test/boot.js +29 -11
  68. package/test/test/util/manifest_parser_util.js +4 -3
  69. package/test/test/util/stream_generator.js +212 -8
  70. package/test/test/util/test_scheme.js +6 -5
  71. package/test/test/util/util.js +3 -2
  72. package/test/text/mp4_ttml_parser_unit.js +6 -4
  73. package/test/text/ttml_text_parser_unit.js +119 -86
  74. package/test/text/ui_text_displayer_unit.js +76 -0
  75. package/test/util/stream_utils_unit.js +18 -0
  76. package/test/util/xml_utils_unit.js +6 -1
  77. package/third_party/closure-uri/uri.js +1 -1
  78. package/ui/controls.js +49 -36
@@ -87,6 +87,19 @@ jobs:
87
87
  if: matrix.os == 'ubuntu-latest' && matrix.browser == 'Firefox'
88
88
  run: sudo apt -y update && sudo apt -y install ffmpeg
89
89
 
90
+ # Edge 107 fails DRM tests due to an outdated Widevine CDM. Force Edge
91
+ # to update to 108+.
92
+ - name: Upgrade Edge
93
+ if: matrix.os == 'ubuntu-latest' && matrix.browser == 'Edge'
94
+ run: |
95
+ # If it's Edge 107, update it. Otherwise, don't. This way, we don't
96
+ # break something later when Edge 108+ is available by default in
97
+ # GitHub Actions.
98
+ if apt show microsoft-edge-stable | grep -q '^Version: 107'; then
99
+ wget https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_108.0.1462.46-1_amd64.deb
100
+ sudo dpkg -i microsoft-edge-stable_108.0.1462.46-1_amd64.deb
101
+ fi
102
+
90
103
  - name: Checkout code
91
104
  uses: actions/checkout@v3
92
105
  with:
@@ -112,6 +125,13 @@ jobs:
112
125
  # Install a launcher that can execute a shell script to launch this
113
126
  npm install karma-script-launcher --save-dev
114
127
 
128
+ # Some CI images (self-hosted or otherwise) don't have the minimum Java
129
+ # version necessary for the compiler (Java 11).
130
+ - uses: actions/setup-java@v3
131
+ with:
132
+ distribution: zulu
133
+ java-version: 11
134
+
115
135
  - name: Build Player
116
136
  run: python build/all.py
117
137
 
package/AUTHORS CHANGED
@@ -66,6 +66,7 @@ Prakash <duggaraju@gmail.com>
66
66
  Robert Colantuoni <rgc@colantuoni.com>
67
67
  Robert Galluccio <robertnw5@gmail.com>
68
68
  Rodolphe Breton <robloche@gmail.com>
69
+ Rohan Gupta <rohangupta1528@gmail.com>
69
70
  Roi Lipman <roilipman@gmail.com>
70
71
  Roksolana Ivanyshyn <roksolana.ivanyshyn.pub@gmail.com>
71
72
  Rostislav Hejduk <Ross-cz@users.noreply.github.com>
@@ -90,3 +91,4 @@ Raymond Cheng <raycheng100@gmail.com>
90
91
  Blue Billywig <*@bluebillywig.com>
91
92
  João Nabais <jlnabais@gmail.com>
92
93
  Koen Romers <koenromers@gmail.com>
94
+ Zhenghang Chen <czhtju@gmail.com>
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.3.2](https://github.com/shaka-project/shaka-player/compare/v4.3.1...v4.3.2) (2022-12-14)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **chapters:** removed duplicate chapters by id ([#4810](https://github.com/shaka-project/shaka-player/issues/4810)) ([3588d37](https://github.com/shaka-project/shaka-player/commit/3588d3749d1fc3fe65a4428c774b1b5ed8f51652))
9
+ * Fix duplicate updates in StreamingEngine ([#4840](https://github.com/shaka-project/shaka-player/issues/4840)) ([65e188a](https://github.com/shaka-project/shaka-player/commit/65e188aef1f9edc642b563d343aca5de4ddc5caf)), closes [#4831](https://github.com/shaka-project/shaka-player/issues/4831)
10
+ * Fix rare exception after StreamingEngine teardown ([#4830](https://github.com/shaka-project/shaka-player/issues/4830)) ([a0fcb2e](https://github.com/shaka-project/shaka-player/commit/a0fcb2ec671ddc8f7ba5380312898068456d9b1c)), closes [#4813](https://github.com/shaka-project/shaka-player/issues/4813)
11
+ * **HLS:** Fix AV sync over ad boundaries ([#4824](https://github.com/shaka-project/shaka-player/issues/4824)) ([dab9ece](https://github.com/shaka-project/shaka-player/commit/dab9ece2be19e7674b56180413ec00f36500d1dc)), closes [#4589](https://github.com/shaka-project/shaka-player/issues/4589)
12
+ * **UI:** Suppress error log from fullscreen button on desktop ([#4823](https://github.com/shaka-project/shaka-player/issues/4823)) ([656d938](https://github.com/shaka-project/shaka-player/commit/656d938d190699511c3bd600749ce4e6167059d2)), closes [#4822](https://github.com/shaka-project/shaka-player/issues/4822)
13
+
14
+ ## [4.3.1](https://github.com/shaka-project/shaka-player/compare/v4.3.0...v4.3.1) (2022-12-08)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **cast:** Use cast platform APIs in MediaCapabilties polyfill ([#4727](https://github.com/shaka-project/shaka-player/issues/4727)) ([fb1f0dc](https://github.com/shaka-project/shaka-player/commit/fb1f0dc019be0a5ac7f6ab4e51634cee203a666f))
20
+ * **cea:** Fix MAX_ROWS in CEA-708 window ([#4757](https://github.com/shaka-project/shaka-player/issues/4757)) ([3a501c6](https://github.com/shaka-project/shaka-player/commit/3a501c6ea63cf8ed5016c53c079364fec516cfe3))
21
+ * **cea:** Fix not rendering CEA-608 on encrypted mp4 segments ([#4756](https://github.com/shaka-project/shaka-player/issues/4756)) ([501d4ca](https://github.com/shaka-project/shaka-player/commit/501d4cacc19ae6503773a47c9d5b9da2a1488b52))
22
+ * Correct default initDataTransform for legacy Apple Media Keys ([#4797](https://github.com/shaka-project/shaka-player/issues/4797)) ([ac6c4ed](https://github.com/shaka-project/shaka-player/commit/ac6c4edd0d7b91e14930da0a1901ecda333b5d47))
23
+ * Fix bufferBehind setting broken by image segments ([#4718](https://github.com/shaka-project/shaka-player/issues/4718)) ([0e813a1](https://github.com/shaka-project/shaka-player/commit/0e813a176ed725933a9c96ecccc1617d99eb8c9a)), closes [#4717](https://github.com/shaka-project/shaka-player/issues/4717)
24
+ * Fix compiler error on static use of "this" ([#4699](https://github.com/shaka-project/shaka-player/issues/4699)) ([0e2a12a](https://github.com/shaka-project/shaka-player/commit/0e2a12a0c37c0d92a6f8f1f4a264f8e2f3b47bbd))
25
+ * Fix DRM workaround for Tizen and Xbox with hvc1/hev1 boxes ([#4743](https://github.com/shaka-project/shaka-player/issues/4743)) ([c6b6cff](https://github.com/shaka-project/shaka-player/commit/c6b6cffff973163a5c34784e11286e0540c66f03)), closes [#4742](https://github.com/shaka-project/shaka-player/issues/4742)
26
+ * Fix subtitles not added to DOM region ([#4733](https://github.com/shaka-project/shaka-player/issues/4733)) ([eea7858](https://github.com/shaka-project/shaka-player/commit/eea78580f45a708bd79d582253aea137b22b9ad5)), closes [#4680](https://github.com/shaka-project/shaka-player/issues/4680)
27
+ * Fix timestamp offset for ID3 on DAI-HLS ([#4696](https://github.com/shaka-project/shaka-player/issues/4696)) ([52aa102](https://github.com/shaka-project/shaka-player/commit/52aa102a70af82adafc5bb8ceaba2d5b5be0a84e))
28
+ * Fix usage of WebCrypto in old browsers ([#4711](https://github.com/shaka-project/shaka-player/issues/4711)) ([2fec68b](https://github.com/shaka-project/shaka-player/commit/2fec68b83070f265b88cb6871ecd3351f9873b26))
29
+ * **HLS:** Fix detection of Media Playlist for audio and video only in MP4 ([#4803](https://github.com/shaka-project/shaka-player/issues/4803)) ([f814d26](https://github.com/shaka-project/shaka-player/commit/f814d26039aa143c991008788a856285e9c34d84))
30
+ * **HLS:** fix lazy load with multiple raw audio tracks ([#4715](https://github.com/shaka-project/shaka-player/issues/4715)) ([ec2a3d6](https://github.com/shaka-project/shaka-player/commit/ec2a3d6f5b67fd8c98df3928b3101b8985aebd71))
31
+ * **HLS:** Fix lowLatencyPresentationDelay when using autoLowLatencyMode ([#4712](https://github.com/shaka-project/shaka-player/issues/4712)) ([824886d](https://github.com/shaka-project/shaka-player/commit/824886d759058ee25260da5fd3d0ad107ea9f6a1))
32
+ * **HLS:** Fix missing roles ([#4760](https://github.com/shaka-project/shaka-player/issues/4760)) ([d27f023](https://github.com/shaka-project/shaka-player/commit/d27f0230cf96d3c396156ce7f748e7f5b5f0d719)), closes [#4759](https://github.com/shaka-project/shaka-player/issues/4759)
33
+ * **HLS:** Fix support legacy AVC1 codec used in HLS ([#4716](https://github.com/shaka-project/shaka-player/issues/4716)) ([c7e83c4](https://github.com/shaka-project/shaka-player/commit/c7e83c4f46ff0db8db90f0746dda03758338c64f))
34
+ * **hls:** Fix type error in lazy-loading ([#4687](https://github.com/shaka-project/shaka-player/issues/4687)) ([ad41cf4](https://github.com/shaka-project/shaka-player/commit/ad41cf4f4a9bfd30637b121908b5daac108d823f))
35
+ * **HLS:** Single alternative video renditions not working ([#4785](https://github.com/shaka-project/shaka-player/issues/4785)) ([f0024fc](https://github.com/shaka-project/shaka-player/commit/f0024fc21ba774cc13fa7441dc28c53b5afe310b))
36
+ * Polyfill missing AbortController on Tizen ([#4707](https://github.com/shaka-project/shaka-player/issues/4707)) ([76fae10](https://github.com/shaka-project/shaka-player/commit/76fae10e44072d2561ca1a424311a7c10b9d4cf3))
37
+ * **TTML:** Add font-family mapping ([#4801](https://github.com/shaka-project/shaka-player/issues/4801)) ([57780dd](https://github.com/shaka-project/shaka-player/commit/57780dd449e31da83c37badb65b0d3e71cf8524c))
38
+ * **TTML:** Fix duplicate cues overlapping segment boundaries ([#4798](https://github.com/shaka-project/shaka-player/issues/4798)) ([9faf848](https://github.com/shaka-project/shaka-player/commit/9faf84801a1cf8da5b2261def2b24985f8d07366)), closes [#4631](https://github.com/shaka-project/shaka-player/issues/4631)
39
+ * **ui:** Check event cancelable before event.preventDefault ([#4690](https://github.com/shaka-project/shaka-player/issues/4690)) ([7a3e66d](https://github.com/shaka-project/shaka-player/commit/7a3e66dce32e78b16de02e070d41949626f736d8))
40
+ * **ui:** Fix iOS fullscreen on rotation ([#4679](https://github.com/shaka-project/shaka-player/issues/4679)) ([8504c17](https://github.com/shaka-project/shaka-player/commit/8504c17ee618f7a1d24302d0e219d6b605339151))
41
+
42
+
43
+ ### Performance Improvements
44
+
45
+ * Caching mediaSource support for browser engine ([#4778](https://github.com/shaka-project/shaka-player/issues/4778)) ([7d2d485](https://github.com/shaka-project/shaka-player/commit/7d2d48596f1fb8f164dd4a861227a2863b4eb68f))
46
+
3
47
  ## [4.3.0](https://github.com/shaka-project/shaka-player/compare/v4.2.0...v4.3.0) (2022-11-10)
4
48
 
5
49
 
package/CONTRIBUTORS CHANGED
@@ -98,6 +98,7 @@ Robert Colantuoni <rgc@colantuoni.com>
98
98
  Robert Galluccio <robertnw5@gmail.com>
99
99
  Rodolphe Breton <robloche@gmail.com>
100
100
  Rohit Makasana <rohitbm@google.com>
101
+ Rohan Gupta <rohangupta1528@gmail.com>
101
102
  Roi Lipman <roilipman@gmail.com>
102
103
  Roksolana Ivanyshyn <roksolana.ivanyshyn.pub@gmail.com>
103
104
  Rostislav Hejduk <Ross-cz@users.noreply.github.com>
@@ -130,3 +131,4 @@ Raymond Cheng <raycheng100@gmail.com>
130
131
  Janroel Koppen <j.koppen@bluebillywig.com>
131
132
  João Nabais <jlnabais@gmail.com>
132
133
  Koen Romers <koenromers@gmail.com>
134
+ Zhenghang Chen <czhtju@gmail.com>
package/README.md CHANGED
@@ -135,10 +135,10 @@ HLS features supported:
135
135
  - CEA-608/708 captions
136
136
  - Encrypted content with PlayReady and Widevine
137
137
  - Encrypted content with FairPlay (Safari on macOS and iOS 13+ only)
138
+ - Key rotation
138
139
  - Raw AAC, MP3, etc (without an MP4 container)
139
140
 
140
141
  HLS features **not** supported:
141
- - Key rotation: https://github.com/shaka-project/shaka-player/issues/917
142
142
  - I-frame-only playlists: https://github.com/shaka-project/shaka-player/issues/742
143
143
  - Low-latency streaming with blocking playlist reload
144
144
 
@@ -0,0 +1,120 @@
1
+ /*! @license
2
+ * Shaka Player
3
+ * Copyright 2016 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ goog.provide('shaka.cast.CastProxy');
8
+
9
+ goog.require('shaka.Player');
10
+ goog.require('shaka.util.FakeEventTarget');
11
+ goog.require('shaka.util.IDestroyable');
12
+
13
+ /**
14
+ * @summary A dummy version of the cast proxy. Meant to allow Shaka Player to
15
+ * build the UI without the cast system.
16
+ *
17
+ * @implements {shaka.util.IDestroyable}
18
+ * @export
19
+ */
20
+ shaka.cast.CastProxy = class extends shaka.util.FakeEventTarget {
21
+ /**
22
+ * @param {!HTMLMediaElement} video
23
+ * @param {!shaka.Player} player
24
+ * @param {string} receiverAppId
25
+ * @param {boolean} androidReceiverCompatible
26
+ */
27
+ constructor(video, player, receiverAppId, androidReceiverCompatible = false) {
28
+ super();
29
+
30
+ /** @private {!HTMLMediaElement} */
31
+ this.video_ = video;
32
+
33
+ /** @private {!shaka.Player} */
34
+ this.player_ = player;
35
+ }
36
+
37
+ /**
38
+ * @param {boolean=} forceDisconnect
39
+ * @override
40
+ * @export
41
+ */
42
+ async destroy(forceDisconnect) {
43
+ await this.player_.destroy();
44
+ super.release();
45
+ }
46
+
47
+ /**
48
+ * @return {!HTMLMediaElement}
49
+ * @export
50
+ */
51
+ getVideo() {
52
+ return this.video_;
53
+ }
54
+
55
+ /**
56
+ * @return {!shaka.Player}
57
+ * @export
58
+ */
59
+ getPlayer() {
60
+ return this.player_;
61
+ }
62
+
63
+ /**
64
+ * @return {boolean}
65
+ * @export
66
+ */
67
+ canCast() {
68
+ return false;
69
+ }
70
+
71
+ /**
72
+ * @return {boolean}
73
+ * @export
74
+ */
75
+ isCasting() {
76
+ return false;
77
+ }
78
+
79
+ /**
80
+ * @return {string}
81
+ * @export
82
+ */
83
+ receiverName() {
84
+ return 'dummy';
85
+ }
86
+
87
+ /**
88
+ * @return {!Promise}
89
+ * @export
90
+ */
91
+ async cast() {
92
+ await Promise.resolve();
93
+ }
94
+
95
+ /**
96
+ * @param {Object} appData
97
+ * @export
98
+ */
99
+ setAppData(appData) {}
100
+
101
+ /**
102
+ * @export
103
+ */
104
+ suggestDisconnect() {}
105
+
106
+ /**
107
+ * @export
108
+ */
109
+ forceDisconnect() {}
110
+
111
+
112
+ /**
113
+ * @param {string} newAppId
114
+ * @param {boolean=} newCastAndroidReceiver
115
+ * @export
116
+ */
117
+ async changeReceiverId(newAppId, newCastAndroidReceiver = false) {
118
+ await Promise.resolve();
119
+ }
120
+ };