shaka-player 4.2.13 → 4.2.14

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 (53) hide show
  1. package/.github/workflows/build-and-test.yaml +11 -18
  2. package/.github/workflows/compute-incremental-coverage.py +3 -0
  3. package/.github/workflows/selenium-lab-tests.yaml +45 -10
  4. package/CHANGELOG.md +11 -0
  5. package/demo/common/assets.js +12 -12
  6. package/demo/main.js +5 -0
  7. package/dist/demo.compiled.debug.js +13 -13
  8. package/dist/demo.compiled.debug.map +2 -2
  9. package/dist/demo.compiled.js +13 -13
  10. package/dist/demo.compiled.map +2 -2
  11. package/dist/locales.js +33 -33
  12. package/dist/receiver.compiled.debug.js +8 -8
  13. package/dist/receiver.compiled.debug.map +1 -1
  14. package/dist/receiver.compiled.js +8 -8
  15. package/dist/receiver.compiled.map +1 -1
  16. package/dist/shaka-player.compiled.d.ts +2 -2
  17. package/dist/shaka-player.compiled.debug.d.ts +2 -2
  18. package/dist/shaka-player.compiled.debug.js +29 -26
  19. package/dist/shaka-player.compiled.debug.map +3 -3
  20. package/dist/shaka-player.compiled.js +76 -76
  21. package/dist/shaka-player.compiled.map +2 -2
  22. package/dist/shaka-player.ui.d.ts +2 -2
  23. package/dist/shaka-player.ui.debug.d.ts +2 -2
  24. package/dist/shaka-player.ui.debug.js +36 -33
  25. package/dist/shaka-player.ui.debug.map +3 -3
  26. package/dist/shaka-player.ui.js +65 -65
  27. package/dist/shaka-player.ui.map +2 -2
  28. package/externs/shaka/manifest.js +5 -1
  29. package/externs/shaka/offline.js +5 -1
  30. package/karma.conf.js +2 -0
  31. package/lib/ads/client_side_ad_manager.js +14 -2
  32. package/lib/dash/dash_parser.js +1 -0
  33. package/lib/hls/hls_parser.js +1 -0
  34. package/lib/media/media_source_engine.js +6 -5
  35. package/lib/media/streaming_engine.js +2 -2
  36. package/lib/offline/indexeddb/v1_storage_cell.js +1 -0
  37. package/lib/offline/indexeddb/v2_storage_cell.js +1 -0
  38. package/lib/offline/manifest_converter.js +1 -0
  39. package/lib/offline/storage.js +1 -0
  40. package/lib/player.js +4 -1
  41. package/lib/util/periods.js +2 -0
  42. package/lib/util/platform.js +8 -0
  43. package/package.json +2 -2
  44. package/test/media/adaptation_set_unit.js +1 -0
  45. package/test/media/media_source_engine_unit.js +1 -1
  46. package/test/offline/manifest_convert_unit.js +5 -0
  47. package/test/player_integration.js +4 -1
  48. package/test/test/util/manifest_generator.js +2 -0
  49. package/test/test/util/offline_utils.js +1 -0
  50. package/test/test/util/streaming_engine_util.js +3 -0
  51. package/test/test/util/ui_utils.js +5 -1
  52. package/ui/externs/ui.js +2 -2
  53. 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 --html-coverage-report --uncompiled"
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 invoked instead
129
- # of simply "Chrome". This other copy of Chrome, however, doesn't seem
130
- # to have basic codecs like AAC and H264 available, causing many of our
131
- # test scenarios to fail. Deleting "Chrome for Testing" fixes this.
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)
@@ -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 KARMA_PORT
225
- # must be defined by the self-hosted runner, and mapped from the host to
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 }}" == "ChromeLinux" ]]; then
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 $KARMA_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 (ChromeLinux only)
309
+ - name: Find coverage report (Edge only)
275
310
  id: coverage
