shaka-player 3.2.8 → 3.2.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.
Files changed (146) hide show
  1. package/.github/workflows/build-and-test.yaml +67 -15
  2. package/.github/workflows/compute-incremental-coverage.py +251 -0
  3. package/.github/workflows/report-incremental-coverage.yaml +39 -0
  4. package/.github/workflows/selenium-lab-tests.yaml +44 -1
  5. package/AUTHORS +1 -1
  6. package/CHANGELOG.md +37 -0
  7. package/CONTRIBUTORS +4 -1
  8. package/README.md +20 -6
  9. package/demo/common/assets.js +1 -1
  10. package/demo/index.html +0 -2
  11. package/demo/main.js +3 -3
  12. package/dist/controls.css +1 -1
  13. package/dist/demo.compiled.debug.js +3 -3
  14. package/dist/demo.compiled.debug.map +2 -2
  15. package/dist/demo.compiled.js +3 -3
  16. package/dist/demo.compiled.map +2 -2
  17. package/dist/deps.js +2 -2
  18. package/dist/locales.js +29 -29
  19. package/dist/receiver.compiled.debug.js +1 -1
  20. package/dist/receiver.compiled.debug.map +1 -1
  21. package/dist/receiver.compiled.js +1 -1
  22. package/dist/receiver.compiled.map +1 -1
  23. package/dist/shaka-player.compiled.d.ts +12 -1
  24. package/dist/shaka-player.compiled.debug.d.ts +12 -1
  25. package/dist/shaka-player.compiled.debug.externs.js +49 -38
  26. package/dist/shaka-player.compiled.debug.js +238 -227
  27. package/dist/shaka-player.compiled.debug.map +4 -4
  28. package/dist/shaka-player.compiled.externs.js +49 -38
  29. package/dist/shaka-player.compiled.js +766 -760
  30. package/dist/shaka-player.compiled.map +4 -4
  31. package/dist/shaka-player.ui.d.ts +12 -1
  32. package/dist/shaka-player.ui.debug.d.ts +12 -1
  33. package/dist/shaka-player.ui.debug.externs.js +49 -38
  34. package/dist/shaka-player.ui.debug.js +227 -217
  35. package/dist/shaka-player.ui.debug.map +4 -4
  36. package/dist/shaka-player.ui.externs.js +49 -38
  37. package/dist/shaka-player.ui.js +870 -865
  38. package/dist/shaka-player.ui.map +4 -4
  39. package/docs/tutorials/welcome.md +6 -3
  40. package/karma.conf.js +3 -11
  41. package/lib/dash/dash_parser.js +5 -0
  42. package/lib/hls/hls_parser.js +14 -6
  43. package/lib/media/drm_engine.js +1 -1
  44. package/lib/media/presentation_timeline.js +24 -1
  45. package/lib/media/streaming_engine.js +1 -0
  46. package/lib/player.js +1 -6
  47. package/lib/polyfill/media_capabilities.js +3 -0
  48. package/lib/polyfill/videoplaybackquality.js +3 -1
  49. package/lib/text/cue.js +0 -5
  50. package/lib/text/simple_text_displayer.js +21 -9
  51. package/lib/text/ui_text_displayer.js +83 -19
  52. package/lib/util/buffer_utils.js +3 -0
  53. package/lib/util/object_utils.js +1 -0
  54. package/lib/util/platform.js +41 -1
  55. package/lib/util/stream_utils.js +24 -3
  56. package/lib/util/string_utils.js +102 -13
  57. package/maintained-branches.md +15 -0
  58. package/package.json +6 -5
  59. package/test/text/simple_text_displayer_unit.js +27 -0
  60. package/test/text/ui_text_displayer_unit.js +65 -0
  61. package/test/util/string_utils_unit.js +46 -8
  62. package/app-engine/README.md +0 -9
  63. package/app-engine/demo-version-index/README.md +0 -14
  64. package/app-engine/demo-version-index/app.yaml +0 -2
  65. package/app-engine/demo-version-index/main.py +0 -162
  66. package/app-engine/demo-version-index/requirements.txt +0 -6
  67. package/app-engine/demo-version-index/templates/index.html +0 -114
  68. package/app-engine/shaka-player-demo/README.md +0 -18
  69. package/app-engine/shaka-player-demo/app.yaml +0 -61
  70. package/app-engine/shaka-player-demo/main.py +0 -95
  71. package/app-engine/shaka-player-demo/posters/10yo.png +0 -0
  72. package/app-engine/shaka-player-demo/posters/10yo.xcf +0 -0
  73. package/app-engine/shaka-player-demo/posters/1yo.jpg +0 -0
  74. package/app-engine/shaka-player-demo/posters/2yo.png +0 -0
  75. package/app-engine/shaka-player-demo/posters/2yo.xcf +0 -0
  76. package/app-engine/shaka-player-demo/posters/3yo.png +0 -0
  77. package/app-engine/shaka-player-demo/posters/3yo.xcf +0 -0
  78. package/app-engine/shaka-player-demo/posters/4yo.png +0 -0
  79. package/app-engine/shaka-player-demo/posters/4yo.xcf +0 -0
  80. package/app-engine/shaka-player-demo/posters/5yo.png +0 -0
  81. package/app-engine/shaka-player-demo/posters/5yo.xcf +0 -0
  82. package/app-engine/shaka-player-demo/posters/6yo.png +0 -0
  83. package/app-engine/shaka-player-demo/posters/6yo.xcf +0 -0
  84. package/app-engine/shaka-player-demo/posters/7yo.png +0 -0
  85. package/app-engine/shaka-player-demo/posters/7yo.xcf +0 -0
  86. package/app-engine/shaka-player-demo/posters/8yo.png +0 -0
  87. package/app-engine/shaka-player-demo/posters/8yo.xcf +0 -0
  88. package/app-engine/shaka-player-demo/posters/9yo.png +0 -0
  89. package/app-engine/shaka-player-demo/posters/9yo.xcf +0 -0
  90. package/app-engine/shaka-player-demo/posters/audioOnly.gif +0 -0
  91. package/app-engine/shaka-player-demo/posters/audioRickRoll.gif +0 -0
  92. package/app-engine/shaka-player-demo/posters/colorbars.gif +0 -0
  93. package/app-engine/shaka-player-demo/posters/fireworks.jpg +0 -0
  94. package/app-engine/shaka-player-demo/posters/party-hat.png +0 -0
  95. package/app-engine/shaka-player-demo/posters/sources.txt +0 -46
  96. package/app-engine/shaka-player-demo/posters/standard.png +0 -0
  97. package/app-engine/shaka-player-demo/posters/trek.jpg +0 -0
  98. package/app-engine/shaka-player-demo/posters/valentines.png +0 -0
  99. package/app-engine/shaka-player-demo/posters/zombie.jpg +0 -0
  100. package/app-engine/shaka-player-demo/posters.py +0 -110
  101. package/app-engine/shaka-player-demo/requirements.txt +0 -5
  102. package/app-engine/shaka-player-demo/time.txt +0 -1
  103. package/build/README.md +0 -127
  104. package/build/__init__.py +0 -0
  105. package/build/all.py +0 -150
  106. package/build/apps.py +0 -186
  107. package/build/build.py +0 -392
  108. package/build/check.py +0 -354
  109. package/build/checkversion.py +0 -84
  110. package/build/compiler.py +0 -513
  111. package/build/conformance.textproto +0 -321
  112. package/build/docker/Dockerfile +0 -20
  113. package/build/docker/docker-compose.yml +0 -10
  114. package/build/docs.py +0 -54
  115. package/build/eslint-plugin-shaka-rules/arg-comment-spacing.js +0 -72
  116. package/build/eslint-plugin-shaka-rules/index.js +0 -24
  117. package/build/eslint-plugin-shaka-rules/package.json +0 -7
  118. package/build/eslint-plugin-shaka-rules/private.js +0 -109
  119. package/build/gendeps.py +0 -71
  120. package/build/generateExterns.js +0 -867
  121. package/build/generateLocalizations.py +0 -262
  122. package/build/generateTsDefs.py +0 -137
  123. package/build/install-linux-prereqs.sh +0 -136
  124. package/build/license-header +0 -5
  125. package/build/misspellings.txt +0 -38
  126. package/build/pixelsChanged.js +0 -35
  127. package/build/shaka-lab.yaml +0 -163
  128. package/build/shakaBuildHelpers.py +0 -356
  129. package/build/stats.py +0 -816
  130. package/build/subprocessWindowsPatch.py +0 -103
  131. package/build/test.py +0 -541
  132. package/build/types/ads +0 -8
  133. package/build/types/cast +0 -6
  134. package/build/types/cea +0 -13
  135. package/build/types/complete +0 -9
  136. package/build/types/core +0 -106
  137. package/build/types/dash +0 -8
  138. package/build/types/hls +0 -9
  139. package/build/types/manifests +0 -5
  140. package/build/types/networking +0 -6
  141. package/build/types/offline +0 -21
  142. package/build/types/polyfill +0 -19
  143. package/build/types/text +0 -11
  144. package/build/types/ui +0 -37
  145. package/build/updateScreenshots.py +0 -85
  146. package/build/wrapper.template.js +0 -52
