shaka-player 4.3.10 → 4.3.11

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.
@@ -21,10 +21,18 @@ jobs:
21
21
  release-type: node
22
22
  # Make sure we create the PR against the correct branch.
23
23
  default-branch: ${{ github.ref_name }}
24
+ # Use a special shaka-bot access token for releases.
25
+ token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
24
26
 
25
27
  # If we didn't create a release, we may have created or updated a PR.
28
+ # Check out the code, then update the Player version in the PR.
26
29
  - uses: actions/checkout@v3
27
30
  if: steps.release.outputs.release_created == false
31
+ with:
32
+ # Checkout the fork, where the PR is generated from.
33
+ repository: shaka-bot/${{ github.event.repository.name }}
34
+ # Use a special shaka-bot access token for releases.
35
+ token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
28
36
  - name: Custom update Player version
29
37
  if: steps.release.outputs.release_created == false
30
38
  run: |
@@ -38,9 +46,9 @@ jobs:
38
46
  sed -e "s/^\\(shaka.Player.version =\\).*/\\1 '$VERSION';/" \
39
47
  -i lib/player.js
40
48
  git add lib/player.js
41
- # Emulate the actions bot.
42
- git config user.name "github-actions[bot]"
43
- git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
49
+ # Set missing git config for the commit.
50
+ git config user.name "shaka-bot"
51
+ git config user.email "shaka-bot@users.noreply.github.com"
44
52
  # Update the PR.
45
53
  git commit --amend --no-edit
46
54
  git push -f
@@ -55,12 +63,17 @@ jobs:
55
63
  steps:
56
64
  - uses: actions/checkout@v3
57
65
  with:
66
+ # Check out the origin repo, not the fork, and do it at main, not the
67
+ # PR branch.
58
68
  ref: main
69
+ # Use a special shaka-bot access token for releases.
70
+ token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
59
71
  - name: Tag the main branch
60
72
  run: |
61
- # Emulate the actions bot.
62
- git config user.name "github-actions[bot]"
63
- git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
73
+ # Set missing git config for the tag.
74
+ git config user.name "shaka-bot"
75
+ git config user.email "shaka-bot@users.noreply.github.com"
76
+ # Tag the main branch.
64
77
  VERSION=${{ needs.release.outputs.tag_name }}
65
78
  git tag -m "$VERSION-main" "$VERSION-main"
66
79
  git push origin "$VERSION-main"
@@ -155,6 +168,8 @@ jobs:
155
168
  - uses: actions/checkout@v3
156
169
  with:
157
170
  fetch-depth: 0
171
+ # Use a special shaka-bot access token for releases.
172
+ token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
158
173
 
159
174
  - name: Create release branch
160
175
  run: |
@@ -21,7 +21,7 @@ jobs:
21
21
  id: compute
22
22
  shell: bash
23
23
  env:
24
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24
+ GITHUB_TOKEN: ${{ secrets.SHAKA_BOT_TOKEN }}
25
25
  # Fetches the coverage data from the run that triggered the report,
26
26
  # parses it, compares it to the changed lines in the PR, and computes
27
27
  # the incremental code coverage.
@@ -36,4 +36,4 @@ jobs:
36
36
  message: "Incremental code coverage: ${{ steps.compute.outputs.coverage }}"
37
37
  comment_includes: "Incremental code coverage: "
38
38
  pr_number: ${{ steps.compute.outputs.pr_number }}
