shaka-player 4.4.1 → 4.4.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 (56) hide show
  1. package/.github/workflows/deflake.yaml +8 -5
  2. package/.github/workflows/release-please.yaml +47 -7
  3. package/.github/workflows/shaka-bot-commands/command-test.sh +1 -1
  4. package/CHANGELOG.md +20 -0
  5. package/CONTRIBUTORS +1 -0
  6. package/demo/custom.js +5 -5
  7. package/dist/demo.compiled.debug.js +3 -3
  8. package/dist/demo.compiled.debug.map +1 -1
  9. package/dist/demo.compiled.js +3 -3
  10. package/dist/demo.compiled.map +1 -1
  11. package/dist/deps.js +2 -2
  12. package/dist/locales.js +31 -31
  13. package/dist/shaka-player.compiled.d.ts +311 -295
  14. package/dist/shaka-player.compiled.debug.d.ts +311 -295
  15. package/dist/shaka-player.compiled.debug.externs.js +37 -0
  16. package/dist/shaka-player.compiled.debug.js +145 -135
  17. package/dist/shaka-player.compiled.debug.map +3 -3
  18. package/dist/shaka-player.compiled.externs.js +37 -0
  19. package/dist/shaka-player.compiled.js +887 -884
  20. package/dist/shaka-player.compiled.map +4 -4
  21. package/dist/shaka-player.ui.d.ts +355 -339
  22. package/dist/shaka-player.ui.debug.d.ts +355 -339
  23. package/dist/shaka-player.ui.debug.externs.js +37 -0
  24. package/dist/shaka-player.ui.debug.js +161 -151
  25. package/dist/shaka-player.ui.debug.map +3 -3
  26. package/dist/shaka-player.ui.externs.js +37 -0
  27. package/dist/shaka-player.ui.js +968 -967
  28. package/dist/shaka-player.ui.map +4 -4
  29. package/docs/tutorials/fairplay.md +8 -0
  30. package/docs/tutorials/faq.md +1 -1
  31. package/externs/shaka/text.js +7 -0
  32. package/lib/dash/segment_template.js +3 -0
  33. package/lib/hls/hls_parser.js +8 -4
  34. package/lib/media/media_source_engine.js +1 -1
  35. package/lib/player.js +8 -57
  36. package/lib/text/lrc_text_parser.js +8 -0
  37. package/lib/text/mp4_ttml_parser.js +8 -0
  38. package/lib/text/mp4_vtt_parser.js +8 -0
  39. package/lib/text/sbv_text_parser.js +8 -0
  40. package/lib/text/srt_text_parser.js +8 -0
  41. package/lib/text/ssa_text_parser.js +8 -0
  42. package/lib/text/text_engine.js +8 -1
  43. package/lib/text/ttml_text_parser.js +10 -1
  44. package/lib/text/ui_text_displayer.js +49 -3
  45. package/lib/text/vtt_text_parser.js +21 -5
  46. package/lib/transmuxer/ts_transmuxer.js +44 -43
  47. package/lib/util/error.js +16 -10
  48. package/lib/util/player_configuration.js +2 -2
  49. package/lib/util/stream_utils.js +13 -11
  50. package/lib/util/ts_parser.js +70 -13
  51. package/package.json +2 -2
  52. package/test/text/text_engine_unit.js +4 -2
  53. package/test/text/ttml_text_parser_unit.js +3 -4
  54. package/test/text/vtt_text_parser_unit.js +17 -2
  55. package/test/text/web_vtt_layout_integration.js +0 -1
  56. package/ui/language_utils.js +0 -15
@@ -1,16 +1,19 @@
1
1
  name: Deflake Tests
2
2
 