@@ -38,23 +38,34 @@ jobs:
38
38
  needs: lint
39
39
  strategy:
40
40
  matrix:
41
- os: ["ubuntu-latest", "macos-latest", "windows-latest"]
42
- browser: ["Chrome", "Firefox", "Edge", "Safari", "Safari-14"]
43
- exclude:
44
- - os: ubuntu-latest
45
- browser: Edge
46
- - os: windows-latest
47
- browser: Safari
48
- - os: windows-latest
49
- browser: Safari-14
50
- - os: ubuntu-latest
51
- browser: Safari
52
- - os: ubuntu-latest
53
- browser: Safari-14
54
41
  include:
55
42
  # Run Linux browsers with xvfb, so they're in a headless X session.
43
+ # Additionally, generate a code coverage report from Linux Chrome.
44
+ - os: ubuntu-latest
45
+ browser: Chrome
46
+ extra_flags: "--use-xvfb --html-coverage-report"
56
47
  - os: ubuntu-latest
48
+ browser: Firefox
57
49
  extra_flags: "--use-xvfb"
50
+
51
+ - os: macos-latest
52
+ browser: Chrome
53
+ - os: macos-latest
54
+ browser: Firefox
55
+ - os: macos-latest
56
+ browser: Edge
57
+ - os: macos-latest
58
+ browser: Safari
59
+ - os: macos-latest
60
+ browser: Safari-14
61
+
62
+ - os: windows-latest
63
+ browser: Chrome
64
+ - os: windows-latest
65
+ browser: Firefox
66
+ - os: windows-latest
67
+ browser: Edge
68
+
58
69
  # Disable fail-fast so that one matrix-job failing doesn't make the other