276
- # Run even if an earlier step fails, but only on ChromeLinux.
277
- if: ${{ always() && matrix.browser == 'ChromeLinux' }}
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/Chrome*Linux*/coverage.json || true) | head -1 )"
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 (ChromeLinux only)
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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.2.14](https://github.com/shaka-project/shaka-player/compare/v4.2.13...v4.2.14) (2023-08-30)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **Ads:** Initialize correctly the IMA ads manager ([#5541](https://github.com/shaka-project/shaka-player/issues/5541)) ([fa82928](https://github.com/shaka-project/shaka-player/commit/fa82928a6d15ef0327ea561a2f7c4dbb9e4de0dc))
9
+ * **Demo:** Show correctly external text in the Demo ([#5521](https://github.com/shaka-project/shaka-player/issues/5521)) ([7408151](https://github.com/shaka-project/shaka-player/commit/7408151f40440d87894453b2e5f745e4888a7495))
10
+ * **HLS:** Fix external subtitles out of sync in HLS ([#5491](https://github.com/shaka-project/shaka-player/issues/5491)) ([ff2edc1](https://github.com/shaka-project/shaka-player/commit/ff2edc18cd6401f1058ea176e52c5da4104a8e5f))
11
+ * Orange set top box is incorrectly categorized as Apple ([#5545](https://github.com/shaka-project/shaka-player/issues/5545)) ([31f7a18](https://github.com/shaka-project/shaka-player/commit/31f7a18bacb51d176f1d7def5e1965b9e3a0e5fa))
12
+ * **UI:** Fix playback restarts in safari when click on seekbar end ([#5527](https://github.com/shaka-project/shaka-player/issues/5527)) ([7824cc9](https://github.com/shaka-project/shaka-player/commit/7824cc9ce8549d3127ffdd97a020587bd75a7995))
13
+
3
14
  ## [4.2.13](https://github.com/shaka-project/shaka-player/compare/v4.2.12...v4.2.13) (2023-08-20)
4
15
 
5
16
 
@@ -765,7 +765,7 @@ shakaAssets.testAssets = [
765
765
  new ShakaDemoAssetInfo(
766
766
  /* name= */ 'Live sim (2s segments)',
767
767
  /* iconUri= */ 'https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png',
768
- /* manifestUri= */ 'https://livesim.dashif.org/livesim/utc_head/testpic_2s/Manifest.mpd',
768
+ /* manifestUri= */ 'https://livesim2.dashif.org/livesim2/utc_head/testpic_2s/Manifest.mpd',
769
769
  /* source= */ shakaAssets.Source.DASH_IF)
770
770
  .addFeature(shakaAssets.Feature.LIVE)
771
771
  .addFeature(shakaAssets.Feature.MP4)
@@ -773,7 +773,7 @@ shakaAssets.testAssets = [
773
773
  new ShakaDemoAssetInfo(
774
774
  /* name= */ 'Live sim SegmentTimeline w/ $Time$ (6s segments)',
775
775
  /* iconUri= */ 'https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png',
776
- /* manifestUri= */ 'https://livesim.dashif.org/livesim/segtimeline_1/utc_head/testpic_6s/Manifest.mpd',
776
+ /* manifestUri= */ 'https://livesim2.dashif.org/livesim2/segtimeline_1/utc_head/testpic_6s/Manifest.mpd',
777
777
  /* source= */ shakaAssets.Source.DASH_IF)
778
778
  .addFeature(shakaAssets.Feature.DASH)
779
779
  .addFeature(shakaAssets.Feature.LIVE)
@@ -781,7 +781,7 @@ shakaAssets.testAssets = [
781
781
  new ShakaDemoAssetInfo(
782
782
  /* name= */ 'Live sim SegmentTimeline w/ $Number$ (6s segments)',
783
783
  /* iconUri= */ 'https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png',
784
- /* manifestUri= */ 'https://livesim.dashif.org/livesim/segtimelinenr_1/utc_head/testpic_6s/Manifest.mpd',
784
+ /* manifestUri= */ 'https://livesim2.dashif.org/livesim2/segtimelinenr_1/utc_head/testpic_6s/Manifest.mpd',
785
785
  /* source= */ shakaAssets.Source.DASH_IF)
786
786
  .addFeature(shakaAssets.Feature.DASH)
787
787
  .addFeature(shakaAssets.Feature.LIVE)
@@ -789,21 +789,21 @@ shakaAssets.testAssets = [
789
789
  new ShakaDemoAssetInfo(
790
790
  /* name= */ 'Live sim SegmentTimeline StartOver [-20s, +20s] (2s segments)',
791
791
  /* iconUri= */ 'https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png',
792
- /* manifestUri= */ 'https://livesim.dashif.org/livesim/segtimeline_1/startrel_-20/stoprel_20/timeoffset_0/testpic_2s/Manifest.mpd',
792
+ /* manifestUri= */ 'https://livesim2.dashif.org/livesim2/segtimeline_1/startrel_-20/stoprel_20/timeoffset_0/testpic_2s/Manifest.mpd',
793
793
  /* source= */ shakaAssets.Source.DASH_IF)
794
794
  .addFeature(shakaAssets.Feature.DASH)
795
795
  .addFeature(shakaAssets.Feature.MP4),
796
796
  new ShakaDemoAssetInfo(
797
797
  /* name= */ 'Live sim StartOver SegTmpl Duration [-20s, +20s] (2s segments)',
798
798
  /* iconUri= */ 'https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png',
799
- /* manifestUri= */ 'https://livesim.dashif.org/livesim/startrel_-20/stoprel_20/timeoffset_0/testpic_2s/Manifest.mpd',
799
+ /* manifestUri= */ 'https://livesim2.dashif.org/livesim2/startrel_-20/stoprel_20/timeoffset_0/testpic_2s/Manifest.mpd',
800
800
  /* source= */ shakaAssets.Source.DASH_IF)
801
801
  .addFeature(shakaAssets.Feature.DASH)
802
802
  .addFeature(shakaAssets.Feature.MP4),
803
803
  new ShakaDemoAssetInfo(
804
804
  /* name= */ 'Live sim SegTmpl Duration (multi-period 60s)',
805
805
  /* iconUri= */ 'https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png',
806
- /* manifestUri= */ 'https://livesim.dashif.org/livesim/utc_head/periods_60/testpic_2s/Manifest.mpd',
806
+ /* manifestUri= */ 'https://livesim2.dashif.org/livesim2/utc_head/periods_60/testpic_2s/Manifest.mpd',
807
807
  /* source= */ shakaAssets.Source.DASH_IF)
808
808
  .addFeature(shakaAssets.Feature.DASH)
809
809
  .addFeature(shakaAssets.Feature.LIVE)
@@ -811,7 +811,7 @@ shakaAssets.testAssets = [
811
811
  new ShakaDemoAssetInfo(
812
812
  /* name= */ 'Live sim TTML Image Subtitles embedded (VoD)',
813
813
  /* iconUri= */ 'https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png',
814
- /* manifestUri= */ 'https://livesim.dashif.org/dash/vod/testpic_2s/img_subs.mpd',
814
+ /* manifestUri= */ 'https://livesim2.dashif.org/dash/testpic_2s/img_subs.mpd',
815
815
  /* source= */ shakaAssets.Source.DASH_IF)
816
816
  .addFeature(shakaAssets.Feature.DASH)
817
817
  .addFeature(shakaAssets.Feature.SUBTITLES)
@@ -819,15 +819,15 @@ shakaAssets.testAssets = [
819
819
  new ShakaDemoAssetInfo(
820
820
  /* name= */ 'Low Latency DASH Live',
821
821
  /* iconUri= */ 'https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png',
822
- /* manifestUri= */ 'https://livesim.dashif.org/livesim-chunked/chunkdur_1/ato_7/testpic4_8s/Manifest300.mpd',
823
- /* source= */ shakaAssets.Source.SHAKA)
822
+ /* manifestUri= */ 'https://livesim2.dashif.org/livesim2/chunkdur_1/ato_7/testpic4_8s/Manifest300.mpd',
823
+ /* source= */ shakaAssets.Source.DASH_IF)
824
824
  .addFeature(shakaAssets.Feature.DASH)
825
825
  .addFeature(shakaAssets.Feature.LIVE)
826
826
  .addFeature(shakaAssets.Feature.MP4),
827
827
  new ShakaDemoAssetInfo(
828
828
  /* name= */ 'DASH-IF CEA-608 VOD',
829
829
  /* iconUri= */ 'https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png',
830
- /* manifestUri= */ 'https://livesim.dashif.org/dash/vod/testpic_2s/cea608.mpd',
830
+ /* manifestUri= */ 'https://livesim2.dashif.org/dash/testpic_2s/cea608.mpd',
831
831
  /* source= */ shakaAssets.Source.DASH_IF)
832
832
  .addFeature(shakaAssets.Feature.DASH)
833
833
  .addFeature(shakaAssets.Feature.SUBTITLES)
@@ -835,7 +835,7 @@ shakaAssets.testAssets = [
835
835
  new ShakaDemoAssetInfo(
836
836
  /* name= */ 'DASH-IF CEA-608 Live',
837
837
  /* iconUri= */ 'https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png',
838
- /* manifestUri= */ 'https://livesim.dashif.org/livesim/testpic_2s/cea608.mpd',
838
+ /* manifestUri= */ 'https://livesim2.dashif.org/livesim2/testpic_2s/cea608.mpd',
839
839
  /* source= */ shakaAssets.Source.DASH_IF)
840
840
  .addFeature(shakaAssets.Feature.DASH)
841
841
  .addFeature(shakaAssets.Feature.LIVE)
@@ -892,7 +892,7 @@ shakaAssets.testAssets = [
892
892
  new ShakaDemoAssetInfo(
893
893
  /* name= */ 'DASH-IF THUMBNAILS - Live stream, Single adaptation set, 1x1 tiles (livesim)',
894
894
  /* iconUri= */ 'https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png',
895
- /* manifestUri= */ 'https://livesim.dashif.org/livesim/testpic_2s/Manifest_thumbs.mpd',
895
+ /* manifestUri= */ 'https://livesim2.dashif.org/livesim2/testpic_2s/Manifest_thumbs.mpd',
896
896
  /* source= */ shakaAssets.Source.DASH_IF)
897
897
  .addFeature(shakaAssets.Feature.DASH)
898
898
  .addFeature(shakaAssets.Feature.ULTRA_HIGH_DEFINITION)
package/demo/main.js CHANGED
@@ -1271,6 +1271,11 @@ shakaDemo.Main = class {
1271
1271
  this.video_.poster = shakaDemo.Main.audioOnlyPoster_;
1272
1272
  }
1273
1273
 
1274
+ for (const extraText of asset.extraText) {
1275
+ this.player_.addTextTrackAsync(extraText.uri, extraText.language,
1276
+ extraText.kind, extraText.mime, extraText.codecs);
1277
+ }
1278
+
1274
1279
  // If the asset has an ad tag attached to it, load the ads
1275
1280
  const adManager = this.player_.getAdManager();
1276
1281
  if (adManager && asset.adTagUri) {
@@ -148,18 +148,18 @@ shakaAssets.Source.UNIFIED_STREAMING)).addKeySystem(shakaAssets.KeySystem.WIDEVI
148
148
  shakaAssets.Source.UNIFIED_STREAMING)).addKeySystem(shakaAssets.KeySystem.PLAYREADY).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.HIGH_DEFINITION).addFeature(shakaAssets.Feature.MP4).addFeature(shakaAssets.Feature.SUBTITLES).addLicenseServer("com.microsoft.playready","https://test.playready.microsoft.com/service/rightsmanager.asmx?PlayRight=1&UseSimpleNonPersistentLicense=1"),(new ShakaDemoAssetInfo("Tears of Steel (subtitles)","https://storage.googleapis.com/shaka-asset-icons/tears_of_steel.png",
149
149
  "https://demo.unified-streaming.com/video/tears-of-steel/tears-of-steel-en.ism/.mpd",shakaAssets.Source.UNIFIED_STREAMING)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.HIGH_DEFINITION).addFeature(shakaAssets.Feature.MP4).addFeature(shakaAssets.Feature.SUBTITLES).addFeature(shakaAssets.Feature.OFFLINE),(new ShakaDemoAssetInfo("Tears of Steel (Thumbnails)","https://storage.googleapis.com/shaka-asset-icons/tears_of_steel.png","https://demo.unified-streaming.com/video/tears-of-steel/tears-of-steel-tiled-thumbnails-timeline.ism/.mpd",
150
150
  shakaAssets.Source.UNIFIED_STREAMING)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.HIGH_DEFINITION).addFeature(shakaAssets.Feature.MP4).addFeature(shakaAssets.Feature.SUBTITLES).addFeature(shakaAssets.Feature.OFFLINE).addFeature(shakaAssets.Feature.THUMBNAILS),(new ShakaDemoAssetInfo("Big Buck Bunny (DASH-IF)","https://storage.googleapis.com/shaka-asset-icons/big_buck_bunny.png","https://dash.akamaized.net/dash264/TestCases/1c/qualcomm/2/MultiRate.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.MP4).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.HIGH_DEFINITION).addFeature(shakaAssets.Feature.OFFLINE),
151
- (new ShakaDemoAssetInfo("Live sim (2s segments)","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://livesim.dashif.org/livesim/utc_head/testpic_2s/Manifest.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.LIVE).addFeature(shakaAssets.Feature.MP4).addFeature(shakaAssets.Feature.DASH),(new ShakaDemoAssetInfo("Live sim SegmentTimeline w/ $Time$ (6s segments)","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://livesim.dashif.org/livesim/segtimeline_1/utc_head/testpic_6s/Manifest.mpd",
152
- shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.LIVE).addFeature(shakaAssets.Feature.MP4),(new ShakaDemoAssetInfo("Live sim SegmentTimeline w/ $Number$ (6s segments)","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://livesim.dashif.org/livesim/segtimelinenr_1/utc_head/testpic_6s/Manifest.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.LIVE).addFeature(shakaAssets.Feature.MP4),
153
- (new ShakaDemoAssetInfo("Live sim SegmentTimeline StartOver [-20s, +20s] (2s segments)","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://livesim.dashif.org/livesim/segtimeline_1/startrel_-20/stoprel_20/timeoffset_0/testpic_2s/Manifest.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.MP4),(new ShakaDemoAssetInfo("Live sim StartOver SegTmpl Duration [-20s, +20s] (2s segments)","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png",
154
- "https://livesim.dashif.org/livesim/startrel_-20/stoprel_20/timeoffset_0/testpic_2s/Manifest.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.MP4),(new ShakaDemoAssetInfo("Live sim SegTmpl Duration (multi-period 60s)","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://livesim.dashif.org/livesim/utc_head/periods_60/testpic_2s/Manifest.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.LIVE).addFeature(shakaAssets.Feature.MP4),
155
- (new ShakaDemoAssetInfo("Live sim TTML Image Subtitles embedded (VoD)","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://livesim.dashif.org/dash/vod/testpic_2s/img_subs.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.SUBTITLES).addFeature(shakaAssets.Feature.MP4),(new ShakaDemoAssetInfo("Low Latency DASH Live","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://livesim.dashif.org/livesim-chunked/chunkdur_1/ato_7/testpic4_8s/Manifest300.mpd",
156
- shakaAssets.Source.SHAKA)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.LIVE).addFeature(shakaAssets.Feature.MP4),(new ShakaDemoAssetInfo("DASH-IF CEA-608 VOD","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://livesim.dashif.org/dash/vod/testpic_2s/cea608.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.SUBTITLES).addFeature(shakaAssets.Feature.MP4),(new ShakaDemoAssetInfo("DASH-IF CEA-608 Live",
157
- "https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://livesim.dashif.org/livesim/testpic_2s/cea608.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.LIVE).addFeature(shakaAssets.Feature.SUBTITLES).addFeature(shakaAssets.Feature.MP4),(new ShakaDemoAssetInfo("Akamai Low Latency DASH Live","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://akamaibroadcasteruseast.akamaized.net/cmaf/live/657078/akasource/out.mpd",
151
+ (new ShakaDemoAssetInfo("Live sim (2s segments)","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://livesim2.dashif.org/livesim2/utc_head/testpic_2s/Manifest.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.LIVE).addFeature(shakaAssets.Feature.MP4).addFeature(shakaAssets.Feature.DASH),(new ShakaDemoAssetInfo("Live sim SegmentTimeline w/ $Time$ (6s segments)","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://livesim2.dashif.org/livesim2/segtimeline_1/utc_head/testpic_6s/Manifest.mpd",
152
+ shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.LIVE).addFeature(shakaAssets.Feature.MP4),(new ShakaDemoAssetInfo("Live sim SegmentTimeline w/ $Number$ (6s segments)","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://livesim2.dashif.org/livesim2/segtimelinenr_1/utc_head/testpic_6s/Manifest.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.LIVE).addFeature(shakaAssets.Feature.MP4),
153
+ (new ShakaDemoAssetInfo("Live sim SegmentTimeline StartOver [-20s, +20s] (2s segments)","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://livesim2.dashif.org/livesim2/segtimeline_1/startrel_-20/stoprel_20/timeoffset_0/testpic_2s/Manifest.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.MP4),(new ShakaDemoAssetInfo("Live sim StartOver SegTmpl Duration [-20s, +20s] (2s segments)","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png",
154
+ "https://livesim2.dashif.org/livesim2/startrel_-20/stoprel_20/timeoffset_0/testpic_2s/Manifest.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.MP4),(new ShakaDemoAssetInfo("Live sim SegTmpl Duration (multi-period 60s)","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://livesim2.dashif.org/livesim2/utc_head/periods_60/testpic_2s/Manifest.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.LIVE).addFeature(shakaAssets.Feature.MP4),
155
+ (new ShakaDemoAssetInfo("Live sim TTML Image Subtitles embedded (VoD)","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://livesim2.dashif.org/dash/testpic_2s/img_subs.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.SUBTITLES).addFeature(shakaAssets.Feature.MP4),(new ShakaDemoAssetInfo("Low Latency DASH Live","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://livesim2.dashif.org/livesim2/chunkdur_1/ato_7/testpic4_8s/Manifest300.mpd",
156
+ shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.LIVE).addFeature(shakaAssets.Feature.MP4),(new ShakaDemoAssetInfo("DASH-IF CEA-608 VOD","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://livesim2.dashif.org/dash/testpic_2s/cea608.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.SUBTITLES).addFeature(shakaAssets.Feature.MP4),(new ShakaDemoAssetInfo("DASH-IF CEA-608 Live",
157
+ "https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://livesim2.dashif.org/livesim2/testpic_2s/cea608.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.LIVE).addFeature(shakaAssets.Feature.SUBTITLES).addFeature(shakaAssets.Feature.MP4),(new ShakaDemoAssetInfo("Akamai Low Latency DASH Live","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://akamaibroadcasteruseast.akamaized.net/cmaf/live/657078/akasource/out.mpd",
158
158
  shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.LIVE).addFeature(shakaAssets.Feature.MP4),(new ShakaDemoAssetInfo("DASH-IF THUMBNAILS - Single adaptation set, 7 tiles at 10x1, each thumb 320x180","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://dash.akamaized.net/akamai/bbb_30fps/bbb_with_tiled_thumbnails.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.ULTRA_HIGH_DEFINITION).addFeature(shakaAssets.Feature.MP4).addFeature(shakaAssets.Feature.OFFLINE).addFeature(shakaAssets.Feature.THUMBNAILS),
159
159
  (new ShakaDemoAssetInfo("DASH-IF THUMBNAILS - Single adaptation set, 4 tiles at 10x1, each thumb 205x115","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://dash.akamaized.net/akamai/bbb_30fps/bbb_with_4_tiles_thumbnails.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.ULTRA_HIGH_DEFINITION).addFeature(shakaAssets.Feature.MP4).addFeature(shakaAssets.Feature.OFFLINE).addFeature(shakaAssets.Feature.THUMBNAILS),(new ShakaDemoAssetInfo("DASH-IF THUMBNAILS - Single adaptation set, 1 tile at 10x20, each thumb 102x58",
160
160
  "https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png","https://dash.akamaized.net/akamai/bbb_30fps/bbb_with_tiled_thumbnails_2.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.ULTRA_HIGH_DEFINITION).addFeature(shakaAssets.Feature.MP4).addFeature(shakaAssets.Feature.OFFLINE).addFeature(shakaAssets.Feature.THUMBNAILS),(new ShakaDemoAssetInfo("DASH-IF THUMBNAILS - Two adaptation sets with different thumb resolutions","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png",
161
161
  "https://dash.akamaized.net/akamai/bbb_30fps/bbb_with_multiple_tiled_thumbnails.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.ULTRA_HIGH_DEFINITION).addFeature(shakaAssets.Feature.MP4).addFeature(shakaAssets.Feature.OFFLINE).addFeature(shakaAssets.Feature.THUMBNAILS),(new ShakaDemoAssetInfo("DASH-IF THUMBNAILS - Live stream, Single adaptation set, 1x1 tiles (livesim)","https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png",
162
- "https://livesim.dashif.org/livesim/testpic_2s/Manifest_thumbs.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.ULTRA_HIGH_DEFINITION).addFeature(shakaAssets.Feature.MP4).addFeature(shakaAssets.Feature.LIVE).addFeature(shakaAssets.Feature.THUMBNAILS),(new ShakaDemoAssetInfo("Art of Motion (DASH)","https://storage.googleapis.com/shaka-asset-icons/art_of_motion.png","https://bitdash-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd",
162
+ "https://livesim2.dashif.org/livesim2/testpic_2s/Manifest_thumbs.mpd",shakaAssets.Source.DASH_IF)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.ULTRA_HIGH_DEFINITION).addFeature(shakaAssets.Feature.MP4).addFeature(shakaAssets.Feature.LIVE).addFeature(shakaAssets.Feature.THUMBNAILS),(new ShakaDemoAssetInfo("Art of Motion (DASH)","https://storage.googleapis.com/shaka-asset-icons/art_of_motion.png","https://bitdash-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd",
163
163
  shakaAssets.Source.BITCODIN)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.HIGH_DEFINITION).addFeature(shakaAssets.Feature.MP4).addFeature(shakaAssets.Feature.OFFLINE),(new ShakaDemoAssetInfo("Art of Motion (HLS, TS)","https://storage.googleapis.com/shaka-asset-icons/art_of_motion.png","https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8",shakaAssets.Source.BITCODIN)).addFeature(shakaAssets.Feature.HIGH_DEFINITION).addFeature(shakaAssets.Feature.HLS).addFeature(shakaAssets.Feature.MP2TS).addFeature(shakaAssets.Feature.OFFLINE),
164
164
  (new ShakaDemoAssetInfo("Art of Motion (HLS, TS, AES-128)","https://storage.googleapis.com/shaka-asset-icons/art_of_motion.png","https://bitmovin-a.akamaihd.net/content/art-of-motion_drm/m3u8s/11331.m3u8",shakaAssets.Source.BITCODIN)).addFeature(shakaAssets.Feature.HIGH_DEFINITION).addFeature(shakaAssets.Feature.HLS).addFeature(shakaAssets.Feature.MP2TS).addFeature(shakaAssets.Feature.OFFLINE),(new ShakaDemoAssetInfo("Sintel (HLS, TS, 4k)","https://storage.googleapis.com/shaka-asset-icons/sintel.png",
165
165
  "https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8",shakaAssets.Source.BITCODIN)).markAsDisabled().addFeature(shakaAssets.Feature.HIGH_DEFINITION).addFeature(shakaAssets.Feature.HLS).addFeature(shakaAssets.Feature.MP2TS).addFeature(shakaAssets.Feature.OFFLINE),(new ShakaDemoAssetInfo("Car Ride (DASH, VOD, 180 Degrees)","https://lab.streamshark.io:10433/streams/balmain_360/.png?scale=300:210","https://lab.streamshark.io:10433/streams/balmain_360/Feature.DASH/.mpd",shakaAssets.Source.METACDN)).addFeature(shakaAssets.Feature.DASH).addFeature(shakaAssets.Feature.HIGH_DEFINITION).addFeature(shakaAssets.Feature.MP4).addFeature(shakaAssets.Feature.VOD),
@@ -298,11 +298,11 @@ if(3==c.length)a=c[1],b=b[c[0]];else return b[c[0]]}}getCurrentConfigValue(a){re
298
298
  null);this.remakeHash()}async drmConfiguration_(a,b){var c=b?b.getNetworkingEngine():this.player_.getNetworkingEngine();goog.asserts.assert(c,"There should be a net engine.");a.applyFilters(c);var d=a.getConfiguration();b?b.configure(d):(this.player_.resetConfiguration(),this.player_.configure(this.desiredConfig_),this.player_.configure(d));d=b?b.getConfiguration():this.player_.getConfiguration();if(a.certificateUri){c=await this.requestCertificate_(a.certificateUri,c);c=shaka.util.BufferUtils.toUint8(c);
299
299
  for(const e of a.licenseServers.keys())d.drm.advanced[e]=d.drm.advanced[e]||{},d.drm.advanced[e].serverCertificate=c}else for(const e of a.licenseServers.keys())d.drm.advanced[e]&&delete d.drm.advanced[e].serverCertificate;b?b.configure(d):this.player_.configure("drm.advanced",d.drm.advanced);this.remakeHash()}showPlayer_(){const a=document.getElementById("video-bar");this.showElement_(a);this.closeError_();this.video_.poster=shakaDemo.Main.mainPoster_;a.scrollIntoView({behavior:"smooth",block:"start"})}async loadAsset(a){try{this.selectedAsset=
300
300
  a;this.showPlayer_();this.dispatchEventWithName_("shaka-main-selected-asset-changed");this.nativeControlsEnabled_?(this.controls_.setEnabledShakaControls(!1),this.controls_.setEnabledNativeControls(!0),this.player_.setVideoContainer(null)):(this.controls_.setEnabledShakaControls(!0),this.controls_.setEnabledNativeControls(!1),this.player_.setVideoContainer(this.container_));await this.drmConfiguration_(a);this.controls_.getCastProxy().setAppData({asset:a});let b=a.manifestUri;a.storedContent&&a.storedContent.offlineUri&&
301
- (b=a.storedContent.offlineUri);if(a.imaAssetKey||a.imaContentSrcId&&a.imaVideoId)b=await this.getManifestUriFromAdManager_(a);await this.player_.load(b,null,a.mimeType||void 0);this.player_.isAudioOnly()&&(this.video_.poster=shakaDemo.Main.audioOnlyPoster_);const c=this.player_.getAdManager();if(c&&a.adTagUri)try{goog.asserts.assert(null!=this.video_,"this.video should exist!");c.initClientSide(this.controls_.getClientSideAdContainer(),this.video_);const d=new google.ima.AdsRequest;d.adTagUrl=a.adTagUri;
302
- c.requestClientSideAds(d)}catch(d){console.log(d),console.warn("Ads code has been prevented from running. Proceeding without ads.")}if(navigator.mediaSession){const d={title:a.name,artwork:[{src:a.iconUri}]};d.artist=a.source;navigator.mediaSession.metadata=new MediaMetadata(d)}}catch(b){if(b.code==shaka.util.Error.Code.LOAD_INTERRUPTED)console.debug("load() interrupted");else this.onError_(b)}this.remakeHash()}remakeHash(){if(this.fullyLoaded_){var a=[];if(this.player_){var b=this.player_.getConfiguration();
303
- shakaDemo.Utils.runThroughHashParams((f,g)=>{const h=this.getCurrentConfigValue(g);g=this.getValueFromGivenConfig_(g,this.defaultConfig_);const k=isNaN(h)&&isNaN(g);h==g||k||a.push(f+"="+h)},b);if(b=this.getCurrentConfigValue("drm.advanced"))for(var c of shakaDemo.Main.commonDrmSystems){const f=b[c];if(f){f.videoRobustness&&a.push("videoRobustness="+f.videoRobustness);f.audioRobustness&&a.push("audioRobustness="+f.audioRobustness);break}}}this.getCurrentConfigValue("abr.enabled")||a.push("noadaptation");
304
- a.push("uilang="+this.getUILocale());if(this.selectedAsset){c=shakaAssets.testAssets.includes(this.selectedAsset);a.push("asset="+this.selectedAsset.manifestUri);this.selectedAsset.adTagUri&&a.push("adTagUri="+this.selectedAsset.adTagUri);if(!c&&this.selectedAsset.licenseServers.size){b=this.selectedAsset.licenseServers.values().next().value;a.push("license="+b);for(var d of this.selectedAsset.licenseServers.keys())if(!shakaDemo.Main.commonDrmSystems.includes(d)){a.push("drmSystem="+d);break}}!c&&
305
- this.selectedAsset.certificateUri&&a.push("certificate="+this.selectedAsset.certificateUri)}d=document.getElementById("nav-button-container");for(var e of d.childNodes)if(e.nodeType==Node.ELEMENT_NODE&&(goog.asserts.assert(e instanceof HTMLElement,"Wrong node type!"),e.classList.contains("mdl-button--accent"))){a.push("panel="+e.getAttribute("tab-identifier"));(e=e.getAttribute("tab-hash"))&&a.push("panelData="+e);break}for(const f of["compiled","debug_compiled","uncompiled"])document.getElementById(f.split("_").join("-")+
301
+ (b=a.storedContent.offlineUri);if(a.imaAssetKey||a.imaContentSrcId&&a.imaVideoId)b=await this.getManifestUriFromAdManager_(a);await this.player_.load(b,null,a.mimeType||void 0);this.player_.isAudioOnly()&&(this.video_.poster=shakaDemo.Main.audioOnlyPoster_);for(const d of a.extraText)this.player_.addTextTrackAsync(d.uri,d.language,d.kind,d.mime,d.codecs);const c=this.player_.getAdManager();if(c&&a.adTagUri)try{goog.asserts.assert(null!=this.video_,"this.video should exist!");c.initClientSide(this.controls_.getClientSideAdContainer(),
302
+ this.video_);const d=new google.ima.AdsRequest;d.adTagUrl=a.adTagUri;c.requestClientSideAds(d)}catch(d){console.log(d),console.warn("Ads code has been prevented from running. Proceeding without ads.")}if(navigator.mediaSession){const d={title:a.name,artwork:[{src:a.iconUri}]};d.artist=a.source;navigator.mediaSession.metadata=new MediaMetadata(d)}}catch(b){if(b.code==shaka.util.Error.Code.LOAD_INTERRUPTED)console.debug("load() interrupted");else this.onError_(b)}this.remakeHash()}remakeHash(){if(this.fullyLoaded_){var a=
303
+ [];if(this.player_){var b=this.player_.getConfiguration();shakaDemo.Utils.runThroughHashParams((f,g)=>{const h=this.getCurrentConfigValue(g);g=this.getValueFromGivenConfig_(g,this.defaultConfig_);const k=isNaN(h)&&isNaN(g);h==g||k||a.push(f+"="+h)},b);if(b=this.getCurrentConfigValue("drm.advanced"))for(var c of shakaDemo.Main.commonDrmSystems){const f=b[c];if(f){f.videoRobustness&&a.push("videoRobustness="+f.videoRobustness);f.audioRobustness&&a.push("audioRobustness="+f.audioRobustness);break}}}this.getCurrentConfigValue("abr.enabled")||
304
+ a.push("noadaptation");a.push("uilang="+this.getUILocale());if(this.selectedAsset){c=shakaAssets.testAssets.includes(this.selectedAsset);a.push("asset="+this.selectedAsset.manifestUri);this.selectedAsset.adTagUri&&a.push("adTagUri="+this.selectedAsset.adTagUri);if(!c&&this.selectedAsset.licenseServers.size){b=this.selectedAsset.licenseServers.values().next().value;a.push("license="+b);for(var d of this.selectedAsset.licenseServers.keys())if(!shakaDemo.Main.commonDrmSystems.includes(d)){a.push("drmSystem="+
305
+ d);break}}!c&&this.selectedAsset.certificateUri&&a.push("certificate="+this.selectedAsset.certificateUri)}d=document.getElementById("nav-button-container");for(var e of d.childNodes)if(e.nodeType==Node.ELEMENT_NODE&&(goog.asserts.assert(e instanceof HTMLElement,"Wrong node type!"),e.classList.contains("mdl-button--accent"))){a.push("panel="+e.getAttribute("tab-identifier"));(e=e.getAttribute("tab-hash"))&&a.push("panelData="+e);break}for(const f of["compiled","debug_compiled","uncompiled"])document.getElementById(f.split("_").join("-")+
306
306
  "-link").hasAttribute("disabled")&&a.push("build="+f);this.noInput_&&a.push("noinput");this.nativeControlsEnabled_&&a.push("nativecontrols");this.trickPlayControlsEnabled_&&a.push("trickplay");if(shaka.log&&shaka.log.currentLevel!=shaka.log.MAX_LOG_LEVEL)switch(shaka.log.currentLevel){case shaka.log.Level.INFO:a.push("info");break;case shaka.log.Level.DEBUG:a.push("debug");break;case shaka.log.Level.V2:a.push("vv");break;case shaka.log.Level.V1:a.push("v")}this.setNewHashSilent_(a.join(";"))}}setNewHashSilent_(a){history.replaceState(null,
307
307
  "",document.location.pathname+"#"+a)}getHamburgerMenu(){return document.getElementById("hamburger-menu-contents")}hideElement_(a){a.classList.add("hidden")}showElement_(a){a.classList.remove("hidden")}async getManifestUriFromAdManager_(a){const b=this.player_.getAdManager(),c=this.controls_.getServerSideAdContainer();try{goog.asserts.assert(null!=this.video_,"Video should not be null!");b.initServerSide(c,this.video_);let d;null!=a.imaAssetKey?(d=new google.ima.dai.api.LiveStreamRequest,d.assetKey=
308
308
  a.imaAssetKey):(goog.asserts.assert(null!=a.imaContentSrcId&&null!=a.imaVideoId,"Asset should have ima ids!"),d=new google.ima.dai.api.VODStreamRequest,d.contentSourceId=a.imaContentSrcId,d.videoId=a.imaVideoId);switch(a.imaManifestType){case "DASH":case "dash":case "MPD":case "mpd":d.format=google.ima.dai.api.StreamRequest.StreamFormat.DASH;break;case "HLS":case "hls":case "M3U8":case "m3u8":d.format=google.ima.dai.api.StreamRequest.StreamFormat.HLS}return await b.requestServerSideStream(d,a.manifestUri)}catch(d){return console.log(d),