39
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39
+ GITHUB_TOKEN: ${{ secrets.SHAKA_BOT_TOKEN }}
@@ -0,0 +1,27 @@
1
+ # Copyright 2022 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ # The help command implementation.
16
+ # Assumes that lib.sh has been loaded and all required variables are set.
17
+
18
+ # Using single quotes to avoid executing the things in backticks, which are
19
+ # really markdown.
20
+ (
21
+ echo 'I honor the following commands from anyone:'
22
+ echo ' - `@shaka-bot help`: Show this help message'
23
+ echo ''
24
+ echo 'I honor the following commands from maintainers only:'
25
+ echo ' - `@shaka-bot test`: Start lab tests on all devices'
26
+ echo ' - `@shaka-bot test ce`: Start lab tests on CE devices only (no desktop browsers)'
27
+ ) | reply_from_pipe
@@ -0,0 +1,56 @@
1
+ # Copyright 2022 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ # The test command implementation.
16
+ # Assumes that lib.sh has been loaded and all required variables are set.
17
+
18
+ if ! check_permissions; then
19
+ reply "Only maintainers may start lab tests."
20
+ exit 0
21
+ fi
22
+
23
+ # These are passed to the lab testing workflow.
24
+ WORKFLOW_ARGS=( "pr=$PR_NUMBER" )
25
+
26
+ case "${SHAKA_BOT_ARGUMENTS[0]}" in
27
+ # CE devices only.
28
+ ce) WORKFLOW_ARGS+=( "browser_filter=Tizen Chromecast ChromeAndroid" ) ;;
29
+
30
+ # No command argument, no extra workflow arguments.
31
+ "") ;;
32
+
33
+ *)
34
+ reply "Unrecognized test argument: ${SHAKA_BOT_ARGUMENTS[0]}"
35
+ exit 1
36
+ ;;
37
+ esac
38
+
39
+ if start_workflow selenium-lab-tests.yaml "${WORKFLOW_ARGS[@]}"; then
40
+ (
41
+ echo "Lab tests started with arguments:"
42
+ for arg in "${WORKFLOW_ARGS[@]}"; do
43
+ echo " - \`$arg\`"
44
+ done
45
+ ) | reply_from_pipe
46
+ else
47
+ (
48
+ echo "I failed to start the lab test workflow."
49
+ echo ""
50
+ echo "Please check GitHub Actions logs for details."
51
+ ) | reply_from_pipe
52
+
53
+ # Fail this workflow to make it easier to find the right run
54
+ # and its logs.
55
+ exit 1
56
+ fi
@@ -0,0 +1,83 @@
1
+ # Copyright 2022 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ # Utilities for handling @shaka-bot commands.
16
+
17
+ # Ignore case in all string comparisons.
18
+ shopt -s nocasematch
19
+
20
+ function check_required_variable() {
21
+ local VAR_NAME="$1"
22
+
23
+ # The ! syntax here is Bash variable indirection.
24
+ if [[ -z "${!VAR_NAME}" ]]; then
25
+ echo "Missing environment variable: $VAR_NAME"
26
+ exit 1
27
+ fi
28
+ }
29
+
30
+ # Leaving a comment requires a token with "repo" scope.
31
+ function reply() {
32
+ echo "@$COMMENTER: $@" | \
33
+ gh issue comment "$PR_NUMBER" -R "$THIS_REPO" -F -
34
+ }
35
+
36
+ # Leaving a comment requires a token with "repo" scope.
37
+ function reply_from_pipe() {
38
+ (echo -n "@$COMMENTER: "; cat /dev/stdin) | \
39
+ gh issue comment "$PR_NUMBER" -R "$THIS_REPO" -F -
40
+ }
41
+
42
+ # Checking permissions requires a token with "repo" and "org:read" scopes, and
43
+ # write access.
44
+ function check_permissions() {
45
+ # Check permissions: this API call fails if the commenter has no special
46
+ # permissions on the repo.
47
+ gh api "/repos/$THIS_REPO/collaborators/$COMMENTER"
48
+ }
49
+
50
+ # Starting a workflow requires a token with "repo" scope and write access.
51
+ # $1 is the workflow filename. Subsequent arguments are key=value pairs to be
52
+ # passed as input to the workflow_dispatch event.
53
+ function start_workflow() {
54
+ local WORKFLOW="$1"
55
+ shift
56
+
57
+ # The gh command wants -f before each key-value pair. The caller shouldn't
58
+ # have to know that, so we rebuild the argument array with -f here.
59
+ local GH_ARGS=()
60
+ for arg in "$@"; do
61
+ GH_ARGS+=( "-f" "$arg" )
62
+ done
63
+
64
+ gh workflow run "$WORKFLOW" -R "$THIS_REPO" "${GH_ARGS[@]}"
65
+ }
66
+
67
+ # Outputs to global variables SHAKA_BOT_COMMAND and SHAKA_BOT_ARGUMENTS (array).
68
+ function parse_command() {
69
+ # Tokenize the comment by whitespace.
70
+ local TOKENS=( $COMMENT_BODY )
71
+
72
+ local INDEX
73
+ for (( INDEX=0; INDEX < ${#TOKENS[@]}; INDEX++ )); do
74
+ if [[ "${TOKENS[i]}" == "@shaka-bot" ]]; then
75
+ SHAKA_BOT_COMMAND="${TOKENS[i+1]}"
76
+ # A slice of all tokens starting with index i+2.
77
+ SHAKA_BOT_ARGUMENTS=( "${TOKENS[@]:i+2}" )
78
+ return 0
79
+ fi
80
+ done
81
+
82
+ return 1
83
+ }
@@ -0,0 +1,51 @@
1
+ # Copyright 2022 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ # Handle @shaka-bot commands commented on PRs.
16
+
17
+ # Run everything from the folder in which this script lives.
18
+ cd "$(dirname "$0")"
19
+
20
+ # Load utils.
21
+ . lib.sh
22
+
23
+ # Check required environment variables passed from the workflow.
24
+ # If running this manually while testing changes, supply these.
25
+ check_required_variable GH_TOKEN # With repo & org:read scope, write access
26
+ check_required_variable THIS_REPO # like shaka-project/shaka-player
27
+ check_required_variable COMMENTER # like joeyparrish
28
+ check_required_variable PR_NUMBER # like 1234
29
+ check_required_variable COMMENT_BODY # like "@shaka-bot howdy"
30
+
31
+ if [[ "$COMMENTER" == "shaka-bot" ]]; then
32
+ # Exclude comments by shaka-bot, who will sometimes use its own name.
33
+ exit 0
34
+ fi
35
+
36
+ # Parse the command. Outputs to globals SHAKA_BOT_COMMAND and
37
+ # SHAKA_BOT_ARGUMENTS (array).
38
+ parse_command
39
+
40
+ if [[ "$SHAKA_BOT_COMMAND" == "" ]]; then
41
+ # No command found.
42
+ exit 0
43
+ fi
44
+
45
+ echo "PR $PR_NUMBER, detected command $SHAKA_BOT_COMMAND"
46
+
47
+ case "$SHAKA_BOT_COMMAND" in
48
+ help) . command-help.sh ;;
49
+ test) . command-test.sh ;;
50
+ *) echo "Unknown command!" ;;
51
+ esac
@@ -0,0 +1,29 @@
1
+ name: Talk to Shaka Bot (PRs)
2
+
3
+ # Runs when comments are created or edited. Jobs below will be filtered to
4
+ # only run on PRs, not regular issues.
5
+ on:
6
+ issue_comment:
7
+ types: [created, edited]
8
+
9
+ jobs:
10
+ handle_command:
11
+ # Only runs on PRs that contain '@shaka-bot' comments, but not comments
12
+ # made by shaka-bot itself, who will sometimes use its own name.
13
+ # Note that contains() is not case sensitive.
14
+ if: github.event.issue.pull_request && contains(github.event.comment.body, '@shaka-bot') && github.event.comment.user.login != 'shaka-bot'
15
+ runs-on: [ubuntu-latest]
16
+ env:
17
+ # This token must have "repo" scope, "org:read" scope, and write access.
18
+ GH_TOKEN: ${{ secrets.SHAKA_BOT_TOKEN }}
19
+ THIS_REPO: ${{ github.repository }}
20
+ COMMENTER: ${{ github.event.comment.user.login }}
21
+ PR_NUMBER: ${{ github.event.issue.number }}
22
+ COMMENT_BODY: ${{ github.event.comment.body }}
23
+ steps:
24
+ - name: Checkout code
25
+ uses: actions/checkout@v3
26
+
27
+ - name: Handle command
28
+ shell: bash
29
+ run: .github/workflows/shaka-bot-commands/main.sh
@@ -23,7 +23,8 @@ jobs:
23
23
 