59
70
  # ones end early.
60
71
  fail-fast: false
@@ -86,10 +97,11 @@ jobs:
86
97
  run: |
87
98
  # Download Safari 14
88
99
  # See also https://www.macupdate.com/app/mac/15675/apple-safari/old-versions
89
- curl -Lv https://www.macupdate.com/action/download/63550 > safari-14.1.2.pkg
100
+ curl -Lv https://www.macupdate.com/action/download/62946 > Safari14.0CatalinaAuto.pkg.zip
90
101
 
91
102
  # Install Safari 14 to homedir specifically.
92
- installer -pkg safari-14.1.2.pkg -target CurrentUserHomeDirectory
103
+ unzip Safari14.0CatalinaAuto.pkg.zip
104
+ installer -pkg Safari14.0CatalinaAuto.pkg -target CurrentUserHomeDirectory
93
105
 
94
106
  # Install a launcher that can execute a shell script to launch this
95
107
  npm install karma-script-launcher --save-dev
@@ -113,6 +125,46 @@ jobs:
113
125
  --reporters spec --spec-hide-passed \
114
126
  ${{ matrix.extra_flags }}
115
127
 
128
+ - name: Find coverage reports
129
+ id: coverage
130
+ if: always() # Even on failure of an earlier step.
131
+ shell: bash
132
+ run: |
133
+ # If the "coverage" directory exists...
134
+ if [ -d coverage ]; then
135
+ # Find the path to the coverage output folder. It includes the
136
+ # exact browser version in the path, so it will vary.
137
+ coverage_folder="$( (ls -d coverage/* || true) | head -1 )"
138
+
139
+ # Build a folder to stage all the coverage artifacts with
140
+ # predictable paths. The resulting zip file will not have any
141
+ # internal directories.
142
+ mkdir coverage/staging/
143
+ cp "$coverage_folder"/coverage.json coverage/staging/
144
+ cp "$coverage_folder"/coverage-details.json coverage/staging/
145
+ echo "${{ github.event.number }}" > coverage/staging/pr-number.json
146
+
147
+ echo "::set-output name=coverage_found::true"
148
+ echo "Coverage report staged."
149
+ else
150
+ echo "No coverage report generated."
151
+ fi
152
+
153
+ - name: Upload coverage reports
154
+ uses: actions/upload-artifact@v3
155
+ if: ${{ always() && steps.coverage.outputs.coverage_found }}
156
+ with:
157
+ name: coverage
158
+ # This will create a download called coverage.zip containing all of
159
+ # these files, with no internal folders.
160
+ path: |
161
+ coverage/staging/coverage.json
162
+ coverage/staging/coverage-details.json
163
+ coverage/staging/pr-number.json
164
+ # Since we've already filtered this step for instances where there is
165
+ # an environment variable set, the file should definitely be there.
166
+ if-no-files-found: error
167
+
116
168
  build_in_docker:
117
169
  # Don't waste time doing a full matrix of test runs when there was an
118
170
  # obvious linter error.
