shaka-player 4.2.12 → 4.2.13
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/ISSUE_TEMPLATE/bug_report.md +11 -0
- package/.github/workflows/build-and-test.yaml +15 -0
- package/.github/workflows/selenium-lab-tests.yaml +3 -2
- package/.github/workflows/update-issues.yaml +1 -0
- package/CHANGELOG.md +17 -0
- package/dist/deps.js +1 -1
- package/dist/locales.js +31 -31
- package/dist/shaka-player.compiled.debug.js +23 -24
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.js +368 -369
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.debug.js +27 -29
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.js +383 -383
- package/dist/shaka-player.ui.map +2 -2
- package/docs/tutorials/selenium-grid-config.md +60 -8
- package/karma.conf.js +50 -7
- package/lib/abr/simple_abr_manager.js +5 -5
- package/lib/player.js +1 -5
- package/lib/polyfill/orientation.js +34 -7
- package/lib/text/vtt_text_parser.js +1 -0
- package/lib/util/manifest_parser_utils.js +4 -2
- package/lib/util/platform.js +14 -0
- package/lib/util/stream_utils.js +69 -26
- package/package.json +2 -2
- package/test/cast/cast_utils_unit.js +4 -1
- package/test/hls/hls_parser_unit.js +72 -0
- package/test/media/drm_engine_integration.js +2 -2
- package/test/media/segment_index_unit.js +3 -3
- package/test/media/streaming_engine_integration.js +14 -11
- package/test/offline/offline_integration.js +6 -3
- package/test/player_external.js +19 -16
- package/test/player_integration.js +35 -48
- package/test/player_src_equals_integration.js +9 -5
- package/test/test/util/fake_demo_main.js +7 -3
- package/test/test/util/layout_tests.js +2 -2
- package/test/test/util/ui_utils.js +9 -2
- package/test/test/util/util.js +6 -27
- package/test/test/util/waiter.js +73 -3
- package/test/ui/ad_ui_unit.js +9 -9
- package/test/util/stream_utils_unit.js +46 -0
- package/ui/range_element.js +5 -0
|
@@ -12,7 +12,16 @@ assignees: ''
|
|
|
12
12
|
**Have you read the [FAQ](https://bit.ly/ShakaFAQ) and checked for duplicate open issues?**
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
**If the problem is related to FairPlay, have you read the tutorial?**
|
|
16
|
+
<!-- NOTE: https://shaka-player-demo.appspot.com/docs/api/tutorial-fairplay.html -->
|
|
17
|
+
|
|
18
|
+
|
|
15
19
|
**What version of Shaka Player are you using?**
|
|
20
|
+
<!-- NOTE:
|
|
21
|
+
Only some versions of the application are maintained, if your version
|
|
22
|
+
is older, first update to a newer one. See:
|
|
23
|
+
https://github.com/shaka-project/shaka-player/blob/main/maintained-branches.md
|
|
24
|
+
--->
|
|
16
25
|
|
|
17
26
|
|
|
18
27
|
**Can you reproduce the issue with our latest release version?**
|
|
@@ -41,6 +50,8 @@ assignees: ''
|
|
|
41
50
|
enough to reproduce your issue, and we **will** ask you to send a
|
|
42
51
|
URI instead. You can copy the URI of the demo app to send us the
|
|
43
52
|
exact asset, licence server, and settings you have selected there.
|
|
53
|
+
If you send the URIs to email, the response time and resolution
|
|
54
|
+
will be much higher.
|
|
44
55
|
-->
|
|
45
56
|
|
|
46
57
|
|
|
@@ -125,6 +125,21 @@ jobs:
|
|
|
125
125
|
# Install a launcher that can execute a shell script to launch this
|
|
126
126
|
npm install karma-script-launcher --save-dev
|
|
127
127
|
|
|
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.
|
|
132
|
+
- name: 'Delete "Chrome for Testing" on Mac'
|
|
133
|
+
if: matrix.os == 'macos-latest' && matrix.browser == 'Chrome'
|
|
134
|
+
run: sudo rm -rf /Applications/Google\ Chrome\ for\ Testing.app
|
|
135
|
+
|
|
136
|
+
# Some CI images (self-hosted or otherwise) don't have the minimum Java
|
|
137
|
+
# version necessary for the compiler (Java 11).
|
|
138
|
+
- uses: actions/setup-java@v3
|
|
139
|
+
with:
|
|
140
|
+
distribution: zulu
|
|
141
|
+
java-version: 11
|
|
142
|
+
|
|
128
143
|
- name: Build Player
|
|
129
144
|
run: python build/all.py
|
|
130
145
|
|
|
@@ -251,11 +251,12 @@ jobs:
|
|
|
251
251
|
python3 build/test.py \
|
|
252
252
|
--no-build \
|
|
253
253
|
--reporters spec --spec-hide-passed \
|
|
254
|
-
--
|
|
254
|
+
--tls-key /etc/letsencrypt/live/karma.shakalab.rocks/privkey.pem \
|
|
255
|
+
--tls-cert /etc/letsencrypt/live/karma.shakalab.rocks/fullchain.pem \
|
|
255
256
|
--hostname karma.shakalab.rocks \
|
|
256
257
|
--port $KARMA_PORT \
|
|
257
258
|
--grid-config build/shaka-lab.yaml \
|
|
258
|
-
--grid-address selenium-grid.lab:4444 \
|
|
259
|
+
--grid-address selenium-grid.lab.shaka:4444 \
|
|
259
260
|
--browsers ${{ matrix.browser }} \
|
|
260
261
|
"${extra_flags[@]}"
|
|
261
262
|
# Capture the test exit code immediately after running the tests.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.2.13](https://github.com/shaka-project/shaka-player/compare/v4.2.12...v4.2.13) (2023-08-20)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* add MIME type for HTML5 tracks ([#5452](https://github.com/shaka-project/shaka-player/issues/5452)) ([e540ac1](https://github.com/shaka-project/shaka-player/commit/e540ac17caf1b2200edd31b3d13a0e9934db6a69))
|
|
9
|
+
* Default language to 'und' for native tracks ([#5464](https://github.com/shaka-project/shaka-player/issues/5464)) ([aeda19d](https://github.com/shaka-project/shaka-player/commit/aeda19df0b7431f5823ca8b88960ec3b0bf4cbc7))
|
|
10
|
+
* Fix exiting fullscreen on Safari ([#5439](https://github.com/shaka-project/shaka-player/issues/5439)) ([9121a52](https://github.com/shaka-project/shaka-player/commit/9121a5231949caf9010d582825581c30ae77d649)), closes [#5437](https://github.com/shaka-project/shaka-player/issues/5437)
|
|
11
|
+
* Fix memory leak on SimpleAbrManager ([#5478](https://github.com/shaka-project/shaka-player/issues/5478)) ([5c352c8](https://github.com/shaka-project/shaka-player/commit/5c352c86c830f121d55e47f705cd1dd384e6d4a8))
|
|
12
|
+
* gettting maxWidth and maxHeight for restrictToElementSize option ([#5481](https://github.com/shaka-project/shaka-player/issues/5481)) ([eca8436](https://github.com/shaka-project/shaka-player/commit/eca8436f436a758dbca89b4b96c80b369aba713f))
|
|
13
|
+
* Remove duplicate adaptation event before init ([#5492](https://github.com/shaka-project/shaka-player/issues/5492)) ([08708f0](https://github.com/shaka-project/shaka-player/commit/08708f004213ad370e323c2b09bd4553293ffef4))
|
|
14
|
+
* Support fLaC and Opus codec strings in HLS ([#5454](https://github.com/shaka-project/shaka-player/issues/5454)) ([18d5971](https://github.com/shaka-project/shaka-player/commit/18d597195bdc1b28aae83d16c10322fde3d8c140)), closes [#5453](https://github.com/shaka-project/shaka-player/issues/5453)
|
|
15
|
+
* **UI:** Disable right click on range elements ([#5497](https://github.com/shaka-project/shaka-player/issues/5497)) ([c508446](https://github.com/shaka-project/shaka-player/commit/c508446ab2e61278aa1855e3fd96cce59b995afb))
|
|
16
|
+
* Update karma-local-wd-launcher to fix Chromedriver >= 115, fix M1 mac ([#5489](https://github.com/shaka-project/shaka-player/issues/5489)) ([1789977](https://github.com/shaka-project/shaka-player/commit/17899774c0eecd38a46febbe848d978e71aa43e7))
|
|
17
|
+
* Update karma-local-wd-launcher to fix Edge >= 115 ([#5506](https://github.com/shaka-project/shaka-player/issues/5506)) ([d7d9efe](https://github.com/shaka-project/shaka-player/commit/d7d9efebbc154bf7635870d694d9ab0321cd26b3))
|
|
18
|
+
* **WebVTT:** Fix text-shadow in WebVTT not working ([#5499](https://github.com/shaka-project/shaka-player/issues/5499)) ([853ccd8](https://github.com/shaka-project/shaka-player/commit/853ccd83a66972ca316a1c6223e743fde4bfb5e9))
|
|
19
|
+
|
|
3
20
|
## [4.2.12](https://github.com/shaka-project/shaka-player/compare/v4.2.11...v4.2.12) (2023-07-21)
|
|
4
21
|
|
|
5
22
|
|
package/dist/deps.js
CHANGED
|
@@ -116,7 +116,7 @@ goog.addDependency('../../../../lib/polyfill/encryption_scheme.js', ['shaka.poly
|
|
|
116
116
|
goog.addDependency('../../../../lib/polyfill/fullscreen.js', ['shaka.polyfill.Fullscreen'], ['shaka.polyfill'], {'lang': 'es6'});
|
|
117
117
|
goog.addDependency('../../../../lib/polyfill/media_capabilities.js', ['shaka.polyfill.MediaCapabilities'], ['shaka.log', 'shaka.polyfill', 'shaka.util.Platform'], {'lang': 'es8'});
|
|
118
118
|
goog.addDependency('../../../../lib/polyfill/mediasource.js', ['shaka.polyfill.MediaSource'], ['shaka.log', 'shaka.polyfill', 'shaka.util.MimeUtils', 'shaka.util.Platform'], {'lang': 'es6'});
|
|
119
|
-
goog.addDependency('../../../../lib/polyfill/orientation.js', ['shaka.polyfill.Orientation'], ['shaka.polyfill', 'shaka.util.FakeEvent', 'shaka.util.FakeEventTarget'], {'lang': 'es6'});
|
|
119
|
+
goog.addDependency('../../../../lib/polyfill/orientation.js', ['shaka.polyfill.Orientation'], ['shaka.log', 'shaka.polyfill', 'shaka.util.FakeEvent', 'shaka.util.FakeEventTarget'], {'lang': 'es6'});
|
|
120
120
|
goog.addDependency('../../../../lib/polyfill/patchedmediakeys_apple.js', ['shaka.polyfill.PatchedMediaKeysApple'], ['goog.asserts', 'shaka.log', 'shaka.media.DrmEngine', 'shaka.polyfill', 'shaka.util.BufferUtils', 'shaka.util.EventManager', 'shaka.util.FakeEvent', 'shaka.util.FakeEventTarget', 'shaka.util.MediaReadyState', 'shaka.util.PublicPromise', 'shaka.util.StringUtils'], {'lang': 'es6'});
|
|
121
121
|
goog.addDependency('../../../../lib/polyfill/patchedmediakeys_nop.js', ['shaka.polyfill.PatchedMediaKeysNop'], ['goog.asserts', 'shaka.log', 'shaka.polyfill'], {'lang': 'es6'});
|
|
122
122
|
goog.addDependency('../../../../lib/polyfill/patchedmediakeys_webkit.js', ['shaka.polyfill.PatchedMediaKeysWebkit'], ['goog.asserts', 'shaka.log', 'shaka.media.DrmEngine', 'shaka.polyfill', 'shaka.util.BufferUtils', 'shaka.util.EventManager', 'shaka.util.FakeEvent', 'shaka.util.FakeEventTarget', 'shaka.util.PublicPromise', 'shaka.util.StringUtils', 'shaka.util.Timer', 'shaka.util.Uint8ArrayUtils'], {'lang': 'es6'});
|
package/dist/locales.js
CHANGED
|
@@ -721,45 +721,45 @@ shaka.ui.Locales.addTo = function(localization) {
|
|
|
721
721
|
* @const
|
|
722
722
|
*/
|
|
723
723
|
shaka.ui.Locales.Ids = {
|
|
724
|
+
SKIP_TO_LIVE: 'SKIP_TO_LIVE',
|
|
725
|
+
CAST: 'CAST',
|
|
726
|
+
EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
|
|
727
|
+
NOT_APPLICABLE: 'NOT_APPLICABLE',
|
|
728
|
+
EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
|
|
729
|
+
CAPTIONS: 'CAPTIONS',
|
|
730
|
+
PICTURE_IN_PICTURE: 'PICTURE_IN_PICTURE',
|
|
731
|
+
UNMUTE: 'UNMUTE',
|
|
732
|
+
EXIT_LOOP_MODE: 'EXIT_LOOP_MODE',
|
|
733
|
+
AUTO_QUALITY: 'AUTO_QUALITY',
|
|
734
|
+
MORE_SETTINGS: 'MORE_SETTINGS',
|
|
724
735
|
FULL_SCREEN: 'FULL_SCREEN',
|
|
725
|
-
|
|
736
|
+
UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE',
|
|
737
|
+
STATISTICS: 'STATISTICS',
|
|
738
|
+
AD_TIME: 'AD_TIME',
|
|
739
|
+
AD_DURATION: 'AD_DURATION',
|
|
726
740
|
AIRPLAY: 'AIRPLAY',
|
|
727
741
|
SKIP_AD: 'SKIP_AD',
|
|
728
|
-
RESOLUTION: 'RESOLUTION',
|
|
729
742
|
ON: 'ON',
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
|
|
734
|
-
UNMUTE: 'UNMUTE',
|
|
735
|
-
EXIT_LOOP_MODE: 'EXIT_LOOP_MODE',
|
|
736
|
-
VOLUME: 'VOLUME',
|
|
737
|
-
PLAY: 'PLAY',
|
|
743
|
+
OFF: 'OFF',
|
|
744
|
+
PAUSE: 'PAUSE',
|
|
745
|
+
LIVE: 'LIVE',
|
|
738
746
|
FAST_FORWARD: 'FAST_FORWARD',
|
|
747
|
+
SUBTITLE_FORCED: 'SUBTITLE_FORCED',
|
|
748
|
+
ENTER_LOOP_MODE: 'ENTER_LOOP_MODE',
|
|
749
|
+
SEEK: 'SEEK',
|
|
739
750
|
QUALITY: 'QUALITY',
|
|
740
|
-
|
|
741
|
-
UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE',
|
|
742
|
-
OFF: 'OFF',
|
|
743
|
-
AD_TIME: 'AD_TIME',
|
|
744
|
-
AD_PROGRESS: 'AD_PROGRESS',
|
|
745
|
-
CAST: 'CAST',
|
|
746
|
-
EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
|
|
751
|
+
PLAY: 'PLAY',
|
|
747
752
|
MULTIPLE_LANGUAGES: 'MULTIPLE_LANGUAGES',
|
|
748
|
-
|
|
749
|
-
AUTO_QUALITY: 'AUTO_QUALITY',
|
|
750
|
-
SEEK: 'SEEK',
|
|
751
|
-
STATISTICS: 'STATISTICS',
|
|
752
|
-
MORE_SETTINGS: 'MORE_SETTINGS',
|
|
753
|
-
REPLAY: 'REPLAY',
|
|
754
|
-
CAPTIONS: 'CAPTIONS',
|
|
755
|
-
SUBTITLE_FORCED: 'SUBTITLE_FORCED',
|
|
756
|
-
LIVE: 'LIVE',
|
|
757
|
-
NOT_APPLICABLE: 'NOT_APPLICABLE',
|
|
758
|
-
PAUSE: 'PAUSE',
|
|
753
|
+
RESOLUTION: 'RESOLUTION',
|
|
759
754
|
LOOP: 'LOOP',
|
|
755
|
+
AD_PROGRESS: 'AD_PROGRESS',
|
|
760
756
|
REWIND: 'REWIND',
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
757
|
+
REPLAY: 'REPLAY',
|
|
758
|
+
LANGUAGE: 'LANGUAGE',
|
|
759
|
+
ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
|
|
760
|
+
UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE',
|
|
761
|
+
BACK: 'BACK',
|
|
762
|
+
VOLUME: 'VOLUME',
|
|
764
763
|
MUTE: 'MUTE',
|
|
764
|
+
PLAYBACK_RATE: 'PLAYBACK_RATE',
|
|
765
765
|
};
|
|
@@ -204,7 +204,7 @@ goog.Uri.QueryData.prototype.toDecodedString=function(){return goog.Uri.decodeOr
|
|
|
204
204
|
shaka.util.ManifestParserUtils.createDrmInfo=function(a,b){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:b||[],keyIds:new Set}};
|
|
205
205
|
shaka.util.ManifestParserUtils.guessCodecs=function(a,b){if(1==b.length)return b[0];a=shaka.util.ManifestParserUtils.guessCodecsSafe(a,b);if(null!=a)return a;throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.HLS_COULD_NOT_GUESS_CODECS,b);};
|
|
206
206
|
shaka.util.ManifestParserUtils.guessCodecsSafe=function(a,b){for(var c=$jscomp.makeIterator(shaka.util.ManifestParserUtils.CODEC_REGEXPS_BY_CONTENT_TYPE_[a]),d=c.next();!d.done;d=c.next()){d=d.value;for(var e=$jscomp.makeIterator(b),f=e.next();!f.done;f=e.next())if(f=f.value,d.test(f.trim()))return f.trim()}return a==shaka.util.ManifestParserUtils.ContentType.TEXT?"":null};shaka.util.ManifestParserUtils.ContentType={VIDEO:"video",AUDIO:"audio",TEXT:"text",IMAGE:"image",APPLICATION:"application"};
|
|
207
|
-
shaka.util.ManifestParserUtils.TextStreamKind={SUBTITLE:"subtitle",CLOSED_CAPTION:"caption"};shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS=1/15;shaka.util.ManifestParserUtils.VIDEO_CODEC_REGEXPS_=[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av01/,/^dvh/];shaka.util.ManifestParserUtils.AUDIO_CODEC_REGEXPS_=[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4$/,/^dts[cex]$/];shaka.util.ManifestParserUtils.TEXT_CODEC_REGEXPS_=[/^vtt$/,/^wvtt/,/^stpp/];
|
|
207
|
+
shaka.util.ManifestParserUtils.TextStreamKind={SUBTITLE:"subtitle",CLOSED_CAPTION:"caption"};shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS=1/15;shaka.util.ManifestParserUtils.VIDEO_CODEC_REGEXPS_=[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av01/,/^dvh/];shaka.util.ManifestParserUtils.AUDIO_CODEC_REGEXPS_=[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4$/,/^dts[cex]$/];shaka.util.ManifestParserUtils.TEXT_CODEC_REGEXPS_=[/^vtt$/,/^wvtt/,/^stpp/];
|
|
208
208
|
shaka.util.ManifestParserUtils.CODEC_REGEXPS_BY_CONTENT_TYPE_={audio:shaka.util.ManifestParserUtils.AUDIO_CODEC_REGEXPS_,video:shaka.util.ManifestParserUtils.VIDEO_CODEC_REGEXPS_,text:shaka.util.ManifestParserUtils.TEXT_CODEC_REGEXPS_};shaka.util.PublicPromise=function(){var a,b,c=new Promise(function(d,e){a=d;b=e});c.resolve=a;c.reject=b;return c};shaka.util.PublicPromise.prototype.resolve=function(a){};shaka.util.PublicPromise.prototype.reject=function(a){};shaka.util.Lazy=function(a){this.gen_=a;this.value_=void 0};shaka.util.Lazy.prototype.value=function(){void 0==this.value_&&(this.value_=this.gen_(),goog.asserts.assert(void 0!=this.value_,"Unable to create lazy value"));return this.value_};shaka.util.Lazy.prototype.reset=function(){this.value_=void 0};shaka.util.DelayedTick=function(a){this.onTick_=a;this.cancelPending_=null};shaka.util.DelayedTick.prototype.tickAfter=function(a){var b=this;this.stop();var c=!0,d=null;this.cancelPending_=function(){window.clearTimeout(d);c=!1};d=window.setTimeout(function(){if(c)b.onTick_()},1E3*a);return this};shaka.util.DelayedTick.prototype.stop=function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)};shaka.util.Timer=function(a){this.onTick_=a;this.ticker_=null};shaka.util.Timer.prototype.tickNow=function(){this.stop();this.onTick_();return this};shaka.util.Timer.prototype.tickAfter=function(a){var b=this;this.stop();this.ticker_=(new shaka.util.DelayedTick(function(){b.onTick_()})).tickAfter(a);return this};
|
|
209
209
|
shaka.util.Timer.prototype.tickEvery=function(a){var b=this;this.stop();goog.DEBUG&&shaka.util.Timer.activeTimers.set(this,Error("Timer created").stack);this.ticker_=(new shaka.util.DelayedTick(function(){b.ticker_.tickAfter(a);b.onTick_()})).tickAfter(a);return this};shaka.util.Timer.prototype.stop=function(){this.ticker_&&(this.ticker_.stop(),this.ticker_=null);goog.DEBUG&&shaka.util.Timer.activeTimers.delete(this)};goog.exportSymbol("shaka.util.Timer",shaka.util.Timer);
|
|
210
210
|
goog.exportProperty(shaka.util.Timer.prototype,"stop",shaka.util.Timer.prototype.stop);goog.exportProperty(shaka.util.Timer.prototype,"tickEvery",shaka.util.Timer.prototype.tickEvery);goog.exportProperty(shaka.util.Timer.prototype,"tickAfter",shaka.util.Timer.prototype.tickAfter);goog.exportProperty(shaka.util.Timer.prototype,"tickNow",shaka.util.Timer.prototype.tickNow);goog.DEBUG&&(shaka.util.Timer.activeTimers=new Map);shaka.util.Platform=function(){};shaka.util.Platform.supportsMediaSource=function(){return window.MediaSource&&MediaSource.isTypeSupported?!0:!1};shaka.util.Platform.supportsMediaType=function(a){return""!=shaka.util.Platform.anyMediaElement().canPlayType(a)};shaka.util.Platform.isEdge=function(){return navigator.userAgent.match(/Edge?\//)?!0:!1};shaka.util.Platform.isLegacyEdge=function(){return navigator.userAgent.match(/Edge\//)?!0:!1};shaka.util.Platform.isIE=function(){return shaka.util.Platform.userAgentContains_("Trident/")};
|
|
@@ -214,7 +214,7 @@ shaka.util.Platform.chromeVersion=function(){if(!shaka.util.Platform.isChrome())
|
|
|
214
214
|
shaka.util.Platform.isApple=function(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!shaka.util.Platform.isTizen()&&!shaka.util.Platform.isEOS()&&!shaka.util.Platform.isVirginMedia()&&!shaka.util.Platform.isPS4()&&!shaka.util.Platform.isAmazonFireTV()};shaka.util.Platform.isPS5=function(){return shaka.util.Platform.userAgentContains_("PlayStation 5")};shaka.util.Platform.isPS4=function(){return shaka.util.Platform.userAgentContains_("PlayStation 4")};
|
|
215
215
|
shaka.util.Platform.isHisense=function(){return shaka.util.Platform.userAgentContains_("Hisense")||shaka.util.Platform.userAgentContains_("VIDAA")};shaka.util.Platform.isVirginMedia=function(){return shaka.util.Platform.userAgentContains_("VirginMedia")};shaka.util.Platform.isAmazonFireTV=function(){return shaka.util.Platform.userAgentContains_("AFT")};
|
|
216
216
|
shaka.util.Platform.safariVersion=function(){if(!shaka.util.Platform.isApple())return null;var a=navigator.userAgent.match(/Version\/(\d+)/);return a?parseInt(a[1],10):(a=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(a[1],10):null};shaka.util.Platform.isSafari=function(){return!!shaka.util.Platform.safariVersion()};shaka.util.Platform.isEOS=function(){return shaka.util.Platform.userAgentContains_("PC=EOS")};
|
|
217
|
-
shaka.util.Platform.isMobile=function(){return/(?:iPhone|iPad|iPod|Android)/.test(navigator.userAgent)?!0:shaka.util.Platform.isApple()&&1<navigator.maxTouchPoints};shaka.util.Platform.userAgentContains_=function(a){return(navigator.userAgent||"").includes(a)};
|
|
217
|
+
shaka.util.Platform.isMobile=function(){return/(?:iPhone|iPad|iPod|Android)/.test(navigator.userAgent)?!0:shaka.util.Platform.isApple()&&1<navigator.maxTouchPoints};shaka.util.Platform.isMac=function(){return navigator.userAgentData&&navigator.userAgentData.platform?"macos"==navigator.userAgentData.platform.toLowerCase():navigator.platform.toLowerCase().includes("mac")};shaka.util.Platform.userAgentContains_=function(a){return(navigator.userAgent||"").includes(a)};
|
|
218
218
|
shaka.util.Platform.anyMediaElement=function(){var a=shaka.util.Platform;if(a.cachedMediaElement_)return a.cachedMediaElement_;a.cacheExpirationTimer_||(a.cacheExpirationTimer_=new shaka.util.Timer(function(){a.cachedMediaElement_=null}));a.cachedMediaElement_=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0];a.cachedMediaElement_||(a.cachedMediaElement_=document.createElement("video"));a.cacheExpirationTimer_.tickAfter(1);return a.cachedMediaElement_};
|
|
219
219
|
shaka.util.Platform.requiresEncryptionInfoInAllInitSegments=function(){var a=shaka.util.Platform;return a.isTizen()||a.isXboxOne()};shaka.util.Platform.isMediaKeysPolyfilled=function(){return window.shakaMediaKeysPolyfill?!0:!1};shaka.util.Platform.cacheExpirationTimer_=null;shaka.util.Platform.cachedMediaElement_=null;shaka.util.StringUtils=function(){};
|
|
220
220
|
shaka.util.StringUtils.fromUTF8=function(a){if(!a)return"";a=shaka.util.BufferUtils.toUint8(a);239==a[0]&&187==a[1]&&191==a[2]&&(a=a.subarray(3));if(window.TextDecoder&&!shaka.util.Platform.isPS4())return a=(new TextDecoder).decode(a),a.includes("\ufffd")&&shaka.log.alwaysError('Decoded string contains an "unknown character" codepoint. That probably means the UTF8 encoding was incorrect!'),a;for(var b="",c=0;c<a.length;++c){var d=65533;0==(a[c]&128)?d=a[c]:a.length>=c+2&&192==(a[c]&224)&&128==(a[c+
|
|
@@ -283,18 +283,17 @@ shaka.util.StreamUtils.getVariantCodecs_=function(a){var b="";a.video&&(b=shaka.
|
|
|
283
283
|
shaka.util.StreamUtils.meetsRestrictions=function(a,b,c){var d=function(f,g,h){return f>=g&&f<=h},e=a.video;if(0!=a.disabledUntilTime){if(a.disabledUntilTime>Date.now()/1E3)return!1;a.disabledUntilTime=0}return e&&e.width&&e.height&&(!d(e.width,b.minWidth,Math.min(b.maxWidth,c.width))||!d(e.height,b.minHeight,Math.min(b.maxHeight,c.height))||!d(e.width*e.height,b.minPixels,b.maxPixels))||a&&a.video&&a.video.frameRate&&!d(a.video.frameRate,b.minFrameRate,b.maxFrameRate)||!d(a.bandwidth,b.minBandwidth,
|
|
284
284
|
b.maxBandwidth)?!1:!0};shaka.util.StreamUtils.applyRestrictions=function(a,b,c){var d=!1;a=$jscomp.makeIterator(a);for(var e=a.next();!e.done;e=a.next()){e=e.value;var f=e.allowedByApplication;e.allowedByApplication=shaka.util.StreamUtils.meetsRestrictions(e,b,c);f!=e.allowedByApplication&&(d=!0)}return d};
|
|
285
285
|
shaka.util.StreamUtils.filterManifest=function(a,b,c){return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){if(1==d.nextAddress)return d.yield(shaka.util.StreamUtils.filterManifestByMediaCapabilities(c,0<c.offlineSessionIds.length),2);shaka.util.StreamUtils.filterManifestByCurrentVariant(b,c);shaka.util.StreamUtils.filterTextStreams_(c);return d.yield(shaka.util.StreamUtils.filterImageStreams_(c),0)})};
|
|
286
|
-
shaka.util.StreamUtils.filterManifestByMediaCapabilities=function(a,b){return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){if(1==c.nextAddress)return goog.asserts.assert(navigator.mediaCapabilities,"MediaCapabilities should be valid."),c.yield(shaka.util.StreamUtils.getDecodingInfosForVariants(a.variants,b,!1),2);a.variants=a.variants.filter(function(d){var e=d.video,f=shaka.util.ManifestParserUtils.ContentType
|
|
287
|
-
e.codecs.split(",");g
|
|
288
|
-
|
|
289
|
-
shaka.log.debug("Dropping variant - not compatible with platform",shaka.util.StreamUtils.getVariantSummaryString_(d));return e});c.jumpToEnd()})};
|
|
286
|
+
shaka.util.StreamUtils.filterManifestByMediaCapabilities=function(a,b){return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){if(1==c.nextAddress)return goog.asserts.assert(navigator.mediaCapabilities,"MediaCapabilities should be valid."),c.yield(shaka.util.StreamUtils.getDecodingInfosForVariants(a.variants,b,!1),2);a.variants=a.variants.filter(function(d){var e=d.video,f=shaka.util.ManifestParserUtils.ContentType,g=shaka.util.ManifestParserUtils,h=shaka.util.MimeUtils,k=shaka.util.StreamUtils;
|
|
287
|
+
if(e){var l=k.getCorrectVideoCodecs_(e.codecs);if(e.codecs.includes(",")){var m=e.codecs.split(",");l=g.guessCodecs(f.VIDEO,m);l=k.getCorrectVideoCodecs_(l);g=g.guessCodecs(f.AUDIO,m);g=k.getCorrectAudioCodecs_(g);m=h.getFullOrConvertedType(e.mimeType,g,f.AUDIO);if(!MediaSource.isTypeSupported(m))return!1;l=[l,g].join()}g=h.getFullOrConvertedType(e.mimeType,l,f.VIDEO);if(!MediaSource.isTypeSupported(g))return!1;e.codecs=l}if(l=d.audio){g=k.getCorrectAudioCodecs_(l.codecs);f=h.getFullOrConvertedType(l.mimeType,
|
|
288
|
+
g,f.AUDIO);if(!MediaSource.isTypeSupported(f))return!1;l.codecs=g}if(shaka.util.Platform.isXboxOne()&&e&&(e.width&&1920<e.width||e.height&&1080<e.height)&&(e.codecs.includes("avc1.")||e.codecs.includes("avc3.")))return shaka.log.debug("Dropping variant - not compatible with platform",k.getVariantSummaryString_(d)),!1;(e=d.decodingInfos.some(function(n){return n.supported}))||shaka.log.debug("Dropping variant - not compatible with platform",k.getVariantSummaryString_(d));return e});c.jumpToEnd()})};
|
|
290
289
|
shaka.util.StreamUtils.getDecodingInfosForVariants=function(a,b,c){var d,e,f,g,h,k,l,m,n,p,q;return $jscomp.asyncExecutePromiseGeneratorProgram(function(r){if(d=a.some(function(v){return v.decodingInfos.length}))return shaka.log.debug("Already got the variants' decodingInfo."),r.return();e=navigator.mediaCapabilities;f=[];g=function(v,t){var u,x;return $jscomp.asyncExecutePromiseGeneratorProgram(function(w){if(1==w.nextAddress)return w.setCatchFinallyBlocks(2),w.yield(e.decodingInfo(t),4);if(2!=w.nextAddress)return u=
|
|
291
290
|
w.yieldResult,v.decodingInfos.push(u),w.leaveTryBlock(0);x=w.enterCatchBlock();shaka.log.info("MediaCapabilities.decodingInfo() failed.",JSON.stringify(t),x);w.jumpToEnd()})};h=$jscomp.makeIterator(a);for(k=h.next();!k.done;k=h.next())for(l=k.value,m=shaka.util.StreamUtils.getDecodingConfigs_(l,b,c),n=$jscomp.makeIterator(m),p=n.next();!p.done;p=n.next())q=p.value,f.push(g(l,q));return r.yield(Promise.all(f),0)})};
|
|
292
|
-
shaka.util.StreamUtils.getDecodingConfigs_=function(a,b,c){var d=a.audio,e=a.video,f=shaka.util.ManifestParserUtils.ContentType;c={type:c?"file":"media-source"};if(e){var
|
|
293
|
-
1,samplerate:1,spatialRendering:!1}}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
291
|
+
shaka.util.StreamUtils.getDecodingConfigs_=function(a,b,c){var d=a.audio,e=a.video,f=shaka.util.ManifestParserUtils.ContentType,g=shaka.util.ManifestParserUtils,h=shaka.util.MimeUtils,k=shaka.util.StreamUtils;c={type:c?"file":"media-source"};if(e){var l=e.codecs;if(e.codecs.includes(",")){var m=e.codecs.split(",");l=g.guessCodecs(f.VIDEO,m);l=k.getCorrectVideoCodecs_(l);g=g.guessCodecs(f.AUDIO,m);g=k.getCorrectAudioCodecs_(g);g=h.getFullOrConvertedType(e.mimeType,g,f.AUDIO);c.audio={contentType:g,
|
|
292
|
+
channels:2,bitrate:a.bandwidth||1,samplerate:1,spatialRendering:!1}}l=k.getCorrectVideoCodecs_(l);l=h.getFullOrConvertedType(e.mimeType,l,f.VIDEO);c.video={contentType:l,width:e.width||64,height:e.height||64,bitrate:e.bandwidth||a.bandwidth||1,framerate:e.frameRate||1};if(e.hdr)switch(e.hdr){case "SDR":c.video.transferFunction="srgb";break;case "PQ":c.video.transferFunction="pq";break;case "HLG":c.video.transferFunction="hlg"}}d&&(k=k.getCorrectAudioCodecs_(d.codecs),f=h.getFullOrConvertedType(d.mimeType,
|
|
293
|
+
k,f.AUDIO),c.audio={contentType:f,channels:d.channelsCount||2,bitrate:d.bandwidth||a.bandwidth||1,samplerate:d.audioSamplingRate||1,spatialRendering:d.spatialAudio});h=(a.video?a.video.drmInfos:[]).concat(a.audio?a.audio.drmInfos:[]);if(!h.length)return[c];a=[];f=new Map;h=$jscomp.makeIterator(h);for(var n=h.next();!n.done;n=h.next())k=n.value,f.get(k.keySystem)||f.set(k.keySystem,[]),f.get(k.keySystem).push(k);h=b?"required":"optional";b=b?["persistent-license"]:["temporary"];k=$jscomp.makeIterator(f.keys());
|
|
294
|
+
for(l=k.next();!l.done;l=k.next()){g=l.value;l=Object.assign({},c);m=f.get(g);g={keySystem:g,initDataType:"cenc",persistentState:h,distinctiveIdentifier:"optional",sessionTypes:b};m=$jscomp.makeIterator(m);for(n=m.next();!n.done;n=m.next()){n=n.value;if(n.initData&&n.initData.length){for(var p=new Set,q=$jscomp.makeIterator(n.initData),r=q.next();!r.done;r=q.next())p.add(r.value.initDataType);1<p.size&&shaka.log.v2("DrmInfo contains more than one initDataType,","and we use the initDataType of the first initData.",
|
|
295
|
+
n);g.initDataType=n.initData[0].initDataType}n.distinctiveIdentifierRequired&&(g.distinctiveIdentifier="required");n.persistentStateRequired&&(g.persistentState="required");n.sessionType&&(g.sessionTypes=[n.sessionType]);d&&(""!=n.audioRobustness?g.audio?g.audio.robustness=g.audio.robustness||n.audioRobustness:g.audio={robustness:n.audioRobustness}:g.audio||(g.audio={}));e&&(""!=n.videoRobustness?g.video?g.video.robustness=g.video.robustness||n.videoRobustness:g.video={robustness:n.videoRobustness}:
|
|
296
|
+
g.video||(g.video={}))}l.keySystemConfiguration=g;a.push(l)}return a};shaka.util.StreamUtils.getCorrectAudioCodecs_=function(a){return"fLaC"===a?"flac":"Opus"===a?"opus":shaka.util.Platform.isTizen()?"ac-3"==a.toLowerCase()?"ec-3":a:a};
|
|
298
297
|
shaka.util.StreamUtils.getCorrectVideoCodecs_=function(a){if(a.includes("avc1")){var b=a.split(".");if(3==b.length)return a=b.shift()+".",a+=parseInt(b.shift(),10).toString(16),a+=("000"+parseInt(b.shift(),10).toString(16)).slice(-4)}else if("vp9"==a)return"vp09.00.41.08";return a};
|
|
299
298
|
shaka.util.StreamUtils.filterManifestByCurrentVariant=function(a,b){var c=shaka.util.StreamUtils;b.variants=b.variants.filter(function(d){var e=d.audio;d=d.video;return e&&a&&a.audio&&!c.areStreamsCompatible_(e,a.audio)?(shaka.log.debug("Dropping variant - not compatible with active audio","active audio",c.getStreamSummaryString_(a.audio),"variant.audio",c.getStreamSummaryString_(e)),!1):d&&a&&a.video&&!c.areStreamsCompatible_(d,a.video)?(shaka.log.debug("Dropping variant - not compatible with active video",
|
|
300
299
|
"active video",c.getStreamSummaryString_(a.video),"variant.video",c.getStreamSummaryString_(d)),!1):!0})};shaka.util.StreamUtils.filterTextStreams_=function(a){a.textStreams=a.textStreams.filter(function(b){var c=shaka.util.MimeUtils.getFullType(b.mimeType,b.codecs);(c=shaka.text.TextEngine.isTypeSupported(c))||shaka.log.debug("Dropping text stream. Is not supported by the platform.",b);return c})};
|
|
@@ -308,10 +307,10 @@ shaka.util.StreamUtils.textStreamToTrack=function(a){return{id:a.id,active:!1,ty
|
|
|
308
307
|
spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:a.originalId,originalImageId:null}};
|
|
309
308
|
shaka.util.StreamUtils.imageStreamToTrack=function(a){var b=shaka.util.ManifestParserUtils.ContentType,c=a.width||null,d=a.height||null,e=null;a.segmentIndex&&(e=a.segmentIndex.get(0));var f=a.tilesLayout;e&&(f=e.getTilesLayout()||f);f&&null!=c&&(c/=Number(f.split("x")[0]));f&&null!=d&&(d/=Number(f.split("x")[1]));return{id:a.id,active:!1,type:b.IMAGE,bandwidth:a.bandwidth||0,language:"",label:null,kind:null,width:c,height:d,frameRate:null,pixelAspectRatio:null,hdr:null,mimeType:a.mimeType,audioMimeType:null,
|
|
310
309
|
videoMimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:!1,roles:[],audioRoles:null,forced:!1,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:f||null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:a.originalId}};shaka.util.StreamUtils.html5TrackId=function(a){a.__shaka_id||(a.__shaka_id=shaka.util.StreamUtils.nextTrackId_++);return a.__shaka_id};
|
|
311
|
-
shaka.util.StreamUtils.html5TextTrackToTrack=function(a){var b=shaka.util.MimeUtils.CEA608_CLOSED_CAPTION_MIMETYPE,c=shaka.util.StreamUtils.html5TrackToGenericShakaTrack_(a);c.active="disabled"!=a.mode;c.type="text";c.originalTextId=a.id;"captions"==a.kind&&(c.mimeType=b);a.kind&&(c.roles=[a.kind]);"forced"==a.kind&&(c.forced=!0);return c};
|
|
310
|
+
shaka.util.StreamUtils.html5TextTrackToTrack=function(a){var b=shaka.util.MimeUtils.CEA608_CLOSED_CAPTION_MIMETYPE,c=shaka.util.StreamUtils.html5TrackToGenericShakaTrack_(a);c.active="disabled"!=a.mode;c.type="text";c.originalTextId=a.id;"captions"==a.kind&&(c.mimeType=b);"subtitles"==a.kind&&(c.mimeType="text/vtt");a.kind&&(c.roles=[a.kind]);"forced"==a.kind&&(c.forced=!0);return c};
|
|
312
311
|
shaka.util.StreamUtils.html5AudioTrackToTrack=function(a){var b=shaka.util.StreamUtils.html5TrackToGenericShakaTrack_(a);b.active=a.enabled;b.type="variant";b.originalAudioId=a.id;"main"==a.kind&&(b.primary=!0);a.kind&&(b.roles=[a.kind],b.audioRoles=[a.kind],b.label=a.label);return b};
|
|
313
|
-
shaka.util.StreamUtils.html5TrackToGenericShakaTrack_=function(a){return{id:shaka.util.StreamUtils.html5TrackId(a),active:!1,type:"",bandwidth:0,language:shaka.util.LanguageUtils.normalize(
|
|
314
|
-
spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null}};shaka.util.StreamUtils.isPlayable=function(a){return a.allowedByApplication&&a.allowedByKeySystem};shaka.util.StreamUtils.getPlayableVariants=function(a){return a.filter(function(b){return shaka.util.StreamUtils.isPlayable(b)})};
|
|
312
|
+
shaka.util.StreamUtils.html5TrackToGenericShakaTrack_=function(a){var b=a.language;return{id:shaka.util.StreamUtils.html5TrackId(a),active:!1,type:"",bandwidth:0,language:shaka.util.LanguageUtils.normalize(b||"und"),label:a.label,kind:a.kind,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,mimeType:null,audioMimeType:null,videoMimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:!1,roles:[],forced:!1,audioRoles:null,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,
|
|
313
|
+
spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null,originalLanguage:b}};shaka.util.StreamUtils.isPlayable=function(a){return a.allowedByApplication&&a.allowedByKeySystem};shaka.util.StreamUtils.getPlayableVariants=function(a){return a.filter(function(b){return shaka.util.StreamUtils.isPlayable(b)})};
|
|
315
314
|
shaka.util.StreamUtils.filterVariantsByAudioChannelCount=function(a,b){var c=a.filter(function(g){return g.audio&&g.audio.channelsCount}),d=new Map;c=$jscomp.makeIterator(c);for(var e=c.next();!e.done;e=c.next()){e=e.value;var f=e.audio.channelsCount;goog.asserts.assert(null!=f,"Must have count after filtering!");d.has(f)||d.set(f,[]);d.get(f).push(e)}c=Array.from(d.keys());if(0==c.length)return a;a=c.filter(function(g){return g<=b});return a.length?d.get(Math.max.apply(Math,$jscomp.arrayFromIterable(a))):
|
|
316
315
|
d.get(Math.min.apply(Math,$jscomp.arrayFromIterable(c)))};
|
|
317
316
|
shaka.util.StreamUtils.filterStreamsByLanguageAndRole=function(a,b,c,d){var e=shaka.util.LanguageUtils,f=a,g=a.filter(function(l){return l.primary});g.length&&(f=g);var h=f.length?f[0].language:"";f=f.filter(function(l){return l.language==h});if(b){var k=e.findClosestLocale(e.normalize(b),a.map(function(l){return l.language}));k&&(f=a.filter(function(l){return e.normalize(l.language)==k}))}f=f.filter(function(l){return l.forced==d});if(c){a=shaka.util.StreamUtils.filterTextStreamsByRole_(f,c);if(a.length)return a;
|
|
@@ -319,11 +318,11 @@ shaka.log.warning("No exact match for the text role could be found.")}else if(a=
|
|
|
319
318
|
shaka.util.StreamUtils.isVideo=function(a){return a.type==shaka.util.ManifestParserUtils.ContentType.VIDEO};shaka.util.StreamUtils.getVariantStreams=function(a){var b=[];a.audio&&b.push(a.audio);a.video&&b.push(a.video);return b};shaka.util.StreamUtils.getVariantSummaryString_=function(a){var b=[];a.audio&&b.push(shaka.util.StreamUtils.getStreamSummaryString_(a.audio));a.video&&b.push(shaka.util.StreamUtils.getStreamSummaryString_(a.video));return b.join(", ")};
|
|
320
319
|
shaka.util.StreamUtils.getStreamSummaryString_=function(a){return shaka.util.StreamUtils.isAudio(a)?"type=audio codecs="+a.codecs+" bandwidth="+a.bandwidth+" channelsCount="+a.channelsCount+" audioSamplingRate="+a.audioSamplingRate:shaka.util.StreamUtils.isVideo(a)?"type=video codecs="+a.codecs+" bandwidth="+a.bandwidth+" frameRate="+a.frameRate+" width="+a.width+" height="+a.height:"unexpected stream type"};shaka.util.StreamUtils.nextTrackId_=0;
|
|
321
320
|
shaka.util.StreamUtils.DecodingAttributes={SMOOTH:"smooth",POWER:"powerEfficient",BANDWIDTH:"bandwidth"};shaka.util.StreamUtils.supportedImageMimeTypes_=(new Map).set("image/svg+xml",!0).set("image/png",!0).set("image/jpeg",!0).set("image/jpg",!0);shaka.util.StreamUtils.minWebPImage_="data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA";shaka.util.StreamUtils.minAvifImage_="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=";
|
|
322
|
-
shaka.util.StreamUtils.minImage_=(new Map).set("image/webp",shaka.util.StreamUtils.minWebPImage_).set("image/avif",shaka.util.StreamUtils.minAvifImage_);shaka.abr.SimpleAbrManager=function(){var a=this;this.switch_=null;this.enabled_=!1;this.bandwidthEstimator_=new shaka.abr.EwmaBandwidthEstimator;navigator.connection&&navigator.connection.addEventListener&&(this.onNetworkInformationChange_=function(){if(a.enabled_&&a.config_.useNetworkInformation){a.bandwidthEstimator_=new shaka.abr.EwmaBandwidthEstimator;a.config_&&a.bandwidthEstimator_.configure(a.config_.advanced);var b=a.chooseVariant();b&&a.switch_(b)}},
|
|
323
|
-
this.onNetworkInformationChange_));this.variants_=[];this.playbackRate_=1;this.startupComplete_=!1;this.
|
|
321
|
+
shaka.util.StreamUtils.minImage_=(new Map).set("image/webp",shaka.util.StreamUtils.minWebPImage_).set("image/avif",shaka.util.StreamUtils.minAvifImage_);shaka.abr.SimpleAbrManager=function(){var a=this;this.switch_=null;this.enabled_=!1;this.bandwidthEstimator_=new shaka.abr.EwmaBandwidthEstimator;this.onNetworkInformationChange_=null;navigator.connection&&navigator.connection.addEventListener&&(this.onNetworkInformationChange_=function(){if(a.enabled_&&a.config_.useNetworkInformation){a.bandwidthEstimator_=new shaka.abr.EwmaBandwidthEstimator;a.config_&&a.bandwidthEstimator_.configure(a.config_.advanced);var b=a.chooseVariant();b&&a.switch_(b)}},
|
|
322
|
+
navigator.connection.addEventListener("change",this.onNetworkInformationChange_));this.variants_=[];this.playbackRate_=1;this.startupComplete_=!1;this.resizeObserver_=this.mediaElement_=this.config_=this.lastTimeChosenMs_=null;this.resizeObserverTimer_=new shaka.util.Timer(function(){if(a.config_.restrictToElementSize){var b=a.chooseVariant();b&&a.switch_(b)}})};
|
|
324
323
|
shaka.abr.SimpleAbrManager.prototype.stop=function(){this.switch_=null;this.enabled_=!1;this.variants_=[];this.playbackRate_=1;this.mediaElement_=this.lastTimeChosenMs_=null;this.resizeObserver_&&(this.resizeObserver_.disconnect(),this.resizeObserver_=null);this.resizeObserverTimer_.stop()};
|
|
325
324
|
shaka.abr.SimpleAbrManager.prototype.release=function(){navigator.connection&&navigator.connection.removeEventListener&&(navigator.connection.removeEventListener("change",this.onNetworkInformationChange_),this.onNetworkInformationChange_=null);this.resizeObserverTimer_=null};shaka.abr.SimpleAbrManager.prototype.init=function(a){this.switch_=a};
|
|
326
|
-
shaka.abr.SimpleAbrManager.prototype.chooseVariant=function(){var a=shaka.abr.SimpleAbrManager,b=Infinity,c=Infinity;this.resizeObserver_&&this.config_.restrictToElementSize&&(c=this.config_.ignoreDevicePixelRatio?1:window.devicePixelRatio,b=this.mediaElement_.
|
|
325
|
+
shaka.abr.SimpleAbrManager.prototype.chooseVariant=function(){var a=shaka.abr.SimpleAbrManager,b=Infinity,c=Infinity;this.resizeObserver_&&this.config_.restrictToElementSize&&(c=this.config_.ignoreDevicePixelRatio?1:window.devicePixelRatio,b=this.mediaElement_.clientHeight*c,c*=this.mediaElement_.clientWidth);b=a.filterAndSortVariants_(this.config_.restrictions,this.variants_,b,c);c=this.getDefaultBandwidth_();c=this.bandwidthEstimator_.getBandwidthEstimate(c);this.variants_.length&&!b.length&&(shaka.log.warning("No variants met the ABR restrictions. Choosing a variant by lowest bandwidth."),
|
|
327
326
|
b=a.filterAndSortVariants_(null,this.variants_,Infinity,Infinity),b=[b[0]]);a=b[0]||null;for(var d=0;d<b.length;d++){for(var e=b[d],f=isNaN(this.playbackRate_)?1:Math.abs(this.playbackRate_),g=f*e.bandwidth,h=g/this.config_.bandwidthDowngradeTarget,k={bandwidth:Infinity},l=d+1;l<b.length;l++)if(e.bandwidth!=b[l].bandwidth){k=b[l];break}f=f*k.bandwidth/this.config_.bandwidthUpgradeTarget;shaka.log.v2("Bandwidth ranges:",(g/1E6).toFixed(3),(h/1E6).toFixed(3),(f/1E6).toFixed(3));c>=h&&c<=f&&a.bandwidth!=
|
|
328
327
|
e.bandwidth&&(a=e)}this.lastTimeChosenMs_=Date.now();return a};shaka.abr.SimpleAbrManager.prototype.enable=function(){this.enabled_=!0};shaka.abr.SimpleAbrManager.prototype.disable=function(){this.enabled_=!1};
|
|
329
328
|
shaka.abr.SimpleAbrManager.prototype.segmentDownloaded=function(a,b){shaka.log.v2("Segment downloaded:","deltaTimeMs="+a,"numBytes="+b,"lastTimeChosenMs="+this.lastTimeChosenMs_,"enabled="+this.enabled_);goog.asserts.assert(0<=a,"expected a non-negative duration");this.bandwidthEstimator_.sample(a,b);null!=this.lastTimeChosenMs_&&this.enabled_&&this.suggestStreams_()};shaka.abr.SimpleAbrManager.prototype.getBandwidthEstimate=function(){var a=this.getDefaultBandwidth_();return this.bandwidthEstimator_.getBandwidthEstimate(a)};
|
|
@@ -993,9 +992,8 @@ c.loadEventManager_.listen(d,"playing",f);c.loadEventManager_.listen(d,"pause",f
|
|
|
993
992
|
c.currentAdaptationSetCriteria_=new shaka.media.PreferenceBasedCriteria(c.config_.preferredAudioLanguage,c.config_.preferredVariantRole,c.config_.preferredAudioChannelCount);c.currentTextLanguage_=c.config_.preferredTextLanguage;c.currentTextRole_=c.config_.preferredTextRole;c.currentTextForced_=c.config_.preferForcedSubs;shaka.Player.applyPlayRange_(c.manifest_.presentationTimeline,c.config_.playRangeStart,c.config_.playRangeEnd);c.abrManager_.init(function(u,x,w){return c.switch_(u,x,w)});c.abrManager_.setMediaElement(d);
|
|
994
993
|
c.playhead_=c.createPlayhead(a.startTime);c.playheadObservers_=c.createPlayheadObserversForMSE_(a.startTimeOfLoad);k=Math.max(c.manifest_.minBufferTime,c.config_.streaming.rebufferingGoal);c.startBufferManagement_(k);shaka.util.StreamUtils.chooseCodecsAndFilterManifest(c.manifest_,c.config_.preferredVideoCodecs,c.config_.preferredAudioCodecs,c.config_.preferredAudioChannelCount,c.config_.preferredDecodingAttributes);c.streamingEngine_=c.createStreamingEngine();c.streamingEngine_.configure(c.config_.streaming);
|
|
995
994
|
c.loadMode_=shaka.Player.LoadMode.MEDIA_SOURCE;d.textTracks&&c.loadEventManager_.listen(d.textTracks,"addtrack",function(u){if(u.track)switch(u=u.track,goog.asserts.assert(u instanceof TextTrack,"Wrong track type!"),u.kind){case "chapters":c.activateChaptersTrack_(u)}});c.dispatchEvent(c.makeEvent_(shaka.util.FakeEvent.EventName.Streaming));l=null;if(m=c.getVariantTracks().find(function(u){return u.active})){t.jumpTo(2);break}l=c.chooseVariant_();goog.asserts.assert(l,"Must choose an initial variant!");
|
|
996
|
-
c.switchVariant_(l,!0,!1,0);if(!c.config_.streaming.startAtSegmentBoundary){t.jumpTo(
|
|
997
|
-
|
|
998
|
-
c.stats_.setLoadLatency(u)}),t.jumpToEnd()}})};
|
|
995
|
+
c.switchVariant_(l,!0,!1,0);if(!c.config_.streaming.startAtSegmentBoundary){t.jumpTo(2);break}n=c.playhead_.getTime();return t.yield(c.adjustStartTime_(l,n),4);case 4:p=t.yieldResult,c.playhead_.setStartTime(p);case 2:return c.playhead_.ready(),q=c.getTextTracks().find(function(u){return u.active}),q||((r=c.chooseTextStream_())&&c.addTextStreamToSwitchHistory_(r,!0),l&&c.setInitialTextState_(l,r),r&&c.shouldStreamText_()&&c.streamingEngine_.switchTextStream(r)),t.yield(c.streamingEngine_.start(),
|
|
996
|
+
5);case 5:c.config_.abr.enabled&&(c.abrManager_.enable(),c.onAbrStatusChanged_()),c.filterManifestByCurrentVariant_(),c.onTracksChanged_(),c.updateAbrManagerVariants_(),v=c.manifest_.variants.some(function(u){return u.primary}),c.config_.preferredAudioLanguage||v||shaka.log.warning("No preferred audio language set. We have chosen an arbitrary language initially"),c.loadEventManager_.listenOnce(d,"loadedmetadata",function(){var u=Date.now()/1E3-b.startTimeOfLoad;c.stats_.setLoadLatency(u)}),t.jumpToEnd()}})};
|
|
999
997
|
shaka.Player.prototype.onInitializeSrcEqualsDrm_=function(a,b){var c=this,d,e,f,g,h,k,l;return $jscomp.asyncExecutePromiseGeneratorProgram(function(m){return 1==m.nextAddress?(d=shaka.util.ManifestParserUtils.ContentType,goog.asserts.assert(c.networkingEngine_,"|onInitializeSrcEqualsDrm_| should never be called after |destroy|"),goog.asserts.assert(c.config_,"|onInitializeSrcEqualsDrm_| should never be called after |destroy|"),e=Date.now()/1E3,f=!0,c.drmEngine_=c.createDrmEngine({netEngine:c.networkingEngine_,
|
|
1000
998
|
onError:function(n){c.onError_(n)},onKeyStatus:function(n){c.onKeyStatus_(n)},onExpirationUpdated:function(n,p){c.onExpirationUpdated_(n,p)},onEvent:function(n){c.dispatchEvent(n);n.type==shaka.util.FakeEvent.EventName.DrmSessionUpdate&&f&&(f=!1,n=Date.now()/1E3-e,c.stats_.setDrmTime(n))}}),c.drmEngine_.configure(c.config_.drm),g=b.uri||"",h=shaka.media.ManifestParser.getExtension(g),k=shaka.Player.SRC_EQUAL_EXTENSIONS_TO_MIME_TYPES_[h],"application/x-mpegurl"==k&&shaka.util.Platform.isApple()&&(k=
|
|
1001
999
|
"application/vnd.apple.mpegurl"),k||(k="video/mp4"),l={id:0,language:"und",disabledUntilTime:0,primary:!1,audio:null,video:{id:0,originalId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:b.mimeType?shaka.util.MimeUtils.getBasicType(b.mimeType):k,codecs:b.mimeType?shaka.util.MimeUtils.getCodecs(b.mimeType):"",encrypted:!0,drmInfos:[],keyIds:new Set,language:"und",label:null,type:d.VIDEO,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,
|
|
@@ -1153,7 +1151,7 @@ goog.exportProperty(shaka.Player.prototype,"goToLive",shaka.Player.prototype.goT
|
|
|
1153
1151
|
goog.exportProperty(shaka.Player.prototype,"getAdManager",shaka.Player.prototype.getAdManager);goog.exportProperty(shaka.Player.prototype,"getAssetUri",shaka.Player.prototype.getAssetUri);goog.exportProperty(shaka.Player.prototype,"getNetworkingEngine",shaka.Player.prototype.getNetworkingEngine);goog.exportProperty(shaka.Player.prototype,"getMediaElement",shaka.Player.prototype.getMediaElement);goog.exportProperty(shaka.Player.prototype,"getLoadMode",shaka.Player.prototype.getLoadMode);
|
|
1154
1152
|
goog.exportProperty(shaka.Player.prototype,"resetConfiguration",shaka.Player.prototype.resetConfiguration);goog.exportProperty(shaka.Player.prototype,"getBufferFullness",shaka.Player.prototype.getBufferFullness);goog.exportProperty(shaka.Player.prototype,"getConfiguration",shaka.Player.prototype.getConfiguration);goog.exportProperty(shaka.Player.prototype,"configure",shaka.Player.prototype.configure);goog.exportProperty(shaka.Player.prototype,"load",shaka.Player.prototype.load);
|
|
1155
1153
|
goog.exportProperty(shaka.Player.prototype,"updateStartTime",shaka.Player.prototype.updateStartTime);goog.exportProperty(shaka.Player.prototype,"unload",shaka.Player.prototype.unload);goog.exportProperty(shaka.Player.prototype,"detach",shaka.Player.prototype.detach);goog.exportProperty(shaka.Player.prototype,"attach",shaka.Player.prototype.attach);goog.exportProperty(shaka.Player,"probeSupport",shaka.Player.probeSupport);goog.exportProperty(shaka.Player,"isBrowserSupported",shaka.Player.isBrowserSupported);
|
|
1156
|
-
goog.exportProperty(shaka.Player,"setAdManagerFactory",shaka.Player.setAdManagerFactory);goog.exportProperty(shaka.Player,"registerSupportPlugin",shaka.Player.registerSupportPlugin);goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.2.
|
|
1154
|
+
goog.exportProperty(shaka.Player,"setAdManagerFactory",shaka.Player.setAdManagerFactory);goog.exportProperty(shaka.Player,"registerSupportPlugin",shaka.Player.registerSupportPlugin);goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.2.13-debug";
|
|
1157
1155
|
goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.restrictedStatuses_=["output-restricted","internal-error"];shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;
|
|
1158
1156
|
shaka.Player.SRC_EQUAL_EXTENSIONS_TO_MIME_TYPES_={mp4:"video/mp4",m4v:"video/mp4",m4a:"audio/mp4",webm:"video/webm",weba:"audio/webm",mkv:"video/webm",ts:"video/mp2t",ogv:"video/ogg",ogg:"audio/ogg",mpg:"video/mpeg",mpeg:"video/mpeg",m3u8:"application/x-mpegurl",mpd:"application/dash+xml",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav"};
|
|
1159
1157
|
shaka.Player.TEXT_EXTENSIONS_TO_MIME_TYPES_={sbv:"text/x-subviewer",srt:"text/srt",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml",lrc:"application/x-subtitle-lrc",ssa:"text/x-ssa",ass:"text/x-ssa"};shaka.Player.TextTrackLabel="Shaka Player TextTrack";shaka.ads={};shaka.ads.AdsStats=function(){this.loadTimes_=[];this.skipped_=this.playedCompletely_=this.started_=0};shaka.ads.AdsStats.prototype.addLoadTime=function(a){this.loadTimes_.push(a)};shaka.ads.AdsStats.prototype.incrementStarted=function(){this.started_++};shaka.ads.AdsStats.prototype.incrementPlayedCompletely=function(){this.playedCompletely_++};shaka.ads.AdsStats.prototype.incrementSkipped=function(){this.skipped_++};
|
|
@@ -1849,7 +1847,8 @@ shaka.polyfill.MediaSource.stubAbort_()):shaka.util.Platform.isEdge()?(shaka.log
|
|
|
1849
1847
|
shaka.polyfill.MediaSource.patchRemovalRange_=function(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}};shaka.polyfill.MediaSource.rejectContainer_=function(a){var b=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(c){return shaka.util.MimeUtils.getContainerType(c)!=a&&b(c)}};
|
|
1850
1848
|
shaka.polyfill.MediaSource.rejectCodec_=function(a){var b=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(c){return shaka.util.MimeUtils.getCodecBase(c)!=a&&b(c)}};shaka.polyfill.MediaSource.patchCastIsTypeSupported_=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){var c=b.split(/ *; */);c.shift();return c.some(function(d){return d.startsWith("codecs=")})?cast.__platform__.canDisplayType(b):a(b)}};
|
|
1851
1849
|
shaka.polyfill.MediaSource.patchVp09_=function(){var a=MediaSource.isTypeSupported;shaka.util.Platform.isWebOS()||(MediaSource.isTypeSupported=function(b){var c=b.split(/ *; */),d=c.findIndex(function(g){return g.startsWith("codecs=")});if(0>d)return a(b);var e=c[d].replace("codecs=","").replace(/"/g,"").split(/\s*,\s*/),f=e.findIndex(function(g){return g.startsWith("vp09")});0<=f&&(e[f]="vp9",c[d]='codecs="'+e.join(",")+'"',b=c.join("; "));return a(b)})};
|
|
1852
|
-
goog.exportProperty(shaka.polyfill,"MediaSource",shaka.polyfill.MediaSource);goog.exportProperty(shaka.polyfill.MediaSource,"install",shaka.polyfill.MediaSource.install);shaka.polyfill.register(shaka.polyfill.MediaSource.install);shaka.polyfill.Orientation=function(){};shaka.polyfill.Orientation.install=function(){screen.orientation
|
|
1850
|
+
goog.exportProperty(shaka.polyfill,"MediaSource",shaka.polyfill.MediaSource);goog.exportProperty(shaka.polyfill.MediaSource,"install",shaka.polyfill.MediaSource.install);shaka.polyfill.register(shaka.polyfill.MediaSource.install);shaka.polyfill.Orientation=function(){};shaka.polyfill.Orientation.install=function(){screen.orientation&&screen.orientation.unlock?shaka.log.info("Using native screen.orientation"):void 0!=screen.orientation?shaka.polyfill.Orientation.installBasedOnScreenMethods_():void 0!=window.orientation&&shaka.polyfill.Orientation.installBasedOnWindowMethods_()};
|
|
1851
|
+
shaka.polyfill.Orientation.installBasedOnScreenMethods_=function(){void 0===screen.orientation.lock&&(screen.orientation.lock=function(a){shaka.log.info("screen.orientation.lock is a no-op");return Promise.resolve()});void 0===screen.orientation.unlock&&(screen.orientation.unlock=function(){shaka.log.info("screen.orientation.unlock is a no-op")})};
|
|
1853
1852
|
shaka.polyfill.Orientation.installBasedOnWindowMethods_=function(){var a=new shaka.polyfill.Orientation.FakeOrientation;screen.orientation=a;var b=function(){switch(window.orientation){case -90:a.type="landscape-secondary";a.angle=270;break;case 0:a.type="portrait-primary";a.angle=0;break;case 90:a.type="landscape-primary";a.angle=90;break;case 180:a.type="portrait-secondary",a.angle=180}};b();window.addEventListener("orientationchange",function(){b();a.dispatchChangeEvent()})};
|
|
1854
1853
|
goog.exportProperty(shaka.polyfill,"Orientation",shaka.polyfill.Orientation);goog.exportProperty(shaka.polyfill.Orientation,"install",shaka.polyfill.Orientation.install);shaka.polyfill.Orientation.FakeOrientation=function(){shaka.util.FakeEventTarget.call(this);this.type="";this.angle=0};$jscomp.inherits(shaka.polyfill.Orientation.FakeOrientation,shaka.util.FakeEventTarget);
|
|
1855
1854
|
shaka.polyfill.Orientation.FakeOrientation.prototype.dispatchChangeEvent=function(){var a=new shaka.util.FakeEvent("change");this.dispatchEvent(a)};
|
|
@@ -1994,7 +1993,7 @@ shaka.text.VttTextParser.replaceVoiceStylePayload_=function(a){for(var b=[],c=-1
|
|
|
1994
1993
|
a.next();!b.done;b=a.next())b=b.value,c=b.replace(" ",".voice-"),d=d.replace("<"+b+">","<"+c+">"),d=d.replace("</"+b+">","</"+c+">"),e||(d+="</"+c+">");return d};
|
|
1995
1994
|
shaka.text.VttTextParser.replaceKaraokeStylePayload_=function(a){for(var b=[],c=-1,d=0;d<a.length;d++)"<"===a[d]?c=d+1:">"===a[d]&&0<c&&(c=a.substr(c,d-c),c.match(shaka.text.VttTextParser.timeFormat_)&&b.push(c),c=-1);b=$jscomp.makeIterator(b);for(d=b.next();!d.done;d=b.next())d=d.value,a=a.replace("<"+d+">",'<div time="'+d+'">'),a+="</div>";return a};
|
|
1996
1995
|
shaka.text.VttTextParser.replaceColorPayload_=function(a){for(var b=[],c=-1,d="",e=0;e<a.length;e++)if("/"===a[e]&&0<e&&"<"===a[e-1]){var f=a.indexOf(">",e);if(f<=e)return a;if((f=a.substring(e+1,f))&&"c"===f){var g=b.pop();g?g===f?(d+="/"+f+">",e+=f.length+1):g.startsWith("c.")?(e+=f.length+1,d+="/"+g+">"):d+=a[e]:d+=a[e]}else d+=a[e]}else"<"===a[e]?(c=e+1,"c"!=a[c]&&(c=-1)):">"===a[e]&&0<c&&(b.push(a.substr(c,e-c)),c=-1),d+=a[e];return d};
|
|
1997
|
-
shaka.text.VttTextParser.getOrDefault_=function(a,b){return a&&0<a.length?a:b};shaka.text.VttTextParser.mergeStyle_=function(a,b){if(b){var c=shaka.text.VttTextParser;a.backgroundColor=c.getOrDefault_(b.backgroundColor,a.backgroundColor);a.color=c.getOrDefault_(b.color,a.color);a.fontFamily=c.getOrDefault_(b.fontFamily,a.fontFamily);a.fontSize=c.getOrDefault_(b.fontSize,a.fontSize);a.fontWeight=b.fontWeight;a.fontStyle=b.fontStyle;a.opacity=b.opacity;a.wrapLine=b.wrapLine}};
|
|
1996
|
+
shaka.text.VttTextParser.getOrDefault_=function(a,b){return a&&0<a.length?a:b};shaka.text.VttTextParser.mergeStyle_=function(a,b){if(b){var c=shaka.text.VttTextParser;a.backgroundColor=c.getOrDefault_(b.backgroundColor,a.backgroundColor);a.color=c.getOrDefault_(b.color,a.color);a.fontFamily=c.getOrDefault_(b.fontFamily,a.fontFamily);a.fontSize=c.getOrDefault_(b.fontSize,a.fontSize);a.fontWeight=b.fontWeight;a.fontStyle=b.fontStyle;a.opacity=b.opacity;a.textShadow=b.textShadow;a.wrapLine=b.wrapLine}};
|
|
1998
1997
|
shaka.text.VttTextParser.generateCueFromElement_=function(a,b,c,d){var e=shaka.text.VttTextParser,f=b.clone();if(a.nodeType===Node.ELEMENT_NODE&&a.nodeName){var g=shaka.text.Cue.fontWeight.BOLD,h=shaka.text.Cue.fontStyle.ITALIC,k=shaka.text.Cue.textDecoration.UNDERLINE,l=a.nodeName.split(/(?=[ .])+/g);l=$jscomp.makeIterator(l);for(var m=l.next();!m.done;m=l.next()){var n=m=m.value;if(n.startsWith(".voice-")){var p=n.split("-").pop();n='v[voice="'+p+'"]';d.has(n)||(n="v[voice="+p+"]")}d.has(n)&&e.mergeStyle_(f,
|
|
1999
1998
|
d.get(n));switch(m){case "br":m=b.clone();m.lineBreak=!0;c.push(m);break;case "b":f.fontWeight=g;break;case "i":f.fontStyle=h;break;case "u":f.textDecoration.push(k);break;case "div":if(m=a.getAttribute("time"))if(m=new shaka.util.TextParser(m),m=shaka.text.VttTextParser.parseTime_(m))f.startTime=m}}}if(shaka.util.XmlUtils.isText(a))for(d=a.textContent.split("\n"),a=!0,d=$jscomp.makeIterator(d),g=d.next();!g.done;g=d.next())g=g.value,a||(a=b.clone(),a.lineBreak=!0,c.push(a)),0<g.length&&(a=f.clone(),
|
|
2000
1999
|
a.payload=e.htmlUnescape_(g),c.push(a)),a=!1;else for(b=$jscomp.makeIterator(a.childNodes),a=b.next();!a.done;a=b.next())e.generateCueFromElement_(a.value,f,c,d)};
|