3
- # Runs when the Selenum nightly test workflow completes. This will run with
4
- # full privileges, even if the other workflow doesn't. That allows us to
5
- # trigger re-runs if we think the results might be flaky.
3
+ # Runs when the Selenum lab test or PR test workflows complete. This will run
4
+ # with full privileges, even if the other workflow doesn't. That allows us to
5
+ # trigger re-runs if we think the results might be flaky. A test run will be
6
+ # given up to 3 runs to succeed.
6
7
  on:
7
8
  workflow_run:
8
- workflows: [Selenium Lab Tests]
9
+ workflows:
10
+ - Selenium Lab Tests
11
+ - Build and Test PR
9
12
  types: [completed]
10
13
 
11
14
  jobs:
12
15
  deflake:
13
- if: ${{ github.event.workflow_run.event == 'schedule' && github.event.workflow_run.conclusion == 'failure' }}
16
+ if: ${{ github.event.workflow_run.conclusion == 'failure' }}
14
17
  runs-on: ubuntu-latest
15
18
 
16
19
  steps:
@@ -29,8 +29,6 @@ jobs:
29
29
  - uses: actions/checkout@v3
30
30
  if: steps.release.outputs.release_created == false
31
31
  with:
32
- # Checkout the fork, where the PR is generated from.
33
- repository: shaka-bot/${{ github.event.repository.name }}
34
32
  # Use a special shaka-bot access token for releases.
35
33
  token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
36
34
  - name: Custom update Player version
@@ -63,8 +61,7 @@ jobs:
63
61
  steps:
64
62
  - uses: actions/checkout@v3
65
63
  with:
66
- # Check out the origin repo, not the fork, and do it at main, not the
67
- # PR branch.
64
+ # Check out the origin repo, and do it at main, not the PR branch.
68
65
  ref: main
69
66
  # Use a special shaka-bot access token for releases.
70
67
  token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
@@ -93,10 +90,52 @@ jobs:
93
90
  node-version: 16
94
91
  registry-url: 'https://registry.npmjs.org'
95
92
 
93
+ - name: Compute NPM tags
94
+ run: |
95
+ # NPM publish always sets a tag. If you don't provide an explicit
96
+ # tag, you get the "latest" tag by default, but we want "latest" to
97
+ # always point to the highest version number. So we set an explicit
98
+ # tag on every "publish" command, then follow up with a command to
99
+ # set "latest" only if this release was the highest version yet.
100
+
101
+ # The explicit tag is based on the branch. If the git tag is v4.4.1,
102
+ # the branch was v4.4.x, and the explicit NPM tag should be
103
+ # v4.4-latest.
104
+ GIT_TAG_NAME=${{ needs.release.outputs.tag_name }}
105
+ NPM_TAG=$(echo "$GIT_TAG_NAME" | cut -f 1-2 -d .)-latest
106
+ echo "NPM_TAG=$NPM_TAG" >> $GITHUB_ENV
107
+
108
+ # We only tag the NPM package as "latest" if this release is the
109
+ # highest version to date.
110
+ RELEASE_TAGS=$(git tag | grep ^v[0-9] | grep -Ev -- '-(master|main)')
111
+ LATEST_RELEASE=$(echo "$RELEASE_TAGS" | sort --version-sort | tail -1)
112
+
113
+ if [[ "$GIT_TAG_NAME" == "$LATEST_RELEASE" ]]; then
114
+ NPM_LATEST=true
115
+ else
116
+ NPM_LATEST=false
117
+ fi
118
+ echo NPM_LATEST=$NPM_LATEST >> $GITHUB_ENV
119
+
120
+ # Debug the decisions made here.
121
+ echo "Latest release: $LATEST_RELEASE"
122
+ echo "This release: $GIT_TAG_NAME"
123
+ echo "NPM tag: $NPM_TAG"
124
+ echo "NPM latest: $NPM_LATEST"
125
+
96
126
  - run: npm ci
97
- - run: npm publish
127
+ - name: Publish
98
128
  env:
99
129
  NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