@@ -0,0 +1,251 @@
1
+ #!/usr/bin/env python3
2
+ #
3
+ # Copyright 2022 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ import argparse
18
+ import io
19
+ import json
20
+ import re
21
+ import subprocess
22
+ import zipfile
23
+
24
+ # TODO(joeyparrish): Figure out how to get karma to output relative paths only.
25
+ def StripGitDir(path):
26
+ # Strip the path to the git clone, leaving only the source path within the
27
+ # repo.
28
+ return re.sub(r'.*?/(lib|ui)/', r'\1/', path)
29
+
30
+ def RunCommand(args, text=True):
31
+ proc = subprocess.run(args, capture_output=True, text=text)
32
+ if proc.returncode != 0:
33
+ raise RuntimeError("Command failed:", args, proc.stdout, proc.stderr)
34
+ return proc.stdout
35
+
36
+ def GitHubApi(repo, path, text=True):
37
+ args = ["gh", "api", "/repos/%s/%s" % (repo, path)]
38
+ output = RunCommand(args, text)
39
+ if text:
40
+ return json.loads(output)
41
+ else:
42
+ return output
43
+
44
+ def GetCoverageArtifacts(repo, run_id):
45
+ # Fetch all artifacts from this run ID.
46
+ api_path = "actions/runs/%s/artifacts" % run_id
47
+ results = GitHubApi(repo, api_path)["artifacts"]
48
+ # Get the one that is named "coverage" (should be the only one).
49
+ artifact = list(filter(lambda x: x["name"] == "coverage", results))[0]
50
+
51
+ # Fetch and open the zip file containing the artifacts.
52
+ api_path = "actions/artifacts/%s/zip" % artifact["id"]
53
+ zip_data = GitHubApi(repo, api_path, text=False)
54
+ return zipfile.ZipFile(io.BytesIO(zip_data), 'r')
55
+
56
+ def CoverageLines(coverage_range):
57
+ start_line = coverage_range["start"]["line"]
58
+ end_line = coverage_range["end"]["line"]
59
+
60
+ lines = set()
61
+ for line in range(start_line, end_line + 1):
62
+ lines.add(line)
63
+ return lines
64
+
65
+ class CoverageDetails(object):
66
+ def __init__(self, file_data):
67
+ json_data = json.loads(file_data)
68
+
69
+ self.files = {}
70
+
71
+ # The structure is something like:
72
+ # {
73
+ # "/path/to/lib/player.js": {
74
+ # "statementMap": { ... },
75
+ # "fnMap": { ... },
76
+ # "s": { ... }
77
+ # }
78
+ # }
79
+ for path, path_data in json_data.items():
80
+ path = StripGitDir(path)
81
+
82
+ statement_to_lines = {}
83
+ instrumented_lines = set()
84
+
85
+ # The function map is a structure to map where each function is in a
86
+ # source file:
87
+ # {
88
+ # "0": {
89
+ # "loc": {
90
+ # "start": {
91
+ # "line": 7,
92
+ # "column": 0
93
+ # },
94
+ # "end": {
95
+ # "line": 8,
96
+ # "column": 29
97
+ # }
98
+ # }
99
+ # },
100
+ # ...
101
+ # }
102
+ # We extract function locations and remove them from statement spans
103
+ # below, so that we don't count (for example) class declaration statements
104
+ # as containing all the lines of every method in the class.
105
+ function_locations = []
106
+ for key, value in path_data["fnMap"].items():
107
+ lines = CoverageLines(value["loc"])
108
+ function_locations.append(lines)
109
+
110
+ # The statement map is a structure to map where each statement is in a
111
+ # source file:
112
+ # {
113
+ # "0": {
114
+ # "start": {
115
+ # "line": 7,
116
+ # "column": 0
117
+ # },
118
+ # "end": {
119
+ # "line": 8,
120
+ # "column": 29
121
+ # }
122
+ # },
123
+ # ...
124
+ # }
125
+ for key, value in path_data["statementMap"].items():
126
+ # All the lines of the statement, which may include other functions or
127
+ # statements.
128
+ lines = CoverageLines(value)
129
+
130
+ # Subtract from that the lines of any function that is a subset of
131
+ # these lines. By excluding entire methods before adding back their
132
+ # child statements, we exclude empty lines in class methods.
133
+ for function_lines in function_locations:
134
+ if function_lines < lines: # strict subset
135
+ lines -= function_lines # set subtraction
136
+
137
+ # If this statement is inside the range of another statement, remove
138
+ # this inner range from that outer one. This is important because loops
139
+ # and conditional statements contain their inner branches.
140
+ for older_key, older_lines in statement_to_lines.items():
141
+ # Check for a proper subset (lines contains all elements of
142
+ # child_lines, but child_lines is not an equal set).
143
+ if lines < older_lines: # strict subset
144
+ statement_to_lines[older_key] -= lines # set subtraction
145
+
146
+ statement_to_lines[key] = lines
147
+
148
+ # Whatever is left in any statement, we count as instrumented.
149
+ for key, lines in statement_to_lines.items():
150
+ for line in lines:
151
+ instrumented_lines.add(line)
152
+
153
+ # The "s" field is a map from statement numbers to number of times
154
+ # executed.
155
+ executed_lines = set()
156
+ for key, executed in path_data["s"].items():
157
+ if executed:
158
+ for line in statement_to_lines[key]:
159
+ executed_lines.add(line)
160
+
161
+ self.files[path] = {
162
+ "instrumented": instrumented_lines,
163
+ "executed": executed_lines,
164
+ }
165
+
166
+ class PullRequest(object):
167
+ def __init__(self, repo, number):
168
+ data = GitHubApi(repo, "pulls/%d" % number)
169
+ sha = data["merge_commit_sha"]
170
+
171
+ self.number = number
172
+ self.changes = {}
173
+
174
+ files = GitHubApi(repo, "commits/%s" % sha)["files"]
175
+
176
+ for file_data in files:
177
+ # The patch field is missing for binary files. Skip those.
178
+ if "patch" not in file_data:
179
+ continue
180
+
181
+ filename = file_data["filename"]
182
+ patch = file_data["patch"]
183
+
184
+ # Parse through the unified diff in "patch" to find the touched line
185
+ # numbers.
186
+ touched_lines = []
187
+ line_number = None
188
+ for line in patch.split("\n"):
189
+ if line[0] == "@":
190
+ # Turns a header like "@@ -749,7 +757,19 @@ foo" into line number 757.
191
+ # Note that the last part of the new file range could be omitted:
192
+ # "@@ -0,0 +1 @@ foo"
193
+ new_file_range = line.split("+")[1].split(" @@")[0]
194
+ line_number = int(new_file_range.split(",")[0])
195
+ elif line[0] == " ":
196
+ line_number += 1
197
+ elif line[0] == "+":
198
+ touched_lines.append(line_number)
199
+ line_number += 1
200
+
201
+ self.changes[filename] = touched_lines
202
+
203
+ def IncrementalCoverage(pr, coverage_details):
204
+ num_changed = 0
205
+ num_covered = 0
206
+
207
+ for path in pr.changes:
208
+ if path in coverage_details.files:
209
+ changed_lines = pr.changes[path]
210
+ instrumented_lines = coverage_details.files[path]["instrumented"]
211
+ executed_lines = coverage_details.files[path]["executed"]
212
+
213
+ for line in changed_lines:
214
+ # Only count the instrumented lines, not whitespace or comments.
215
+ if line in instrumented_lines:
216
+ num_changed += 1
217
+ if line in executed_lines:
218
+ num_covered += 1
219
+
220
+ if num_changed == 0:
221
+ return None
222
+ return num_covered / num_changed
223
+
224
+ def main():
225
+ parser = argparse.ArgumentParser(
226
+ description="Compute incremental code coverage for a PR",
227
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter)
228
+ parser.add_argument(
229
+ "--repo",
230
+ required=True,
231
+ help="The GitHub repo, such as shaka-project/shaka-player")
232
+ parser.add_argument(
233
+ "--run-id",
234
+ required=True,
235
+ help="The workflow run ID to download coverage data from")
236
+ args = parser.parse_args()
237
+
238
+ artifacts = GetCoverageArtifacts(args.repo, args.run_id)
239
+ coverage_details = CoverageDetails(artifacts.read("coverage-details.json"))
240
+ pr_number = json.loads(artifacts.read("pr-number.json"))
241
+ pr = PullRequest(args.repo, pr_number)
242
+ coverage = IncrementalCoverage(pr, coverage_details)
243
+
244
+ print("::set-output name=pr_number::%d" % pr_number)
245
+ if coverage is None:
246
+ print("::set-output name=coverage::No instrumented code was changed.")
247
+ else:
248
+ print("::set-output name=coverage::%.2f%%" % (coverage * 100.0))
249
+
250
+ if __name__ == "__main__":
251
+ main()
@@ -0,0 +1,39 @@
1
+ name: Report Incremental Coverage
2
+
3
+ # Runs when the build and test workflow completes. This will run with full
4
+ # privileges, even if the other workflow doesn't. That allows us to leave PR
5
+ # comments, when we would not be able to do so otherwise.
6
+ on:
7
+ workflow_run:
8
+ workflows: [Build and Test PR]
9
+ types: [completed]
10
+
11
+ jobs:
12
+ report:
13
+ if: ${{ github.event.workflow_run.event == 'pull_request' }}
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - name: Checkout code
18
+ uses: actions/checkout@v2
19
+
20
+ - name: Compute incremental code coverage
21
+ id: compute
22
+ shell: bash
23
+ env:
24
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25
+ # Fetches the coverage data from the run that triggered the report,
26
+ # parses it, compares it to the changed lines in the PR, and computes
27
+ # the incremental code coverage.
28
+ run: |
29
+ python .github/workflows/compute-incremental-coverage.py \
30
+ --repo ${{ github.repository }} \
31
+ --run-id ${{ github.event.workflow_run.id }}
32
+
33
+ - name: Report incremental code coverage
34
+ uses: thollander/actions-comment-pull-request@686ab1cab89e0f715a44a0d04b9fdfdd4f33d751
35
+ with:
36
+ message: "Incremental code coverage: ${{ steps.compute.outputs.coverage }}"
37
+ comment_includes: "Incremental code coverage: "
38
+ pr_number: ${{ steps.compute.outputs.pr_number }}
39
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -80,7 +80,50 @@ jobs:
80
80
  --hostname karma.shakalab.rocks \
