shaka-player 4.3.9 → 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.
- package/.github/workflows/build-and-test.yaml +11 -18
- package/.github/workflows/compute-incremental-coverage.py +3 -0
- package/.github/workflows/release-please.yaml +21 -6
- package/.github/workflows/report-incremental-coverage.yaml +2 -2
- package/.github/workflows/selenium-lab-tests.yaml +45 -10
- package/.github/workflows/shaka-bot-commands/command-help.sh +27 -0
- package/.github/workflows/shaka-bot-commands/command-test.sh +56 -0
- package/.github/workflows/shaka-bot-commands/lib.sh +83 -0
- package/.github/workflows/shaka-bot-commands/main.sh +51 -0
- package/.github/workflows/talk-to-shaka-bot.yaml +29 -0
- package/.github/workflows/update-issues.yaml +2 -1
- package/.github/workflows/validate-pr-title.yaml +3 -11
- package/CHANGELOG.md +17 -0
- package/demo/common/assets.js +59 -25
- package/demo/main.js +5 -0
- package/dist/demo.compiled.debug.js +15 -13
- package/dist/demo.compiled.debug.map +3 -3
- package/dist/demo.compiled.js +15 -13
- package/dist/demo.compiled.map +3 -3
- package/dist/locales.js +31 -31
- package/dist/receiver.compiled.debug.js +13 -11
- package/dist/receiver.compiled.debug.map +3 -3
- package/dist/receiver.compiled.js +13 -11
- package/dist/receiver.compiled.map +3 -3
- package/dist/shaka-player.compiled.d.ts +257 -257
- package/dist/shaka-player.compiled.debug.d.ts +257 -257
- package/dist/shaka-player.compiled.debug.js +9 -8
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.js +69 -69
- package/dist/shaka-player.compiled.map +2 -2
- package/dist/shaka-player.ui.d.ts +301 -301
- package/dist/shaka-player.ui.debug.d.ts +301 -301
- package/dist/shaka-player.ui.debug.js +16 -15
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.js +79 -79
- package/dist/shaka-player.ui.map +2 -2
- package/externs/shaka/namespace.js +2 -2
- package/karma.conf.js +2 -0
- package/lib/ads/client_side_ad_manager.js +14 -2
- package/lib/hls/hls_parser.js +1 -0
- package/lib/player.js +1 -1
- package/lib/util/platform.js +8 -0
- package/package.json +2 -2
- package/test/hls/hls_parser_unit.js +12 -13
- package/test/player_integration.js +4 -1
- package/test/test/util/ui_utils.js +5 -1
- package/ui/externs/ui.js +2 -2
- package/ui/seek_bar.js +7 -1
|
@@ -45,7 +45,7 @@ jobs:
|
|
|
45
45
|
# coverage instrumentation on full-stack player integration tests.
|
|
46
46
|
- os: ubuntu-latest
|
|
47
47
|
browser: Chrome
|
|
48
|
-
extra_flags: "--use-xvfb
|
|
48
|
+
extra_flags: "--use-xvfb"
|
|
49
49
|
- os: ubuntu-latest
|
|
50
50
|
browser: Firefox
|
|
51
51
|
extra_flags: "--use-xvfb"
|
|
@@ -70,6 +70,7 @@ jobs:
|
|
|
70
70
|
browser: Firefox
|
|
71
71
|
- os: windows-latest
|
|
72
72
|
browser: Edge
|
|
73
|
+
extra_flags: "--html-coverage-report --uncompiled"
|
|
73
74
|
|
|
74
75
|
# Disable fail-fast so that one matrix-job failing doesn't make the other
|
|
75
76
|
# ones end early.
|
|
@@ -87,19 +88,6 @@ jobs:
|
|
|
87
88
|
if: matrix.os == 'ubuntu-latest' && matrix.browser == 'Firefox'
|
|
88
89
|
run: sudo apt -y update && sudo apt -y install ffmpeg
|
|
89
90
|
|
|
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
|
-
|
|
103
91
|
- name: Checkout code
|
|
104
92
|
uses: actions/checkout@v3
|
|
105
93
|
with:
|
|
@@ -125,13 +113,18 @@ jobs:
|
|
|
125
113
|
# Install a launcher that can execute a shell script to launch this
|
|
126
114
|
npm install karma-script-launcher --save-dev
|
|
127
115
|
|
|
128
|
-
# When "Chrome for Testing" is installed on Mac, it gets
|
|
129
|
-
# of simply "Chrome". This other copy of Chrome,
|
|
130
|
-
# to have basic codecs like AAC and H264 available,
|
|
131
|
-
# test scenarios to fail. Deleting "Chrome for
|
|
116
|
+
# When "Chrome for Testing" is installed on Mac or Windows, it gets
|
|
117
|
+
# invoked instead of simply "Chrome". This other copy of Chrome,
|
|
118
|
+
# however, doesn't seem to have basic codecs like AAC and H264 available,
|
|
119
|
+
# causing many of our test scenarios to fail. Deleting "Chrome for
|
|
120
|
+
# Testing" fixes this.
|
|
132
121
|
- name: 'Delete "Chrome for Testing" on Mac'
|
|
133
122
|
if: matrix.os == 'macos-latest' && matrix.browser == 'Chrome'
|
|
134
123
|
run: sudo rm -rf /Applications/Google\ Chrome\ for\ Testing.app
|
|
124
|
+
- name: 'Overwrite "Chrome for Testing" on Windows'
|
|
125
|
+
if: matrix.os == 'windows-latest' && matrix.browser == 'Chrome'
|
|
126
|
+
shell: bash
|
|
127
|
+
run: choco install -y googlechrome --ignore-checksums
|
|
135
128
|
|
|
136
129
|
# Some CI images (self-hosted or otherwise) don't have the minimum Java
|
|
137
130
|
# version necessary for the compiler (Java 11).
|
|
@@ -24,6 +24,9 @@ import zipfile
|
|
|
24
24
|
|
|
25
25
|
# TODO(joeyparrish): Figure out how to get karma to output relative paths only.
|
|
26
26
|
def StripGitDir(path):
|
|
27
|
+
# Convert Windows-style paths to Unix-style paths so we can read coverage
|
|
28
|
+
# data from Windows runners, too.
|
|
29
|
+
path = path.replace('\\', '/')
|
|
27
30
|
# Strip the path to the git clone, leaving only the source path within the
|
|
28
31
|
# repo.
|
|
29
32
|
return re.sub(r'.*?/(lib|ui)/', r'\1/', path)
|
|
@@ -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
|
-
#
|
|
42
|
-
git config user.name "
|
|
43
|
-
git config user.email "
|
|
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
|
-
#
|
|
62
|
-
git config user.name "
|
|
63
|
-
git config user.email "
|
|
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.
|
|
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.
|
|
39
|
+
GITHUB_TOKEN: ${{ secrets.SHAKA_BOT_TOKEN }}
|
|
@@ -148,6 +148,30 @@ jobs:
|
|
|
148
148
|
- name: Build Player
|
|
149
149
|
run: python3 build/all.py
|
|
150
150
|
|
|
151
|
+
- name: Preprocess with Babel
|
|
152
|
+
run: |
|
|
153
|
+
# Run the test preprocessor without running the actual tests.
|
|
154
|
+
# This lets us cache Babel's output and run it only once.
|
|
155
|
+
# Ignore the exit code, since you get an error code if the filter
|
|
156
|
+
# excludes all tests.
|
|
157
|
+
./build/test.py \
|
|
158
|
+
--use-xvfb --browsers Chrome \
|
|
159
|
+
--filter ThisFilterMatchesNoTests || true
|
|
160
|
+
|
|
161
|
+
- name: Cache dependencies
|
|
162
|
+
uses: actions/cache@v3
|
|
163
|
+
id: npm-cache
|
|
164
|
+
with:
|
|
165
|
+
path: node_modules/
|
|
166
|
+
key: node-${{ hashFiles('package-lock.json') }}
|
|
167
|
+
|
|
168
|
+
- name: Cache Babel output
|
|
169
|
+
uses: actions/cache@v3
|
|
170
|
+
id: babel-cache
|
|
171
|
+
with:
|
|
172
|
+
path: .babel-cache
|
|
173
|
+
key: babel-${{ hashFiles('*.js', 'demo/**.js', 'lib/**.js', 'ui/**.js', 'test/**.js', 'third_party/**.js') }}
|
|
174
|
+
|
|
151
175
|
- name: Store Player build
|
|
152
176
|
uses: actions/upload-artifact@v3
|
|
153
177
|
with:
|
|
@@ -206,6 +230,17 @@ jobs:
|
|
|
206
230
|
with:
|
|
207
231
|
path: node_modules/
|
|
208
232
|
key: node-${{ hashFiles('package-lock.json') }}
|
|
233
|
+
fail-on-cache-miss: true # Cached by the build-shaka job above
|
|
234
|
+
enableCrossOsArchive: true # Share archives from Linux to Windows
|
|
235
|
+
|
|
236
|
+
- name: Cache Babel output
|
|
237
|
+
uses: actions/cache@v3
|
|
238
|
+
id: babel-cache
|
|
239
|
+
with:
|
|
240
|
+
path: .babel-cache
|
|
241
|
+
key: babel-${{ hashFiles('*.js', 'demo/**.js', 'lib/**.js', 'ui/**.js', 'test/**.js', 'third_party/**.js') }}
|
|
242
|
+
fail-on-cache-miss: true # Cached by the build-shaka job above
|
|
243
|
+
enableCrossOsArchive: true # Share archives from Linux to Windows
|
|
209
244
|
|
|
210
245
|
- name: Install dependencies
|
|
211
246
|
if: steps.npm-cache.outputs.cache-hit != 'true'
|
|
@@ -221,9 +256,9 @@ jobs:
|
|
|
221
256
|
|
|
222
257
|
# Run tests on the Selenium grid in our lab. This uses a private
|
|
223
258
|
# hostname and TLS cert to get EME tests working on all platforms
|
|
224
|
-
# (since EME only works on https or localhost). The variable
|
|
225
|
-
# must be defined by the self-hosted runner, and mapped
|
|
226
|
-
# the container.
|
|
259
|
+
# (since EME only works on https or localhost). The variable
|
|
260
|
+
# ALLOCATED_PORT must be defined by the self-hosted runner, and mapped
|
|
261
|
+
# from the host to the container.
|
|
227
262
|
- name: Test Player
|
|
228
263
|
run: |
|
|
229
264
|
# Use of an array keeps elements intact, and allows an element to
|
|
@@ -234,7 +269,7 @@ jobs:
|
|
|
234
269
|
# Generate a coverage report from uncompiled code on ChromeLinux.
|
|
235
270
|
# It should be the uncompiled build, or else we won't execute any
|
|
236
271
|
# coverage instrumentation on full-stack player integration tests.
|
|
237
|
-
if [[ "${{ matrix.browser }}" == "
|
|
272
|
+
if [[ "${{ matrix.browser }}" == "Edge" ]]; then
|
|
238
273
|
extra_flags+=(--html-coverage-report --uncompiled)
|
|
239
274
|
fi
|
|
240
275
|
|
|
@@ -254,7 +289,7 @@ jobs:
|
|
|
254
289
|
--tls-key /etc/letsencrypt/live/karma.shakalab.rocks/privkey.pem \
|
|
255
290
|
--tls-cert /etc/letsencrypt/live/karma.shakalab.rocks/fullchain.pem \
|
|
256
291
|
--hostname karma.shakalab.rocks \
|
|
257
|
-
--port $
|
|
292
|
+
--port $ALLOCATED_PORT \
|
|
258
293
|
--grid-config build/shaka-lab.yaml \
|
|
259
294
|
--grid-address selenium-grid.lab.shaka:4444 \
|
|
260
295
|
--browsers ${{ matrix.browser }} \
|
|
@@ -271,10 +306,10 @@ jobs:
|
|
|
271
306
|
# Report the captured (and possibly overridden) exit status.
|
|
272
307
|
exit $exit_code
|
|
273
308
|
|
|
274
|
-
- name: Find coverage report (
|
|
309
|
+
- name: Find coverage report (Edge only)
|
|
275
310
|
id: coverage
|
|
276
|
-
# Run even if an earlier step fails, but only on
|
|
277
|
-
if: ${{ always() && matrix.browser == '
|
|
311
|
+
# Run even if an earlier step fails, but only on Edge.
|
|
312
|
+
if: ${{ always() && matrix.browser == 'Edge' }}
|
|
278
313
|
shell: bash
|
|
279
314
|
run: |
|
|
280
315
|
# Find the path to the coverage report specifically for Chrome on
|
|
@@ -282,7 +317,7 @@ jobs:
|
|
|
282
317
|
# will vary. Having a single path will make the artifact zip
|
|
283
318
|
# simpler, whereas using a wildcard in the upload step will result
|
|
284
319
|
# in a zip file with internal directories.
|
|
285
|
-
coverage_report="$( (ls coverage/
|
|
320
|
+
coverage_report="$( (ls coverage/Edge*/coverage.json || true) | head -1 )"
|
|
286
321
|
|
|
287
322
|
# Show what's there, for debugging purposes.
|
|
288
323
|
ls -l coverage/
|
|
@@ -295,7 +330,7 @@ jobs:
|
|
|
295
330
|
exit 1
|
|
296
331
|
fi
|
|
297
332
|
|
|
298
|
-
- name: Upload coverage report (
|
|
333
|
+
- name: Upload coverage report (Edge only)
|
|
299
334
|
uses: actions/upload-artifact@v3
|
|
300
335
|
# If there's a coverage report, upload it, even if a previous step
|
|
301
336
|
# failed.
|
|
@@ -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
|
-
|
|
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@
|
|
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,22 @@
|
|
|
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
|
+
|
|
10
|
+
## [4.3.10](https://github.com/shaka-project/shaka-player/compare/v4.3.9...v4.3.10) (2023-08-30)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **Ads:** Initialize correctly the IMA ads manager ([#5541](https://github.com/shaka-project/shaka-player/issues/5541)) ([f15ba16](https://github.com/shaka-project/shaka-player/commit/f15ba16f7742790fad7ed5212c0605b418f37db5))
|
|
16
|
+
* **Demo:** Show correctly external text in the Demo ([#5521](https://github.com/shaka-project/shaka-player/issues/5521)) ([01403c4](https://github.com/shaka-project/shaka-player/commit/01403c43441fe8a2dd305f63fa1394127dfdd89b))
|
|
17
|
+
* Orange set top box is incorrectly categorized as Apple ([#5545](https://github.com/shaka-project/shaka-player/issues/5545)) ([f0f1281](https://github.com/shaka-project/shaka-player/commit/f0f12813772560a0063ad4de521b31391c52d932))
|
|
18
|
+
* **UI:** Fix playback restarts in safari when click on seekbar end ([#5527](https://github.com/shaka-project/shaka-player/issues/5527)) ([8263c73](https://github.com/shaka-project/shaka-player/commit/8263c736b6309afda3add0174a9508b74b3ed379))
|
|
19
|
+
|
|
3
20
|
## [4.3.9](https://github.com/shaka-project/shaka-player/compare/v4.3.8...v4.3.9) (2023-08-21)
|
|
4
21
|
|
|
5
22
|
|