24
24
  - name: Update Issues
25
25
  env:
26
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26
+ # Use SHAKA_BOT_TOKEN if found, otherwise the default GITHUB_TOKEN.
27
+ GITHUB_TOKEN: ${{ secrets.SHAKA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
27
28
  run: |
28
29
  cd update-issues
29
30
  npm ci
@@ -1,19 +1,11 @@
1
1
  name: Validate PR Title
2
2
 
3
- # We recommend that maintainers use this Chrome/Firefox extension so that
4
- # squashed PRs will have the merged commit message default to the PR title and
5
- # description: https://github.com/zachwhaley/squashed-merge-message
6
- #
7
- # This avoids the need to amend commits after the fact to match the desired PR
8
- # syntax. As long as the PR itself is properly-formatted, this extension will
9
- # help you commit the right format to the repo, too. This, in turn, feeds the
10
- # changelog and release workflows.
11
-
12
3
  on:
13
4
  # NOTE: The automated PRs from release-please-action do not seem to trigger
14
5
  # any of the default PR triggers (opened, synchronize, reopened). So we need
15
6
  # additional types. This is a good set that makes it easy to trigger the
16
- # workflow manually if needed.
7
+ # workflow manually if needed. This is not neccessary if your release-please
8
+ # workflow uses a personal access token (PAT) from Shaka Bot.
17
9
  pull_request_target:
18
10
  types:
19
11
  - opened
@@ -30,6 +22,6 @@ jobs:
30
22
  name: Validate PR Title
31
23
  runs-on: ubuntu-latest
32
24
  steps:
33
- - uses: amannn/action-semantic-pull-request@v4
25
+ - uses: amannn/action-semantic-pull-request@v5
34
26
  env:
35
27
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.3.11](https://github.com/shaka-project/shaka-player/compare/v4.3.10...v4.3.11) (2023-09-02)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **HLS:** Allow audio groups on audio-only content ([#5578](https://github.com/shaka-project/shaka-player/issues/5578)) ([9028495](https://github.com/shaka-project/shaka-player/commit/90284959bda3c0cadcacbd7acbe0425d3028d9d5))
9
+
3
10
  ## [4.3.10](https://github.com/shaka-project/shaka-player/compare/v4.3.9...v4.3.10) (2023-08-30)
4
11
 
5
12
 
package/dist/locales.js CHANGED
@@ -721,45 +721,45 @@ shaka.ui.Locales.addTo = function(localization) {
721
721
  * @const
722
722
  */
723
723
  shaka.ui.Locales.Ids = {
724
- OFF: 'OFF',
725
- ENTER_LOOP_MODE: 'ENTER_LOOP_MODE',
726
- AIRPLAY: 'AIRPLAY',
727
- STATISTICS: 'STATISTICS',
728
- RESOLUTION: 'RESOLUTION',
729
- MORE_SETTINGS: 'MORE_SETTINGS',
730
- MUTE: 'MUTE',
731
- AUTO_QUALITY: 'AUTO_QUALITY',
732
- SUBTITLE_FORCED: 'SUBTITLE_FORCED',
733
- AD_PROGRESS: 'AD_PROGRESS',
734
- CAST: 'CAST',
735
- BACK: 'BACK',
736
- EXIT_LOOP_MODE: 'EXIT_LOOP_MODE',
737
- UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE',
724
+ QUALITY: 'QUALITY',
725
+ SEEK: 'SEEK',
726
+ REWIND: 'REWIND',
738
727
  VOLUME: 'VOLUME',
728
+ AIRPLAY: 'AIRPLAY',
729
+ UNMUTE: 'UNMUTE',
730
+ PAUSE: 'PAUSE',
731
+ ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
739
732
  LIVE: 'LIVE',
740
- PLAYBACK_RATE: 'PLAYBACK_RATE',
733
+ EXIT_LOOP_MODE: 'EXIT_LOOP_MODE',
741
734
  FULL_SCREEN: 'FULL_SCREEN',
742
- PICTURE_IN_PICTURE: 'PICTURE_IN_PICTURE',
743
- AD_TIME: 'AD_TIME',
744
- LOOP: 'LOOP',
745
- NOT_APPLICABLE: 'NOT_APPLICABLE',
746
- LANGUAGE: 'LANGUAGE',
747
- ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
748
- EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
749
- UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE',
750
- SKIP_TO_LIVE: 'SKIP_TO_LIVE',
735
+ CAST: 'CAST',
736
+ ON: 'ON',
737
+ UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE',
738
+ EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
751
739
  MULTIPLE_LANGUAGES: 'MULTIPLE_LANGUAGES',
752
- UNMUTE: 'UNMUTE',
753
- SEEK: 'SEEK',
754
740
  AD_DURATION: 'AD_DURATION',
741
+ PLAYBACK_RATE: 'PLAYBACK_RATE',
742
+ REPLAY: 'REPLAY',
743
+ BACK: 'BACK',
744
+ UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE',
745
+ ENTER_LOOP_MODE: 'ENTER_LOOP_MODE',
746
+ NOT_APPLICABLE: 'NOT_APPLICABLE',
747
+ RESOLUTION: 'RESOLUTION',
748
+ LOOP: 'LOOP',
749
+ SUBTITLE_FORCED: 'SUBTITLE_FORCED',
750
+ OFF: 'OFF',
751
+ AD_TIME: 'AD_TIME',
755
752
  CAPTIONS: 'CAPTIONS',
753
+ MORE_SETTINGS: 'MORE_SETTINGS',
754
+ MUTE: 'MUTE',
756
755
  PLAY: 'PLAY',
757
- REPLAY: 'REPLAY',
758
- EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
759
- ON: 'ON',
760
- REWIND: 'REWIND',
756
+ STATISTICS: 'STATISTICS',
757
+ PICTURE_IN_PICTURE: 'PICTURE_IN_PICTURE',
758
+ AD_PROGRESS: 'AD_PROGRESS',
759
+ LANGUAGE: 'LANGUAGE',
761
760
  FAST_FORWARD: 'FAST_FORWARD',
762
- PAUSE: 'PAUSE',
763
761
  SKIP_AD: 'SKIP_AD',
764
- QUALITY: 'QUALITY',
762
+ AUTO_QUALITY: 'AUTO_QUALITY',
763
+ EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
764
+ SKIP_TO_LIVE: 'SKIP_TO_LIVE',
765
765
  };