81
81
  --port 61731 \
82
82
  --grid-config build/shaka-lab.yaml \
83
- --grid-address selenium-grid.lab:4444
83
+ --grid-address selenium-grid.lab:4444 \
84
+ --html-coverage-report
85
+
86
+ - name: Find coverage report
87
+ id: coverage
88
+ if: always() # Even on failure of an earlier step.
89
+ shell: bash
90
+ run: |
91
+ # If the directory exists...
92
+ if [ -d coverage ]; then
93
+ # Find the path to the coverage report specifically for Chrome on
94
+ # Linux. It includes the exact browser version in the path, so it
95
+ # will vary. Having a single path will make the artifact zip
96
+ # simpler, whereas using a wildcard in the upload step will result
97
+ # in a zip file with internal directories.
98
+ coverage_report="$( (ls coverage/Chrome*Linux*/coverage.json || true) | head -1 )"
99
+
100
+ # Show what's there, for debugging purposes.
101
+ ls -l coverage/
102
+
103
+ if [ -f "$coverage_report" ]; then
104
+ echo "Found coverage report: $coverage_report"
105
+ echo "::set-output name=coverage_report::$coverage_report"
106
+ else
107
+ echo "Could not locate coverage report!"
108
+ exit 1
109
+ fi
110
+ else
111
+ echo "No coverage report generated."
112
+ fi
113
+
114
+ - uses: actions/upload-artifact@v3
115
+ # If there's a coverage report, upload it, even if a previous step
116
+ # failed.
117
+ if: ${{ always() && steps.coverage.outputs.coverage_report }}
118
+ with:
119
+ # This will create a download called coverage.zip containing only
120
+ # coverage.json.
121
+ path: ${{ steps.coverage.outputs.coverage_report }}
122
+ name: coverage
123
+ # Since we've already filtered this step for instances where there is
124
+ # an environment variable set for this, the file should definitely be
125
+ # there.
126
+ if-no-files-found: error
84
127
 
85
128
  - name: Report Final Commit Status
86
129
  # Will run on success or failure, but not if the workflow is cancelled.