130
+ run: |
131
+ # Publish with an explicit tag.
132
+ npm publish --tag "$NPM_TAG"
133
+
134
+ # Add the "latest" tag if needed.
135
+ if [[ "$NPM_LATEST" == "true" ]]; then
136
+ NPM_VERSION=$(npm version --json | jq -r '."shaka-player"')
137
+ npm dist-tag add "shaka-player@$NPM_VERSION" latest
138
+ fi
100
139
 
101
140
  - run: npm pack
102
141
  - uses: svenstaro/upload-release-action@483c1e56f95e88835747b1c7c60581215016cbf2
@@ -137,10 +176,11 @@ jobs:
137
176
  TAG_NAME=${{ needs.release.outputs.tag_name }}
138
177
 
139
178
  if [[ "$TAG_NAME" == "$LATEST_RELEASE" ]]; then
140
- echo APPSPOT_PROMOTE=true >> $GITHUB_ENV
179
+ APPSPOT_PROMOTE=true
141
180
  else
142
- echo APPSPOT_PROMOTE=false >> $GITHUB_ENV
181
+ APPSPOT_PROMOTE=false
143
182
  fi
183
+ APPSPOT_PROMOTE=$APPSPOT_PROMOTE >> $GITHUB_ENV
144
184
 
145
185
  # Debug the decisions made here.
146
186
  echo "Subdomain: $APPSPOT_SUBDOMAIN"
@@ -25,7 +25,7 @@ WORKFLOW_ARGS=( "pr=$PR_NUMBER" )
25
25
 
26
26
  case "${SHAKA_BOT_ARGUMENTS[0]}" in
27
27
  # CE devices only.
28
- ce) WORKFLOW_ARGS+=( "browser_filter=Tizen Chromecast ChromeAndroid" ) ;;
28
+ ce) WORKFLOW_ARGS+=( "browser_filter=Tizen ChromecastUltra ChromecastGTV ChromeAndroid" ) ;;
29
29
 
30
30
  # No command argument, no extra workflow arguments.
