shaka-player 4.6.1 → 4.6.2
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/CHANGELOG.md +12 -0
- package/demo/config.js +5 -0
- package/dist/demo.compiled.debug.js +26 -25
- package/dist/demo.compiled.debug.map +2 -2
- package/dist/demo.compiled.js +26 -25
- package/dist/demo.compiled.map +2 -2
- package/dist/locales.js +32 -32
- package/dist/shaka-player.compiled.d.ts +1 -0
- package/dist/shaka-player.compiled.debug.d.ts +1 -0
- package/dist/shaka-player.compiled.debug.externs.js +1 -0
- package/dist/shaka-player.compiled.debug.js +24 -23
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.externs.js +1 -0
- package/dist/shaka-player.compiled.js +694 -694
- package/dist/shaka-player.compiled.map +2 -2
- package/dist/shaka-player.ui.d.ts +1 -0
- package/dist/shaka-player.ui.debug.d.ts +1 -0
- package/dist/shaka-player.ui.debug.externs.js +1 -0
- package/dist/shaka-player.ui.debug.js +29 -27
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.externs.js +1 -0
- package/dist/shaka-player.ui.js +794 -794
- package/dist/shaka-player.ui.map +2 -2
- package/docs/tutorials/lcevc.md +2 -2
- package/lib/cea/cea608_memory.js +13 -2
- package/lib/media/segment_reference.js +2 -1
- package/lib/media/streaming_engine.js +1 -1
- package/lib/player.js +1 -1
- package/lib/transmuxer/ts_transmuxer.js +15 -0
- package/lib/util/error.js +6 -0
- package/package.json +2 -2
- package/test/cea/cea608_memory_unit.js +8 -8
- package/test/cea/cea_decoder_unit.js +11 -11
- package/test/demo/demo_unit.js +0 -3
- package/ui/presentation_time.js +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.6.2](https://github.com/shaka-project/shaka-player/compare/v4.6.1...v4.6.2) (2023-11-27)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **CEA:** Fix positioning in CEA-608 ([#5925](https://github.com/shaka-project/shaka-player/issues/5925)) ([bc2f542](https://github.com/shaka-project/shaka-player/commit/bc2f542e3adf36f0e828c95e20fec9043fe50cc2))
|
|
9
|
+
* **Demo:** Allow configure some missing configs ([#5918](https://github.com/shaka-project/shaka-player/issues/5918)) ([8144dd3](https://github.com/shaka-project/shaka-player/commit/8144dd390928013fe3081732ff4638414e4eafc2))
|
|
10
|
+
* Fix init segment comparison ([#5920](https://github.com/shaka-project/shaka-player/issues/5920)) ([ebd20b6](https://github.com/shaka-project/shaka-player/commit/ebd20b6b3529bd672040f42e3ce8957342faf02e))
|
|
11
|
+
* Fix transmuxer when sample has no video data ([#5933](https://github.com/shaka-project/shaka-player/issues/5933)) ([8070f0f](https://github.com/shaka-project/shaka-player/commit/8070f0fe1d4eb8d893e2f1a52ccbfe6306f0118f))
|
|
12
|
+
* Only append to the buffer init segments when the segment is independent ([#5921](https://github.com/shaka-project/shaka-player/issues/5921)) ([3db2b2d](https://github.com/shaka-project/shaka-player/commit/3db2b2d68331432533119517892198d6927376e0))
|
|
13
|
+
* **UI:** Correctly display video time and duration for VOD ([#5929](https://github.com/shaka-project/shaka-player/issues/5929)) ([d51f18a](https://github.com/shaka-project/shaka-player/commit/d51f18ad9e097b43939c61b979a3399dd2a1bf1f))
|
|
14
|
+
|
|
3
15
|
## [4.6.1](https://github.com/shaka-project/shaka-player/compare/v4.6.0...v4.6.1) (2023-11-22)
|
|
4
16
|
|
|
5
17
|
|
package/demo/config.js
CHANGED
|
@@ -200,6 +200,8 @@ shakaDemo.Config = class {
|
|
|
200
200
|
'manifest.hls.ignoreImageStreamFailures')
|
|
201
201
|
.addTextInput_('Default Audio Codec', 'manifest.hls.defaultAudioCodec')
|
|
202
202
|
.addTextInput_('Default Video Codec', 'manifest.hls.defaultVideoCodec')
|
|
203
|
+
.addTextInput_('Default media playlist full mime type',
|
|
204
|
+
'manifest.hls.mediaPlaylistFullMimeType')
|
|
203
205
|
.addBoolInput_('Ignore Program Date Time from manifest',
|
|
204
206
|
'manifest.hls.ignoreManifestProgramDateTime')
|
|
205
207
|
.addBoolInput_('Use Safari behavior for live',
|
|
@@ -401,6 +403,8 @@ shakaDemo.Config = class {
|
|
|
401
403
|
'streaming.observeQualityChanges')
|
|
402
404
|
.addNumberInput_('Max Variant Disabled Time',
|
|
403
405
|
'streaming.maxDisabledTime')
|
|
406
|
+
.addBoolInput_('Parse PRFT box',
|
|
407
|
+
'streaming.parsePrftBox')
|
|
404
408
|
.addNumberInput_('Segment Prefetch Limit',
|
|
405
409
|
'streaming.segmentPrefetchLimit')
|
|
406
410
|
.addBoolInput_('Live Sync', 'streaming.liveSync')
|
|
@@ -510,6 +514,7 @@ shakaDemo.Config = class {
|
|
|
510
514
|
this.addSection_('Language', docLink)
|
|
511
515
|
.addTextInput_('Preferred Audio Language', 'preferredAudioLanguage')
|
|
512
516
|
.addTextInput_('Preferred Audio Label', 'preferredAudioLabel')
|
|
517
|
+
.addTextInput_('Preferred Variant Role', 'preferredVariantRole')
|
|
513
518
|
.addTextInput_('Preferred Text Language', 'preferredTextLanguage')
|
|
514
519
|
.addTextInput_('Preferred Text Role', 'preferredTextRole')
|
|
515
520
|
.addSelectInput_('Auto-Show Text',
|
|
@@ -213,31 +213,32 @@ this.reload_();for(let b=0;b<a.length;b++){const c=this.sections_[b];a[b]&&c.ope
|
|
|
213
213
|
"drm.minHdcpVersion").addBoolInput_("Ignore duplicate init data","drm.ignoreDuplicateInitData");const b=shakaDemoMain.getConfiguration().drm.advanced||{};a=(d,e,f)=>{this.addDatalistInput_(d,f,g=>{for(const h of shakaDemo.Main.commonDrmSystems)h in b||(b[h]=shakaDemo.Main.defaultAdvancedDrmConfig());for(const h in b)b[h][e]=g.value;shakaDemoMain.configure("drm.advanced",b);shakaDemoMain.remakeHash()});if(d=Object.keys(b)[0])d=b[d][e],this.latestInput_.input().value=d};const c="SW_SECURE_CRYPTO SW_SECURE_DECODE HW_SECURE_CRYPTO HW_SECURE_DECODE HW_SECURE_ALL 150 2000 3000".split(" ");
|
|
214
214
|
a("Video Robustness","videoRobustness",c);a("Audio Robustness","audioRobustness",c);a("Session Type","sessionType",["temporary","persistent-license"]);this.addRetrySection_("drm","DRM Retry Parameters")}addManifestSection_(){const a=this.resolveExternLink_(".ManifestConfiguration");this.addSection_("Manifest",a).addBoolInput_("Ignore DASH DRM Info","manifest.dash.ignoreDrmInfo").addBoolInput_("Auto-Correct DASH Drift","manifest.dash.autoCorrectDrift").addBoolInput_("Disable Xlink processing","manifest.dash.disableXlinkProcessing").addBoolInput_("Xlink Should Fail Gracefully",
|
|
215
215
|
"manifest.dash.xlinkFailGracefully").addBoolInput_("Ignore DASH suggestedPresentationDelay","manifest.dash.ignoreSuggestedPresentationDelay").addBoolInput_("Ignore empty DASH AdaptationSets","manifest.dash.ignoreEmptyAdaptationSet").addBoolInput_("Ignore DASH maxSegmentDuration","manifest.dash.ignoreMaxSegmentDuration").addBoolInput_("Ignore HLS Text Stream Failures","manifest.hls.ignoreTextStreamFailures").addBoolInput_("Ignore HLS Image Stream Failures","manifest.hls.ignoreImageStreamFailures").addTextInput_("Default Audio Codec",
|
|
216
|
-
"manifest.hls.defaultAudioCodec").addTextInput_("Default Video Codec","manifest.hls.defaultVideoCodec").addBoolInput_("Ignore Program Date Time from manifest","manifest.hls.ignoreManifestProgramDateTime").addBoolInput_("Use Safari behavior for live","manifest.hls.useSafariBehaviorForLive").addNumberInput_("Live segments delay","manifest.hls.liveSegmentsDelay").addBoolInput_("Enable HLS sequence mode","manifest.hls.sequenceMode").addBoolInput_("Ignore Manifest Timestamps in Segments Mode",
|
|
217
|
-
"manifest.hls.disableCodecGuessing").addBoolInput_("Allow LL-HLS byterange optimization","manifest.hls.allowLowLatencyByteRangeOptimization").addNumberInput_("Availability Window Override","manifest.availabilityWindowOverride",!0,!1,!0).addTextInput_("Clock Sync URI","manifest.dash.clockSyncUri").addNumberInput_("Default Presentation Delay","manifest.defaultPresentationDelay").addBoolInput_("Enable Audio Groups",
|
|
218
|
-
"manifest.dash.initialSegmentLimit",!1,!1,!0).addBoolInput_("Enable DASH sequence mode","manifest.dash.sequenceMode").addBoolInput_("Disable Audio","manifest.disableAudio").addBoolInput_("Disable Video","manifest.disableVideo").addBoolInput_("Disable Text","manifest.disableText").addBoolInput_("Disable Thumbnails","manifest.disableThumbnails").addBoolInput_("Enable segment-relative VTT Timing",
|
|
219
|
-
this.addRetrySection_("manifest","Manifest Retry Parameters")}addAbrSection_(){const a=this.resolveExternLink_(".AbrConfiguration");this.addSection_("Adaptation",a).addBoolInput_("Enabled","abr.enabled").addBoolInput_("Use Network Information API","abr.useNetworkInformation").addNumberInput_("Default Bandwidth EstimatZ","abr.defaultBandwidthEstimate").addNumberInput_("Bandwidth Downgrade Target",
|
|
220
|
-
|
|
221
|
-
"abr.clearBufferSwitch").addNumberInput_("Safe margin on abr switch rendition","abr.safeMarginSwitch",!0);this.addRetrictionsSection_("abr","Adaptation Restrictions")}addCmcdSection_(){const a=this.resolveExternLink_(".CmcdConfiguration");this.addSection_("CMCD",a).addBoolInput_("Enabled","cmcd.enabled").addTextInput_("Session ID","cmcd.sessionId").addTextInput_("Content ID",
|
|
222
|
-
this.addSection_("MPEG-5 Part-2 LCEVC",a).addBoolInput_("Enabled","lcevc.enabled").addBoolInput_("LCEVC Dynamic Performance scaling","lcevc.dynamicPerformanceScaling").addNumberInput_("LCEVC Log Level","lcevc.logLevel").addBoolInput_("Draw LCEVC Logo","lcevc.drawLogo")}addAdsSection_(){const a=this.resolveExternLink_(".AdsConfiguration");this.addSection_("Ads",
|
|
223
|
-
this.resolveExternLink_(".Restrictions");this.addSection_(b,c).addNumberInput_("Min Width",a+"minWidth").addNumberInput_("Max Width",a+"maxWidth").addNumberInput_("Min Height",a+"minHeight").addNumberInput_("Max Height",a+"maxHeight").addNumberInput_("Min Pixels",a+"minPixels").addNumberInput_("Max Pixels",a+"maxPixels").addNumberInput_("Min Framerate",a+"minFrameRate").addNumberInput_("Max Framerate",
|
|
224
|
-
a+"maxBandwidth")}addRetrySection_(a,b){a+=".retryParameters.";const c=this.resolveExternLink_(".RetryParameters");this.addSection_(b,c).addNumberInput_("Max Attempts",a+"maxAttempts").addNumberInput_("Base Delay",a+"baseDelay",!0).addNumberInput_("Backoff Factor",a+"backoffFactor",!0).addNumberInput_("Fuzz Factor",a+"fuzzFactor",!0).addNumberInput_("Timeout Factor",a+"timeout",!0).addNumberInput_("Stall Timeout",
|
|
225
|
-
this.resolveExternLink_(".OfflineConfiguration");this.addSection_("Offline",a).addBoolInput_("Use Persistent Licenses","offline.usePersistentLicense").addNumberInput_("Number of Parallel Downloads","offline.numberOfParallelDownloads")}addStreamingSection_(){const a=this.resolveExternLink_(".StreamingConfiguration");this.addSection_("Streaming",a).addNumberInput_("Gap detection threshold",
|
|
226
|
-
"streaming.bufferingGoal",!0).addNumberInput_("Duration Backoff","streaming.durationBackoff",!0).addNumberInput_("Rebuffering Goal","streaming.rebufferingGoal",!0).addNumberInput_("Buffer Behind","streaming.bufferBehind",!0).addNumberInput_("Safe Seek Offset","streaming.safeSeekOffset",!0).addNumberInput_("Stall Threshold","streaming.stallThreshold",!0).addNumberInput_("Safe Skip Distance",
|
|
227
|
-
|
|
228
|
-
"streaming.
|
|
229
|
-
(this.addCustomBoolInput_("Always Stream Text",b=>{},"Text must always be streamed while native controls are enabled, for captions to work."),this.latestInput_.input().disabled=!0,this.latestInput_.input().checked=!0):this.addBoolInput_("Always Stream Text","streaming.alwaysStreamText");
|
|
230
|
-
"preferredVideoLayout",{"":"","CH-STEREO":"CH-STEREO","CH-MONO":"CH-MONO"},{"CH-STEREO":"Stereoscopic","CH-MONO":"Monoscopic","":"No Preference"});this.addBoolInput_("Start At Segment Boundary","streaming.startAtSegmentBoundary").addBoolInput_("Ignore Text Stream Failures",
|
|
231
|
-
shaka.config.CodecSwitchingStrategy,b=this.resolveExternLink_(".MediaSourceConfiguration");this.addSection_("Media source",b).addTextInput_("Source buffer extra features","mediaSource.sourceBufferExtraFeatures").addBoolInput_("Force Transmux",
|
|
232
|
-
this.resolveExternLink_(".PlayerConfiguration"),b=shaka.config.AutoShowText;this.addSection_("Language",a).addTextInput_("Preferred Audio Language","preferredAudioLanguage").addTextInput_("Preferred Audio Label",
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
(this.latestInput_.input().checked=!0)
|
|
236
|
-
"info"}
|
|
237
|
-
|
|
238
|
-
a,
|
|
239
|
-
|
|
240
|
-
|
|
216
|
+
"manifest.hls.defaultAudioCodec").addTextInput_("Default Video Codec","manifest.hls.defaultVideoCodec").addTextInput_("Default media playlist full mime type","manifest.hls.mediaPlaylistFullMimeType").addBoolInput_("Ignore Program Date Time from manifest","manifest.hls.ignoreManifestProgramDateTime").addBoolInput_("Use Safari behavior for live","manifest.hls.useSafariBehaviorForLive").addNumberInput_("Live segments delay","manifest.hls.liveSegmentsDelay").addBoolInput_("Enable HLS sequence mode","manifest.hls.sequenceMode").addBoolInput_("Ignore Manifest Timestamps in Segments Mode",
|
|
217
|
+
"manifest.hls.ignoreManifestTimestampsInSegmentsMode").addBoolInput_("Disable codec guessing","manifest.hls.disableCodecGuessing").addBoolInput_("Allow LL-HLS byterange optimization","manifest.hls.allowLowLatencyByteRangeOptimization").addNumberInput_("Availability Window Override","manifest.availabilityWindowOverride",!0,!1,!0).addTextInput_("Clock Sync URI","manifest.dash.clockSyncUri").addNumberInput_("Default Presentation Delay","manifest.defaultPresentationDelay").addBoolInput_("Enable Audio Groups",
|
|
218
|
+
"manifest.dash.enableAudioGroups").addBoolInput_("Ignore Min Buffer Time","manifest.dash.ignoreMinBufferTime").addNumberInput_("Initial Segment Limit","manifest.dash.initialSegmentLimit",!1,!1,!0).addBoolInput_("Enable DASH sequence mode","manifest.dash.sequenceMode").addBoolInput_("Disable Audio","manifest.disableAudio").addBoolInput_("Disable Video","manifest.disableVideo").addBoolInput_("Disable Text","manifest.disableText").addBoolInput_("Disable Thumbnails","manifest.disableThumbnails").addBoolInput_("Enable segment-relative VTT Timing",
|
|
219
|
+
"manifest.segmentRelativeVttTiming").addBoolInput_("Enable MSS sequence mode","manifest.mss.sequenceMode");this.addRetrySection_("manifest","Manifest Retry Parameters")}addAbrSection_(){const a=this.resolveExternLink_(".AbrConfiguration");this.addSection_("Adaptation",a).addBoolInput_("Enabled","abr.enabled").addBoolInput_("Use Network Information API","abr.useNetworkInformation").addNumberInput_("Default Bandwidth EstimatZ","abr.defaultBandwidthEstimate").addNumberInput_("Bandwidth Downgrade Target",
|
|
220
|
+
"abr.bandwidthDowngradeTarget",!0).addNumberInput_("Bandwidth Upgrade Target","abr.bandwidthUpgradeTarget",!0).addNumberInput_("Switch Interval","abr.switchInterval",!0).addNumberInput_("Min total Bytes","abr.advanced.minTotalBytes").addNumberInput_("Min Bytes","abr.advanced.minBytes").addNumberInput_("Fast half life","abr.advanced.fastHalfLife",!0).addNumberInput_("Slow half life","abr.advanced.slowHalfLife",!0).addBoolInput_("Restrict to element size","abr.restrictToElementSize").addBoolInput_("Restrict to screen size",
|
|
221
|
+
"abr.restrictToScreenSize").addBoolInput_("Ignore device pixel ratio","abr.ignoreDevicePixelRatio").addBoolInput_("Clear video buffer on abr rendition switch","abr.clearBufferSwitch").addNumberInput_("Safe margin on abr switch rendition","abr.safeMarginSwitch",!0);this.addRetrictionsSection_("abr","Adaptation Restrictions")}addCmcdSection_(){const a=this.resolveExternLink_(".CmcdConfiguration");this.addSection_("CMCD",a).addBoolInput_("Enabled","cmcd.enabled").addTextInput_("Session ID","cmcd.sessionId").addTextInput_("Content ID",
|
|
222
|
+
"cmcd.contentId").addBoolInput_("Use Headers","cmcd.useHeaders")}addLcevcSection_(){const a=this.resolveExternLink_(".LcevcConfiguration");this.addSection_("MPEG-5 Part-2 LCEVC",a).addBoolInput_("Enabled","lcevc.enabled").addBoolInput_("LCEVC Dynamic Performance scaling","lcevc.dynamicPerformanceScaling").addNumberInput_("LCEVC Log Level","lcevc.logLevel").addBoolInput_("Draw LCEVC Logo","lcevc.drawLogo")}addAdsSection_(){const a=this.resolveExternLink_(".AdsConfiguration");this.addSection_("Ads",
|
|
223
|
+
a).addBoolInput_("Custom playhead tracker","ads.customPlayheadTracker")}addRetrictionsSection_(a,b){a=(a?a+".":"")+"restrictions.";const c=this.resolveExternLink_(".Restrictions");this.addSection_(b,c).addNumberInput_("Min Width",a+"minWidth").addNumberInput_("Max Width",a+"maxWidth").addNumberInput_("Min Height",a+"minHeight").addNumberInput_("Max Height",a+"maxHeight").addNumberInput_("Min Pixels",a+"minPixels").addNumberInput_("Max Pixels",a+"maxPixels").addNumberInput_("Min Framerate",a+"minFrameRate").addNumberInput_("Max Framerate",
|
|
224
|
+
a+"maxFrameRate").addNumberInput_("Min Bandwidth",a+"minBandwidth").addNumberInput_("Max Bandwidth",a+"maxBandwidth")}addRetrySection_(a,b){a+=".retryParameters.";const c=this.resolveExternLink_(".RetryParameters");this.addSection_(b,c).addNumberInput_("Max Attempts",a+"maxAttempts").addNumberInput_("Base Delay",a+"baseDelay",!0).addNumberInput_("Backoff Factor",a+"backoffFactor",!0).addNumberInput_("Fuzz Factor",a+"fuzzFactor",!0).addNumberInput_("Timeout Factor",a+"timeout",!0).addNumberInput_("Stall Timeout",
|
|
225
|
+
a+"stallTimeout",!0).addNumberInput_("Connection Timeout",a+"connectionTimeout",!0)}addOfflineSection_(){const a=this.resolveExternLink_(".OfflineConfiguration");this.addSection_("Offline",a).addBoolInput_("Use Persistent Licenses","offline.usePersistentLicense").addNumberInput_("Number of Parallel Downloads","offline.numberOfParallelDownloads")}addStreamingSection_(){const a=this.resolveExternLink_(".StreamingConfiguration");this.addSection_("Streaming",a).addNumberInput_("Gap detection threshold",
|
|
226
|
+
"streaming.gapDetectionThreshold",!0).addNumberInput_("Gap Jump Timer Time","streaming.gapJumpTimerTime",!0).addNumberInput_("Buffering Goal","streaming.bufferingGoal",!0).addNumberInput_("Duration Backoff","streaming.durationBackoff",!0).addNumberInput_("Rebuffering Goal","streaming.rebufferingGoal",!0).addNumberInput_("Buffer Behind","streaming.bufferBehind",!0).addNumberInput_("Safe Seek Offset","streaming.safeSeekOffset",!0).addNumberInput_("Stall Threshold","streaming.stallThreshold",!0).addNumberInput_("Safe Skip Distance",
|
|
227
|
+
"streaming.stallSkip",!0).addNumberInput_("Inaccurate Manifest Tolerance","streaming.inaccurateManifestTolerance",!0).addBoolInput_("Low Latency Mode","streaming.lowLatencyMode").addBoolInput_("Auto Low Latency Mode","streaming.autoLowLatencyMode").addBoolInput_("Force HTTPS","streaming.forceHTTPS").addBoolInput_("Prefer native HLS playback when available","streaming.preferNativeHls").addNumberInput_("Update interval seconds","streaming.updateIntervalSeconds",!0).addBoolInput_("Dispatch all emsg boxes",
|
|
228
|
+
"streaming.dispatchAllEmsgBoxes").addBoolInput_("Observe media quality changes","streaming.observeQualityChanges").addNumberInput_("Max Variant Disabled Time","streaming.maxDisabledTime").addBoolInput_("Parse PRFT box","streaming.parsePrftBox").addNumberInput_("Segment Prefetch Limit","streaming.segmentPrefetchLimit").addBoolInput_("Live Sync","streaming.liveSync").addNumberInput_("Max latency for live sync","streaming.liveSyncMaxLatency",!0,!0).addNumberInput_("Playback rate for live sync","streaming.liveSyncPlaybackRate",
|
|
229
|
+
!0,!1).addNumberInput_("Min latency for live sync","streaming.liveSyncMinLatency",!0,!0).addNumberInput_("Min playback rate for live sync","streaming.liveSyncMinPlaybackRate",!0,!1);shakaDemoMain.getNativeControlsEnabled()?(this.addCustomBoolInput_("Always Stream Text",b=>{},"Text must always be streamed while native controls are enabled, for captions to work."),this.latestInput_.input().disabled=!0,this.latestInput_.input().checked=!0):this.addBoolInput_("Always Stream Text","streaming.alwaysStreamText");
|
|
230
|
+
this.addSelectInput_("Preferred HDR Level","preferredVideoHdrLevel",{"":"",AUTO:"AUTO",SDR:"SDR",PQ:"PQ",HLG:"HLG"},{AUTO:"Auto Detect",SDR:"SDR",PQ:"PQ",HLG:"HLG","":"No Preference"});this.addSelectInput_("Preferred video layout","preferredVideoLayout",{"":"","CH-STEREO":"CH-STEREO","CH-MONO":"CH-MONO"},{"CH-STEREO":"Stereoscopic","CH-MONO":"Monoscopic","":"No Preference"});this.addBoolInput_("Start At Segment Boundary","streaming.startAtSegmentBoundary").addBoolInput_("Ignore Text Stream Failures",
|
|
231
|
+
"streaming.ignoreTextStreamFailures").addBoolInput_("Stall Detector Enabled","streaming.stallEnabled").addBoolInput_("Use native HLS on Safari","streaming.useNativeHlsOnSafari");this.addRetrySection_("streaming","Streaming Retry Parameters")}addMediaSourceSection_(){const a=shaka.config.CodecSwitchingStrategy,b=this.resolveExternLink_(".MediaSourceConfiguration");this.addSection_("Media source",b).addTextInput_("Source buffer extra features","mediaSource.sourceBufferExtraFeatures").addBoolInput_("Force Transmux",
|
|
232
|
+
"mediaSource.forceTransmux").addBoolInput_("Insert fake encryption in init segments when needed by the platform.","mediaSource.insertFakeEncryptionInInit").addSelectInput_("Codec Switching Strategy","mediaSource.codecSwitchingStrategy",a,{RELOAD:"reload",SMOOTH:"smooth"})}addLanguageSection_(){const a=this.resolveExternLink_(".PlayerConfiguration"),b=shaka.config.AutoShowText;this.addSection_("Language",a).addTextInput_("Preferred Audio Language","preferredAudioLanguage").addTextInput_("Preferred Audio Label",
|
|
233
|
+
"preferredAudioLabel").addTextInput_("Preferred Variant Role","preferredVariantRole").addTextInput_("Preferred Text Language","preferredTextLanguage").addTextInput_("Preferred Text Role","preferredTextRole").addSelectInput_("Auto-Show Text","autoShowText",b,{NEVER:"Never",ALWAYS:"Always",IF_PREFERRED_TEXT_LANGUAGE:"If preferred text language",IF_SUBTITLES_MAY_BE_NEEDED:"If subtitles may be needed"});this.addCustomTextInput_("Preferred UI Locale",c=>{shakaDemoMain.setUILocale(c.value);shakaDemoMain.remakeHash()});
|
|
234
|
+
this.latestInput_.input().value=shakaDemoMain.getUILocale();this.addNumberInput_("Preferred Audio Channel Count","preferredAudioChannelCount");this.addBoolInput_("Prefer Forced Subs","preferForcedSubs")}addMetaSection_(){this.addSection_(null,null);this.addCustomBoolInput_("Shaka Controls",d=>{shakaDemoMain.setNativeControlsEnabled(!d.checked);d.checked&&(shakaDemoMain.configure("streaming.alwaysStreamText",!0),shakaDemoMain.remakeHash());this.reloadAndSaveState_()});shakaDemoMain.getNativeControlsEnabled()||
|
|
235
|
+
(this.latestInput_.input().checked=!0);shakaDemoMain.getNativeControlsEnabled()?(this.addCustomBoolInput_("Enabled Trick Play Controls",d=>{},"Trick Play controls require the Shaka UI."),this.latestInput_.input().disabled=!0,this.latestInput_.input().checked=!1):(this.addCustomBoolInput_("Enabled Trick Play Controls",d=>{shakaDemoMain.setTrickPlayControlsEnabled(d.checked)}),shakaDemoMain.getTrickPlayControlsEnabled()&&(this.latestInput_.input().checked=!0));if(shaka.log){var a=shaka.log.Level,b=
|
|
236
|
+
shaka.log.setLevel;this.addCustomSelectInput_("Log Level",{info:"Info",debug:"Debug",v:"Verbose",vv:"Very Verbose"},d=>{switch(d.value){case "info":b(a.INFO);break;case "debug":b(a.DEBUG);break;case "vv":b(a.V2);break;case "v":b(a.V1)}shakaDemoMain.remakeHash()});var c=this.latestInput_.input();switch(shaka.log.currentLevel){case a.DEBUG:c.value="debug";break;case a.V2:c.value="vv";break;case a.V1:c.value="v";break;default:c.value="info"}}}resolveExternLink_(a){return"../docs/api/shaka.extern.html#"+
|
|
237
|
+
a}addSection_(a,b){this.sections_.push(new shakaDemo.InputContainer(this.container_,a,a?shakaDemo.InputContainer.Style.ACCORDION:shakaDemo.InputContainer.Style.VERTICAL,b));return this}addBoolInput_(a,b,c){this.addCustomBoolInput_(a,d=>{shakaDemoMain.configure(b,d.checked);shakaDemoMain.remakeHash()},c);shakaDemoMain.getCurrentConfigValue(b)&&(this.latestInput_.input().checked=!0);return this}addCustomBoolInput_(a,b,c){this.createRow_(a,c);this.latestInput_=new shakaDemo.BoolInput(this.getLatestSection_(),
|
|
238
|
+
a,b);return this}addTextInput_(a,b,c){this.addCustomTextInput_(a,d=>{shakaDemoMain.configure(b,d.value);shakaDemoMain.remakeHash()},c);this.latestInput_.input().value=shakaDemoMain.getCurrentConfigValue(b);return this}addCustomTextInput_(a,b,c){this.createRow_(a,c);this.latestInput_=new shakaDemo.TextInput(this.getLatestSection_(),a,b);return this}addNumberInput_(a,b,c=!1,d=!0,e=!1,f){this.createRow_(a,f);this.latestInput_=new shakaDemo.NumberInput(this.getLatestSection_(),a,g=>{shakaDemoMain.resetConfiguration(b);
|
|
239
|
+
shakaDemoMain.remakeHash();"Infinity"==g.value?(shakaDemoMain.configure(b,Infinity),shakaDemoMain.remakeHash()):""==g.value&&e||(g=Number(g.value),0==g&&!d||isNaN(g)||Math.floor(g)!=g&&!c||(shakaDemoMain.configure(b,g),shakaDemoMain.remakeHash()))},c,d,e);this.latestInput_.input().value=shakaDemoMain.getCurrentConfigValue(b);isNaN(Number(this.latestInput_.input().value))&&e&&(this.latestInput_.input().value="");return this}addDatalistInput_(a,b,c,d){this.createRow_(a,d);this.latestInput_=new shakaDemo.DatalistInput(this.getLatestSection_(),
|
|
240
|
+
a,c,b);return this}addCustomSelectInput_(a,b,c,d){this.createRow_(a,d);this.latestInput_=new shakaDemo.SelectInput(this.getLatestSection_(),null,c,b);return this}addSelectInput_(a,b,c,d,e){for(const f in c)f in d||(d[f]=f);this.addCustomSelectInput_(a,d,f=>{shakaDemoMain.configure(b,c[f.value]);shakaDemoMain.remakeHash()},e);a=shakaDemoMain.getCurrentConfigValue(b);for(const f in c)c[f]==a&&(this.latestInput_.input().value=f);return this}createRow_(a,b){this.getLatestSection_().addRow(a,b||null)}getLatestSection_(){goog.asserts.assert(0<
|
|
241
|
+
this.sections_.length,"Must have at least one section.");return this.sections_[this.sections_.length-1]}};document.addEventListener("shaka-main-loaded",shakaDemo.Config.init);document.addEventListener("shaka-main-cleanup",()=>{shakaDemoConfig=null});let shakaDemoCustom;
|
|
241
242
|
shakaDemo.Custom=class{static init(){const a=shakaDemoMain.addNavButton("custom");shakaDemoCustom=new shakaDemo.Custom(a.container)}constructor(a){this.dialog_=document.createElement("dialog");this.dialog_.classList.add("mdl-dialog");a.appendChild(this.dialog_);this.dialog_.showModal||dialogPolyfill.registerDialog(this.dialog_);this.assets_=this.loadAssetInfos_();this.assetCards_=[];this.savedList_=document.createElement("div");a.appendChild(this.savedList_);const b=document.createElement("div");b.classList.add("add-button-container");
|
|
242
243
|
a.appendChild(b);const c=this.makeButton_("add",shakaDemo.Custom.ButtonStyle_.FAB,()=>{this.showAssetDialog_(ShakaDemoAssetInfo.makeBlankAsset())});b.appendChild(c);document.addEventListener("shaka-main-selected-asset-changed",()=>{this.updateSelected_()});document.addEventListener("shaka-main-offline-progress",()=>{this.updateOfflineProgress_()});document.addEventListener("shaka-main-page-changed",()=>{this.savedList_.childNodes.length||a.classList.contains("hidden")||this.remakeSavedList_()})}assets(){return Array.from(this.assets_)}updateOfflineProgress_(){for(const a of this.assetCards_)a.updateProgress()}makeField_(a,
|
|
243
244
|
b,c,d,e){a.addRow(null,null);a=new shakaDemo.TextInput(a,b,d,e);a.extra().textContent=b;c(a.input(),a.container())}makeAssetDialogContentsHeaders_(a,b){const c=document.createElement("div"),d=[],e=(f,g)=>{const h=document.createElement("div");c.appendChild(h);const l=new shakaDemo.InputContainer(h,"License Header",shakaDemo.InputContainer.Style.VERTICAL,null),p={headerName:f,div:h};d.push(p);let k=!f;const m=(n,q)=>{f&&a.licenseRequestHeaders.delete(f);f=n;p.headerName=n;g=q;if(f&&g){k&&(k=!1,e(null,
|