package/AUTHORS CHANGED
@@ -76,4 +76,4 @@ uStudio Inc. <*@ustudio.com>
76
76
  Verizon Digital Media Services <*@verizondigitalmedia.com>
77
77
  Vincent Valot <valot.vince@gmail.com>
78
78
  Wayne Morgan <wayne.morgan.dev@gmail.com>
79
-
79
+ Raymond Cheng <raycheng100@gmail.com>
package/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.2.11](https://github.com/shaka-project/shaka-player/compare/v3.2.10...v3.2.11) (2022-08-17)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * add strictMissingProperties suppressions to unblock strict missing properties on union types. ([#4371](https://github.com/shaka-project/shaka-player/issues/4371)) ([c5678fb](https://github.com/shaka-project/shaka-player/commit/c5678fbad3a63bb93eac1abbf70e9e23b79911f6))
9
+ * Fix key ID byteswapping for PlayReady on PS4 ([#4377](https://github.com/shaka-project/shaka-player/issues/4377)) ([bbb0640](https://github.com/shaka-project/shaka-player/commit/bbb0640e2c6230732f6d0789ea82a2721a2a975c))
10
+ * Fix MediaCapabilities polyfill on Tizen and WebOS ([#4396](https://github.com/shaka-project/shaka-player/issues/4396)) ([f5fb3e5](https://github.com/shaka-project/shaka-player/commit/f5fb3e5d4670b177db001b28d13cb25a6e947ffa)), closes [#4383](https://github.com/shaka-project/shaka-player/issues/4383) [#4357](https://github.com/shaka-project/shaka-player/issues/4357)
11
+ * Fix TextDecoder fallback and browser support check ([#4403](https://github.com/shaka-project/shaka-player/issues/4403)) ([e67b64a](https://github.com/shaka-project/shaka-player/commit/e67b64af4c0e357fb0f3fae67dba00d4bd7c6bf5))
12
+ * Fix VP9 codec checks on Mac Firefox ([#4391](https://github.com/shaka-project/shaka-player/issues/4391)) ([136348d](https://github.com/shaka-project/shaka-player/commit/136348d2215a951f8395a79d63f930fc95d9593f))
13
+ * **text:** Fix cue region rendering in UI ([#4412](https://github.com/shaka-project/shaka-player/issues/4412)) ([3f65d3b](https://github.com/shaka-project/shaka-player/commit/3f65d3b60fce1398e3a078b2cbbafec351e7e249)), closes [#4381](https://github.com/shaka-project/shaka-player/issues/4381)
14
+ * **text:** Fix TTML render timing and line break issues ([#4407](https://github.com/shaka-project/shaka-player/issues/4407)) ([0e626c0](https://github.com/shaka-project/shaka-player/commit/0e626c0836b4ea0070e29c0a51e49845a36f8ef3)), closes [#4381](https://github.com/shaka-project/shaka-player/issues/4381)
15
+
16
+ ## [3.2.10](https://github.com/shaka-project/shaka-player/compare/v3.2.9...v3.2.10) (2022-07-14)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * Add fallback to TextDecoder and TextEncoder ([#4324](https://github.com/shaka-project/shaka-player/issues/4324)) ([54095c2](https://github.com/shaka-project/shaka-player/commit/54095c2185b9b0137a2db448c2263cda463bb75b))
22
+ * Fix EOS set-top box being identified as Apple. ([#4310](https://github.com/shaka-project/shaka-player/issues/4310)) ([981fe9d](https://github.com/shaka-project/shaka-player/commit/981fe9dcf38a174911e915968f50f9d6fe62ad22))
23
+ * Fix getVideoPlaybackQuality in WebOS 3 ([#4316](https://github.com/shaka-project/shaka-player/issues/4316)) ([e88469d](https://github.com/shaka-project/shaka-player/commit/e88469dd921f9d9e0b62c7ded856c240882c691a))
24
+ * Fix MediaCapabilities polyfill on Playstation 4 ([#4320](https://github.com/shaka-project/shaka-player/issues/4320)) ([ae8255a](https://github.com/shaka-project/shaka-player/commit/ae8255a4a5520ad07489fcc196b20b6d49f382a1))
25
+ * Fix segment index assertions with DAI ([49e6e33](https://github.com/shaka-project/shaka-player/commit/49e6e33011a29508e3c30c43f41616d9d2a0fd98))
26
+ * VTT Cue Parsing On PlayStation 4 ([#4340](https://github.com/shaka-project/shaka-player/issues/4340)) ([88fd5f9](https://github.com/shaka-project/shaka-player/commit/88fd5f9ab5d3397b7051e8e39787dd961e54c849)), closes [#4321](https://github.com/shaka-project/shaka-player/issues/4321)
27
+
28
+ ## [3.2.9](https://github.com/shaka-project/shaka-player/compare/v3.2.8...v3.2.9) (2022-06-14)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * **demo:** allow switch between UITextDisplayer and SimpleTextDisplayer ([#4275](https://github.com/shaka-project/shaka-player/issues/4275)) ([76cd039](https://github.com/shaka-project/shaka-player/commit/76cd0398ff0115cf2c4c8369a50eee7fa12975cf))
34
+ * **demo:** erroneous FairPlay keysystem in demo ([#4276](https://github.com/shaka-project/shaka-player/issues/4276)) ([bfdeb73](https://github.com/shaka-project/shaka-player/commit/bfdeb738aa5e9c464e79cdb787be11215eff6cc9))
35
+ * New EME polyfill fixes EME/MCap issues on some smart TVs ([#4279](https://github.com/shaka-project/shaka-player/issues/4279)) ([312570f](https://github.com/shaka-project/shaka-player/commit/312570f3bbdbbabdc20a76f1afcba85aabc9c744))
36
+ * Populate track's spatialAudio property ([#4291](https://github.com/shaka-project/shaka-player/issues/4291)) ([ab1b442](https://github.com/shaka-project/shaka-player/commit/ab1b442f057a305a4592f93062fb479fa72839d4))
37
+ * Remove IE 11 from default browsers for Windows ([#4272](https://github.com/shaka-project/shaka-player/issues/4272)) ([3f2cb2e](https://github.com/shaka-project/shaka-player/commit/3f2cb2e761d8b78672935852903b5c6ecaa6a5c8)), closes [#4271](https://github.com/shaka-project/shaka-player/issues/4271)
38
+ * Use middle segment when guessing MIME type on HLS ([#4269](https://github.com/shaka-project/shaka-player/issues/4269)) ([#4270](https://github.com/shaka-project/shaka-player/issues/4270)) ([51af232](https://github.com/shaka-project/shaka-player/commit/51af23244bd7307ff656e02b53383f4913cf1249))
39
+
3
40
  ## [3.2.8](https://github.com/shaka-project/shaka-player/compare/v3.2.7...v3.2.8) (2022-06-02)
4
41
 
5
42
 
package/CONTRIBUTORS CHANGED
@@ -24,6 +24,7 @@
24
24
 
25
25
  Aaron Vaage <vaage@google.com>
26
26
  Adrián Gómez Llorente <adgllorente@gmail.com>
27
+ Agajan Jumakuliyev <agajan.tm@gmail.com>
27
28
  Aidan Ridley <aidan.ridley@charter.com>
28
29
  Alex Jones <alexedwardjones@gmail.com>
29
30
  Alvaro Velad Galvan <alvaro.velad@mirada.tv>
@@ -53,6 +54,7 @@ Giorgio Gamberoni <giorgio.gamberoni@gmail.com>
53
54
  Giuseppe Samela <giuseppe.samela@gmail.com>
54
55
  Hichem Taoufik <hichem@code-it.fr>
55
56
  Itay Kinnrot <itay.kinnrot@kaltura.com>
57
+ Isaac Ramirez <isaac.ramirez.herrera@gmail.com>
56
58
  Jacob Trimble <modmaker@google.com>
57
59
  Jason Palmer <jason@jason-palmer.com>
58
60
  Jeffrey Swan <jeffdswan@gmail.com>
@@ -112,4 +114,5 @@ Vasanth Polipelli <vasanthap@google.com>
112
114
  Vignesh Venkatasubramanian <vigneshv@google.com>
113
115
  Vincent Valot <valot.vince@gmail.com>
114
116
  Wayne Morgan <wayne.morgan.dev@gmail.com>
115
- Yohann Connell <robinconnell@google.com>
117
+ Yohann Connell <robinconnell@google.com>
118
+ Raymond Cheng <raycheng100@gmail.com>
package/README.md CHANGED
@@ -24,6 +24,12 @@ For details on what's coming next, see our [development roadmap](roadmap.md).
24
24
  [offline storage and playback]: https://shaka-player-demo.appspot.com/docs/api/tutorial-offline.html
25
25
 
26
26
 
27
+ ## Maintained branches
28
+
29
+ See [maintained-branches.md](https://github.com/shaka-project/shaka-player/blob/main/maintained-branches.md)
30
+ for the up-to-date list of maintained branches of Shaka Player.
31
+
32
+
27
33
  ## Platform and browser support matrix
28
34
 
29
35
  |Browser |Windows |Mac |Linux |Android |iOS >= 12 |ChromeOS|Other|
@@ -39,6 +45,8 @@ For details on what's coming next, see our [development roadmap](roadmap.md).
39
45
  |Tizen TV³ | - | - | - | - | - | - |**Y**|
40
46
  |WebOS⁶ | - | - | - | - | - | - |**Y**|
41
47
  |Xbox One | - | - | - | - | - | - |**Y**|
48
+ |Playstation 4⁷| - | - | - | - | - | - |**Y**|
49
+ |Playstation 5⁷| - | - | - | - | - | - |**Y**|
42
50
 
43
51
  NOTES:
44
52
  - ¹: On macOS, only Safari 12+ is supported. On iOS, only iOS 12+ is
@@ -53,6 +61,8 @@ NOTES:
53
61
  us.
54
62
  - Official support for LG WebOS TV:
55
63
  https://github.com/shaka-project/shaka-player/issues/1330
64
+ - ⁷: These are expected to work, but are community-supported and untested by
65
+ us.
56
66
 
57
67
  We support iOS 12+ through Apple's native HLS player. We provide the same
58
68
  top-level API, but we just set the video's `src` element to the manifest/media.
@@ -117,7 +127,7 @@ HLS features supported:
117
127
  - Low-latency streaming with partial segments, preload hints, and delta updates
118
128
  - Discontinuity
119
129
  - ISO-BMFF / MP4 / CMAF support
120
- - MPEG-2 TS support (transmuxing provided by [mux.js][] v6.1.0+, must be
130
+ - MPEG-2 TS support (transmuxing provided by [mux.js][] v6.2.0+, must be
121
131
  separately included)
122
132
  - WebVTT and TTML
123
133
  - CEA-608/708 captions
@@ -148,6 +158,8 @@ HLS features **not** supported:
148
158
  |Tizen TV |**Y** |**Y** | - |untested⁵ |
149
159
  |WebOS⁷ |untested⁷ |untested⁷| - |untested⁷ |
150
160
  |Xbox One | - |**Y** | - | - |
161
+ |Playstation 4⁷| - |untested⁷| - |untested⁷ |
162
+ |Playstation 5⁷| - |untested⁷| - |untested⁷ |
151
163
 
152
164
  Other DRM systems should work out of the box if they are interoperable and
153
165
  compliant to the EME spec.
@@ -188,7 +200,7 @@ Shaka Player supports:
188
200
  SegmentTemplate@index
189
201
  - Not supported in HLS
190
202
  - MPEG-2 TS
191
- - With help from [mux.js][] v6.1.0+, can be played on any browser which
203
+ - With help from [mux.js][] v6.2.0+, can be played on any browser which
192
204
  supports MP4
193
205
  - Can find and parse timestamps to find segment start time in HLS
194
206
  - WebVTT
@@ -197,10 +209,10 @@ Shaka Player supports:
197
209
  - Supported in both XML form and embedded in MP4
198
210
  - CEA-608
199
211
  - Supported embedded in MP4
200
- - With help from [mux.js][] v6.1.0+, supported embedded in TS
212
+ - With help from [mux.js][] v6.2.0+, supported embedded in TS
201
213
  - CEA-708
202
214
  - Supported embedded in MP4
203
- - With help from [mux.js][] v6.1.0+, supported embedded in TS
215
+ - With help from [mux.js][] v6.2.0+, supported embedded in TS
204
216
  - SubRip (SRT)
205
217
  - UTF-8 encoding only
206
218
  - LyRiCs (LRC)
@@ -228,8 +240,10 @@ attributes.
228
240
  * [Hosted builds on jsDelivr](https://www.jsdelivr.com/package/npm/shaka-player)
229
241
  * [Development roadmap](roadmap.md)
230
242
  * [Announcement list](https://groups.google.com/forum/#!forum/shaka-player-users)
231
- ([join](docs/announcement-list-join-group.png) for release and survey
232
- announcements)
243
+ ([join](docs/announcement-list-join-group.png) for infrequent
244
+ announcements and surveys)
245
+ * Subscribe to releases by following
246
+ [instructions from this blog](https://www.jessesquires.com/blog/2020/07/30/github-tip-watching-releases/)
233
247
 
234
248
 
235
249
  ## FAQ ##
@@ -80,7 +80,7 @@ shakaAssets.identifierForKeySystem = (keySystem) => {
80
80
  const KeySystem = shakaAssets.KeySystem;
81
81
  switch (keySystem) {
82
82
  case KeySystem.CLEAR_KEY: return 'org.w3.clearkey';
83
- case KeySystem.FAIRPLAY: return 'com.apple.fps.1_0';
83
+ case KeySystem.FAIRPLAY: return 'com.apple.fps';
84
84
  case KeySystem.PLAYREADY: return 'com.microsoft.playready';
85
85
  case KeySystem.WIDEVINE: return 'com.widevine.alpha';
86
86
  default: return 'no drm protection';
package/demo/index.html CHANGED
@@ -50,8 +50,6 @@
50
50
  <script defer src="../node_modules/tippy.js/umd/index.min.js"></script>
51
51
  <!-- Improved PWA capability on mobile Safari is enabled by loading pwacompat: -->
52
52
  <script defer src="../node_modules/pwacompat/pwacompat.min.js"></script>
53
- <!-- TextDecoder polyfill, required for legacy Edge. -->
54
- <script defer src="../node_modules/fastestsmallesttextencoderdecoder/EncoderDecoderTogether.min.js"></script>
55
53
 
56
54
  <!-- Include IMA SDK to enable client-side ad insertion: -->
57
55
  <script type="text/javascript" src="https://imasdk.googleapis.com/js/sdkloader/ima3.js"></script>
package/demo/main.js CHANGED
@@ -1227,9 +1227,6 @@ shakaDemo.Main = class {
1227
1227
  // The currently-selected asset changed, so update asset cards.
1228
1228
  this.dispatchEventWithName_('shaka-main-selected-asset-changed');
1229
1229
 
1230
- await this.drmConfiguration_(asset);
1231
- this.controls_.getCastProxy().setAppData({'asset': asset});
1232
-
1233
1230
  // Enable the correct set of controls before loading.
1234
1231
  // The video container influences the TextDisplayer used.
1235
1232
  if (this.nativeControlsEnabled_) {
@@ -1244,6 +1241,9 @@ shakaDemo.Main = class {
1244
1241
  this.player_.setVideoContainer(this.container_);
1245
1242
  }
1246
1243
 
1244
+ await this.drmConfiguration_(asset);
1245
+ this.controls_.getCastProxy().setAppData({'asset': asset});
1246
+
1247
1247
  // Finally, the asset can be loaded.
1248
1248
  let manifestUri = asset.manifestUri;
1249
1249
  // If we have an offline copy, use that. If the offlineUri field is null,