31
31
  "") ;;
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.4.2](https://github.com/shaka-project/shaka-player/compare/v4.4.1...v4.4.2) (2023-09-13)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * com.apple.fps should work with the default initDataTransform when using legacy Apple Media Keys ([#5603](https://github.com/shaka-project/shaka-player/issues/5603)) ([1a6fcf7](https://github.com/shaka-project/shaka-player/commit/1a6fcf71bc27b37ca44dc2dabdf5e4608a12dea4))
9
+ * Compute correctly the positionAlign in UITextDisplayer ([#5630](https://github.com/shaka-project/shaka-player/issues/5630)) ([b19c5e7](https://github.com/shaka-project/shaka-player/commit/b19c5e720882dd9211f9455f12dff0485b121175))
10
+ * **DASH:** Fix race condition error while switching audio tracks ([#5619](https://github.com/shaka-project/shaka-player/issues/5619)) ([c140ea3](https://github.com/shaka-project/shaka-player/commit/c140ea3d3e5550e1e89e7e0ad8fc50d637c0ed57))
11
+ * **Demo:** Allow com.apple.fps.1_0 in the custom DRM System field ([#5600](https://github.com/shaka-project/shaka-player/issues/5600)) ([30597ed](https://github.com/shaka-project/shaka-player/commit/30597ed5d9f64c5ea56fc70043b46a8f8fdd774d))
12
+ * Fix compiled-mode error formatting ([#5623](https://github.com/shaka-project/shaka-player/issues/5623)) ([838cb16](https://github.com/shaka-project/shaka-player/commit/838cb160653692c378afda9ec77b8fbc996cfd56))
13
+ * fix preferred track selection on Safari ([#5601](https://github.com/shaka-project/shaka-player/issues/5601)) ([0e4a021](https://github.com/shaka-project/shaka-player/commit/0e4a02154ee4588c88e7526eac841aca46902c4f))
14
+ * Fix transmuxed audio timestamps ([#5595](https://github.com/shaka-project/shaka-player/issues/5595)) ([258a91f](https://github.com/shaka-project/shaka-player/commit/258a91f2b70da7267067800e5e571a48f5c17be2))
15
+ * **HLS:** Get the correct video codec for TS segments ([#5598](https://github.com/shaka-project/shaka-player/issues/5598)) ([0020afe](https://github.com/shaka-project/shaka-player/commit/0020afe02ef961581cfdcefbc412d7ae454a8128))
16
+ * **HLS:** Show WebVTT subtitles with X-TIMESTAMP-MAP in segments mode ([#5643](https://github.com/shaka-project/shaka-player/issues/5643)) ([58298e2](https://github.com/shaka-project/shaka-player/commit/58298e24758c27a1fa409246098e3c186a0ab1e4))
17
+ * Improve TsParse to avoid parsing errors ([#5615](https://github.com/shaka-project/shaka-player/issues/5615)) ([c57bb6f](https://github.com/shaka-project/shaka-player/commit/c57bb6f89081c0492dbc75a9b7c1ae7580caf0a7))
18
+ * **TTML:** Fix wrong writing-mode in nested cues ([#5646](https://github.com/shaka-project/shaka-player/issues/5646)) ([521c239](https://github.com/shaka-project/shaka-player/commit/521c2398f2503b04be9f79ed62fb17ecb8d000d1))
19
+ * **UI:** Fix broken language names on Google TV ([#5613](https://github.com/shaka-project/shaka-player/issues/5613)) ([4a84d8e](https://github.com/shaka-project/shaka-player/commit/4a84d8e25250871c3e4cda967b13ee80fe371913))
20
+ * **WebVTT:** Fix support for line:0 vertical alignment ([#5632](https://github.com/shaka-project/shaka-player/issues/5632)) ([14cdc11](https://github.com/shaka-project/shaka-player/commit/14cdc11968e0e7782a9924a9a9be84882a031806))
21
+ * **WebVTT:** Fix wrong writing-mode in nested cues ([#5641](https://github.com/shaka-project/shaka-player/issues/5641)) ([8a7e32e](https://github.com/shaka-project/shaka-player/commit/8a7e32e111fbab76e5989a7df8ea8efc00955eb3))
22
+
3
23
  ## [4.4.1](https://github.com/shaka-project/shaka-player/compare/v4.4.0...v4.4.1) (2023-09-02)
4
24
 
5
25
 
package/CONTRIBUTORS CHANGED
@@ -80,6 +80,7 @@ Jun Hong Chong <chongjunhong@gmail.com>
80
80
  Jürgen Kartnaller <kartnaller@lovelysystems.com>
81
81
  Konstantin Grushetsky <github@grushetsky.net>
82
82
  Leandro Ribeiro Moreira <leandro.ribeiro.moreira@gmail.com>
83
+ Loïc Raux <loicraux@gmail.com>
83
84
  Lucas Gabriel Sánchez <unkiwii@gmail.com>
84
85
  Martin Stark <martin.stark@eyevinn.se>
85
86
  Matias Russitto <russitto@gmail.com>
package/demo/custom.js CHANGED
@@ -407,14 +407,14 @@ shakaDemo.Custom = class {
407
407
  const licenseServerURL = licenseServerUrlInput.value;
408
408
  const customDRMSystem = customDrmSystemInput.value;
409
409
  if (licenseServerURL) {
410
- // Make a license server entry for every common DRM plugin.
411
410
  assetInProgress.licenseServers.clear();
412
- for (const drmSystem of shakaDemo.Main.commonDrmSystems) {
413
- assetInProgress.licenseServers.set(drmSystem, licenseServerURL);
414
- }
415
411
  if (customDRMSystem) {
416
- // Make a custom entry too.
417
412
  assetInProgress.licenseServers.set(customDRMSystem, licenseServerURL);
413
+ } else {
414
+ // Make a license server entry for every common DRM plugin.
415
+ for (const drmSystem of shakaDemo.Main.commonDrmSystems) {
416
+ assetInProgress.licenseServers.set(drmSystem, licenseServerURL);
417
+ }
418
418
  }
419
419
  } else {
420
420
  assetInProgress.licenseServers.clear();
@@ -258,9 +258,9 @@ f)},q=>{n(q.value,g)});p=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.L
258
258
  const d=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.HLS_FULL_MIME_TYPE);this.makeField_(c,d,(e,f)=>{a.mediaPlaylistFullMimeType&&(e.value=a.mediaPlaylistFullMimeType);f=shaka.util.PlayerConfiguration.createDefault();e.placeholder=f.manifest.hls.mediaPlaylistFullMimeType},e=>{a.setMediaPlaylistFullMimeType(e.value)});return b}makeAssetDialogContentsAds_(a,b){b=document.createElement("div");const c=new shakaDemo.InputContainer(b,null,shakaDemo.InputContainer.Style.VERTICAL,null);var d=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.AD_TAG_URL);
259
259
  this.makeField_(c,d,(e,f)=>{a.adTagUri&&(e.value=a.adTagUri)},e=>{a.adTagUri=e.value});d=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.IMA_CONTENT_SRC_ID);this.makeField_(c,d,(e,f)=>{a.imaContentSrcId&&(e.value=a.imaContentSrcId);this.manifestField_.required=this.checkManifestRequired_(a)},e=>{a.imaContentSrcId=e.value;this.manifestField_.required=this.checkManifestRequired_(a)});d=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.IMA_VIDEO_ID);this.makeField_(c,d,(e,f)=>{a.imaVideoId&&
260
260
  (e.value=a.imaVideoId);this.manifestField_.required=this.checkManifestRequired_(a)},e=>{a.imaVideoId=e.value;this.manifestField_.required=this.checkManifestRequired_(a)});d=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.IMA_ASSET_KEY);this.makeField_(c,d,(e,f)=>{a.imaAssetKey&&(e.value=a.imaAssetKey);this.manifestField_.required=this.checkManifestRequired_(a)},e=>{a.imaAssetKey=e.value;this.manifestField_.required=this.checkManifestRequired_(a)});d=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.IMA_MANIFEST_TYPE);
261
- this.makeField_(c,d,(e,f)=>{a.imaManifestType&&(e.value=a.imaManifestType);this.manifestField_.required=this.checkManifestRequired_(a)},e=>{a.imaManifestType=e.value;this.manifestField_.required=this.checkManifestRequired_(a)});return b}makeAssetDialogContentsDrm_(a,b){b=document.createElement("div");const c=new shakaDemo.InputContainer(b,null,shakaDemo.InputContainer.Style.VERTICAL,null);let d,e;const f=()=>{const h=d.value,k=e.value;if(h){a.licenseServers.clear();for(const l of shakaDemo.Main.commonDrmSystems)a.licenseServers.set(l,
262
- h);k&&a.licenseServers.set(k,h)}else a.licenseServers.clear()};var g=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.LICENSE_SERVER_URL);this.makeField_(c,g,(h,k)=>{d=h;(k=a.licenseServers.keys().next())&&k.value&&(h.value=a.licenseServers.get(k.value))},h=>{f()});g=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.LICENSE_CERTIFICATE_URL);this.makeField_(c,g,(h,k)=>{a.certificateUri&&(h.value=a.certificateUri)},h=>{a.certificateUri=h.value});g=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.DRM_SYSTEM);
263
- this.makeField_(c,g,(h,k)=>{e=h;k=a.licenseServers.keys();for(const l of k)if(!shakaDemo.Main.commonDrmSystems.includes(l)){h.value=l;break}},h=>{f()});return b}makeAssetDialogContentsExtra_(a,b){const c=document.createElement("div"),d=new shakaDemo.InputContainer(c,null,shakaDemo.InputContainer.Style.FLEX,null);d.getClassList().add("wide-input");d.setDefaultRowClass("wide-input");const e=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.EXTRA_SHAKA_PLAYER_CONFIG);this.makeField_(d,e,(f,g)=>{f.setAttribute("rows",
261
+ this.makeField_(c,d,(e,f)=>{a.imaManifestType&&(e.value=a.imaManifestType);this.manifestField_.required=this.checkManifestRequired_(a)},e=>{a.imaManifestType=e.value;this.manifestField_.required=this.checkManifestRequired_(a)});return b}makeAssetDialogContentsDrm_(a,b){b=document.createElement("div");const c=new shakaDemo.InputContainer(b,null,shakaDemo.InputContainer.Style.VERTICAL,null);let d,e;const f=()=>{const h=d.value,k=e.value;if(h)if(a.licenseServers.clear(),k)a.licenseServers.set(k,h);else for(const l of shakaDemo.Main.commonDrmSystems)a.licenseServers.set(l,
262
+ h);else a.licenseServers.clear()};var g=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.LICENSE_SERVER_URL);this.makeField_(c,g,(h,k)=>{d=h;(k=a.licenseServers.keys().next())&&k.value&&(h.value=a.licenseServers.get(k.value))},h=>{f()});g=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.LICENSE_CERTIFICATE_URL);this.makeField_(c,g,(h,k)=>{a.certificateUri&&(h.value=a.certificateUri)},h=>{a.certificateUri=h.value});g=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.DRM_SYSTEM);this.makeField_(c,
263
+ g,(h,k)=>{e=h;k=a.licenseServers.keys();for(const l of k)if(!shakaDemo.Main.commonDrmSystems.includes(l)){h.value=l;break}},h=>{f()});return b}makeAssetDialogContentsExtra_(a,b){const c=document.createElement("div"),d=new shakaDemo.InputContainer(c,null,shakaDemo.InputContainer.Style.FLEX,null);d.getClassList().add("wide-input");d.setDefaultRowClass("wide-input");const e=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.EXTRA_SHAKA_PLAYER_CONFIG);this.makeField_(d,e,(f,g)=>{f.setAttribute("rows",
264
264
  10);a.extraConfig&&(f.value=JSON.stringify(a.extraConfig,null,2));b.push(f);f=document.createElement("span");f.classList.add("mdl-textfield__error");f.textContent=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.INVALID_JSON_CONFIG_ERROR);g.appendChild(f)},(f,g)=>{try{if(f.value){const h=JSON.parse(f.value);a.extraConfig=h}else a.extraConfig=null;g.setValid(!0)}catch(h){g.setValid(!1)}},!0);return c}makeAssetDialogContentsMain_(a,b,c){const d=document.createElement("div"),e=new shakaDemo.InputContainer(d,
265
265
  null,shakaDemo.InputContainer.Style.VERTICAL,null);var f=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.MANIFEST_URL);this.makeField_(e,f,(g,h)=>{g.value=a.manifestUri;b.push(g);const k=document.createElement("span");k.classList.add("mdl-textfield__error");k.textContent=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.MANIFEST_URL_ERROR);h.appendChild(k);g.required=this.checkManifestRequired_(a);g.pattern="^(?!([\r\n\t\f\v ]+)$).*$";this.manifestField_=g},g=>{a.manifestUri=g.value.trim()});
266
266
  f=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.NAME);this.makeField_(e,f,(g,h)=>{g.value=a.name;b.push(g);const k=document.createElement("span");k.classList.add("mdl-textfield__error");k.textContent=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.NAME_ERROR);h.appendChild(k);g.required=!0;g.pattern="^(?!( *";for(const l of this.assets_)l!=a&&(g.pattern+="|"+l.name.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"));g.pattern+=")$).*$"},g=>{a.name=g.value});f=shakaDemoMain.getLocalizedString(shakaDemo.MessageIds.ICON_URL);