shaka-player 4.4.3 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/release-please.yaml +2 -27
- package/CHANGELOG.md +64 -45
- package/README.md +16 -10
- package/demo/asset_card.js +18 -21
- package/demo/cast_receiver/index.html +0 -1
- package/demo/close_button.js +0 -3
- package/demo/common/asset.js +22 -5
- package/demo/common/assets.js +132 -49
- package/demo/config.js +192 -253
- package/demo/custom.js +39 -98
- package/demo/front.js +7 -10
- package/demo/index.html +19 -22
- package/demo/input.js +6 -11
- package/demo/input_container.js +8 -9
- package/demo/main.js +51 -123
- package/demo/search.js +22 -34
- package/demo/service_worker.js +0 -3
- package/demo/tooltip.js +3 -5
- package/demo/visualizer.js +3 -5
- package/demo/visualizer_button.js +1 -20
- package/dist/demo.compiled.debug.js +152 -178
- package/dist/demo.compiled.debug.map +4 -4
- package/dist/demo.compiled.js +152 -178
- package/dist/demo.compiled.map +4 -4
- package/dist/deps.js +27 -24
- package/dist/locales.js +31 -31
- package/dist/receiver.compiled.debug.js +22 -43
- package/dist/receiver.compiled.debug.map +4 -4
- package/dist/receiver.compiled.js +22 -43
- package/dist/receiver.compiled.map +4 -4
- package/dist/shaka-player.compiled.d.ts +507 -365
- package/dist/shaka-player.compiled.debug.d.ts +507 -365
- package/dist/shaka-player.compiled.debug.externs.js +205 -51
- package/dist/shaka-player.compiled.debug.js +541 -450
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +205 -51
- package/dist/shaka-player.compiled.js +1120 -1066
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +562 -410
- package/dist/shaka-player.ui.debug.d.ts +562 -410
- package/dist/shaka-player.ui.debug.externs.js +226 -51
- package/dist/shaka-player.ui.debug.js +606 -506
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +226 -51
- package/dist/shaka-player.ui.js +1266 -1207
- package/dist/shaka-player.ui.map +4 -4
- package/docs/design/lcevc-integration.md +14 -14
- package/docs/tutorials/faq.md +27 -55
- package/docs/tutorials/index.json +2 -1
- package/docs/tutorials/lcevc.md +118 -0
- package/docs/tutorials/ui-customization.md +4 -0
- package/externs/css_style_declaration.js +19 -0
- package/externs/lcevc.js +37 -13
- package/externs/media_remote.js +68 -0
- package/externs/mediatailor.js +193 -0
- package/externs/pictureinpicture.js +11 -0
- package/externs/shaka/ads.js +27 -0
- package/externs/shaka/manifest.js +10 -5
- package/externs/shaka/manifest_parser.js +7 -1
- package/externs/shaka/offline.js +4 -0
- package/externs/shaka/player.js +12 -1
- package/karma.conf.js +7 -3
- package/lib/abr/simple_abr_manager.js +43 -3
- package/lib/ads/ad_manager.js +104 -50
- package/lib/ads/media_tailor_ad.js +297 -0
- package/lib/ads/media_tailor_ad_manager.js +828 -0
- package/lib/cea/ts_cea_parser.js +15 -2
- package/lib/config/codec_switching_strategy.js +24 -0
- package/lib/dash/content_protection.js +120 -2
- package/lib/dash/dash_parser.js +75 -12
- package/lib/dash/mpd_utils.js +10 -6
- package/lib/dash/segment_base.js +13 -5
- package/lib/dash/segment_list.js +13 -5
- package/lib/dash/segment_template.js +43 -85
- package/lib/dependencies/all.js +8 -7
- package/lib/hls/hls_parser.js +44 -16
- package/lib/lcevc/lcevc_dec.js +220 -0
- package/lib/media/adaptation_set.js +22 -11
- package/lib/media/adaptation_set_criteria.js +25 -7
- package/lib/media/media_source_engine.js +215 -27
- package/lib/media/segment_index.js +1 -1
- package/lib/media/segment_reference.js +7 -7
- package/lib/media/streaming_engine.js +33 -18
- package/lib/mss/mss_parser.js +1 -0
- package/lib/net/networking_engine.js +1 -0
- package/lib/offline/indexeddb/v1_storage_cell.js +1 -0
- package/lib/offline/indexeddb/v2_storage_cell.js +1 -0
- package/lib/offline/manifest_converter.js +1 -0
- package/lib/offline/storage.js +3 -0
- package/lib/player.js +142 -72
- package/lib/routing/payload.js +5 -1
- package/lib/text/cue.js +15 -0
- package/lib/text/ttml_text_parser.js +17 -0
- package/lib/text/ui_text_displayer.js +4 -0
- package/lib/text/vtt_text_parser.js +33 -20
- package/lib/transmuxer/h265.js +862 -0
- package/lib/transmuxer/mpeg_ts_transmuxer.js +3 -2
- package/lib/transmuxer/ts_transmuxer.js +160 -15
- package/lib/util/error.js +28 -9
- package/lib/util/exp_golomb.js +30 -2
- package/lib/util/fake_event.js +3 -0
- package/lib/util/mp4_generator.js +4 -4
- package/lib/util/periods.js +2 -0
- package/lib/util/platform.js +40 -0
- package/lib/util/player_configuration.js +8 -0
- package/lib/util/state_history.js +6 -2
- package/lib/util/stream_utils.js +133 -217
- package/lib/util/ts_parser.js +226 -40
- package/maintained-branches.md +3 -2
- package/package.json +4 -6
- package/roadmap.md +15 -5
- package/shaka-player.uncompiled.js +2 -1
- package/support.html +0 -1
- package/test/cast/cast_receiver_integration.js +47 -0
- package/test/codec_switching/codec_switching_integration.js +181 -0
- package/test/dash/dash_parser_content_protection_unit.js +2 -0
- package/test/dash/dash_parser_integration.js +73 -0
- package/test/dash/dash_parser_live_unit.js +2 -0
- package/test/dash/dash_parser_manifest_unit.js +42 -0
- package/test/dash/dash_parser_segment_base_unit.js +2 -0
- package/test/dash/dash_parser_segment_list_unit.js +2 -0
- package/test/dash/dash_parser_segment_template_unit.js +2 -0
- package/test/demo/demo_unit.js +0 -16
- package/test/hls/hls_live_unit.js +2 -0
- package/test/hls/hls_parser_unit.js +8 -6
- package/test/media/adaptation_set_criteria_unit.js +118 -0
- package/test/media/adaptation_set_unit.js +1 -0
- package/test/media/media_source_engine_unit.js +165 -1
- package/test/media/segment_index_unit.js +4 -4
- package/test/media/segment_prefetch_unit.js +1 -1
- package/test/media/streaming_engine_unit.js +17 -17
- package/test/mss/mss_parser_unit.js +2 -0
- package/test/offline/manifest_convert_unit.js +5 -0
- package/test/offline/storage_integration.js +1 -4
- package/test/player_unit.js +102 -131
- package/test/routing/walker_unit.js +1 -0
- package/test/test/assets/dash-aes-128/Fragments(video=0,format=mpd-time-csf) +0 -0
- package/test/test/assets/dash-aes-128/Fragments(video=20000000,format=mpd-time-csf) +0 -0
- package/test/test/assets/dash-aes-128/Fragments(video=40000000,format=mpd-time-csf) +0 -0
- package/test/test/assets/dash-aes-128/Fragments(video=60000000,format=mpd-time-csf) +0 -0
- package/test/test/assets/dash-aes-128/Fragments(video=i,format=mpd-time-csf) +0 -0
- package/test/test/assets/dash-aes-128/dash.mpd +18 -0
- package/test/test/assets/dash-aes-128/license +1 -0
- package/test/test/assets/dash-multi-codec/audio_en_2c_128k_aac.mp4 +0 -0
- package/test/test/assets/dash-multi-codec/audio_es_2c_64k_opus.webm +0 -0
- package/test/test/assets/dash-multi-codec/dash.mpd +32 -0
- package/test/test/assets/dash-multi-codec/video_144p_108k_h264.mp4 +0 -0
- package/test/test/assets/hls-ts-h265/0.ts +0 -0
- package/test/test/assets/hls-ts-h265/hevc.m3u8 +6 -0
- package/test/test/assets/hls-ts-h265/index.m3u8 +7 -0
- package/test/test/assets/hls-ts-muxed-aac-h265/0.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h265/1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h265/media.m3u8 +9 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/media.m3u8 +24 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/s_00000.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/s_00001.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/s_00002.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/s_00003.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/s_00004.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/s_00005.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0000.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0001.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0002.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0003.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ec3-h264/prog_index.m3u8 +14 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/index.m3u8 +23 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-1-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-2-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-3-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-4-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-5-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-6-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-7-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-8-v1-a1.ts +0 -0
- package/test/test/util/dash_parser_util.js +4 -0
- package/test/test/util/fake_ad_manager.js +20 -0
- package/test/test/util/fake_media_source_engine.js +8 -2
- package/test/test/util/manifest_generator.js +7 -3
- package/test/test/util/mss_parser_util.js +4 -0
- package/test/test/util/offline_utils.js +1 -0
- package/test/test/util/streaming_engine_util.js +7 -4
- package/test/text/ttml_text_parser_unit.js +52 -0
- package/test/text/vtt_text_parser_unit.js +103 -31
- package/test/transmuxer/transmuxer_integration.js +117 -0
- package/test/ui/ui_unit.js +3 -10
- package/test/util/stream_utils_unit.js +208 -74
- package/ui/controls.js +125 -0
- package/ui/externs/ui.js +8 -1
- package/ui/pip_button.js +22 -120
- package/ui/remote_button.js +201 -0
- package/ui/ui.js +5 -2
- package/demo/common/message_ids.js +0 -309
- package/demo/locales/en.json +0 -288
- package/demo/locales/source.json +0 -1146
- package/externs/mux.js +0 -69
- package/lib/lcevc/lcevc_dil.js +0 -152
- package/lib/transmuxer/muxjs_transmuxer.js +0 -242
- package/test/transmuxer/muxjs_transmuxer_integration.js +0 -177
package/demo/config.js
CHANGED
|
@@ -11,7 +11,6 @@ goog.require('goog.asserts');
|
|
|
11
11
|
goog.require('shakaDemo.BoolInput');
|
|
12
12
|
goog.require('shakaDemo.DatalistInput');
|
|
13
13
|
goog.require('shakaDemo.InputContainer');
|
|
14
|
-
goog.require('shakaDemo.MessageIds');
|
|
15
14
|
goog.require('shakaDemo.NumberInput');
|
|
16
15
|
goog.require('shakaDemo.SelectInput');
|
|
17
16
|
goog.require('shakaDemo.TextInput');
|
|
@@ -58,11 +57,6 @@ shakaDemo.Config = class {
|
|
|
58
57
|
// changes based on the config changes.
|
|
59
58
|
this.reloadAndSaveState_();
|
|
60
59
|
});
|
|
61
|
-
document.addEventListener('shaka-main-locale-changed', () => {
|
|
62
|
-
// Respond to them by remaking. This is to avoid triggering any config
|
|
63
|
-
// changes based on the config changes.
|
|
64
|
-
this.reloadAndSaveState_();
|
|
65
|
-
});
|
|
66
60
|
document.addEventListener('shaka-main-drawer-state-change', () => {
|
|
67
61
|
this.setContentAvailability_(shakaDemoMain.getIsDrawerOpen());
|
|
68
62
|
});
|
|
@@ -94,8 +88,7 @@ shakaDemo.Config = class {
|
|
|
94
88
|
this.addStreamingSection_();
|
|
95
89
|
this.addMediaSourceSection_();
|
|
96
90
|
this.addManifestSection_();
|
|
97
|
-
this.addRetrictionsSection_('',
|
|
98
|
-
shakaDemo.MessageIds.RESTRICTIONS_SECTION_HEADER);
|
|
91
|
+
this.addRetrictionsSection_('', 'Restrictions');
|
|
99
92
|
this.addCmcdSection_();
|
|
100
93
|
this.addLcevcSection_();
|
|
101
94
|
this.addAdsSection_();
|
|
@@ -123,22 +116,19 @@ shakaDemo.Config = class {
|
|
|
123
116
|
|
|
124
117
|
/** @private */
|
|
125
118
|
addDrmSection_() {
|
|
126
|
-
const MessageIds = shakaDemo.MessageIds;
|
|
127
119
|
const docLink = this.resolveExternLink_('.DrmConfiguration');
|
|
128
|
-
this.addSection_(
|
|
129
|
-
.addBoolInput_(
|
|
120
|
+
this.addSection_('DRM', docLink)
|
|
121
|
+
.addBoolInput_('Delay License Request Until Played',
|
|
130
122
|
'drm.delayLicenseRequestUntilPlayed')
|
|
131
|
-
.addBoolInput_(
|
|
132
|
-
|
|
133
|
-
.addNumberInput_(MessageIds.UPDATE_EXPIRATION_TIME,
|
|
123
|
+
.addBoolInput_('Log license exchange data', 'drm.logLicenseExchange')
|
|
124
|
+
.addNumberInput_('Update expiration time',
|
|
134
125
|
'drm.updateExpirationTime',
|
|
135
126
|
/* canBeDecimal= */ true,
|
|
136
127
|
/* canBeZero= */ false,
|
|
137
128
|
/* canBeUnset= */ true)
|
|
138
|
-
.addBoolInput_(
|
|
129
|
+
.addBoolInput_('Parse inband "pssh" from media segments',
|
|
139
130
|
'drm.parseInbandPsshEnabled')
|
|
140
|
-
.addTextInput_(
|
|
141
|
-
'drm.minHdcpVersion');
|
|
131
|
+
.addTextInput_('Min HDCP version', 'drm.minHdcpVersion');
|
|
142
132
|
const advanced = shakaDemoMain.getConfiguration().drm.advanced || {};
|
|
143
133
|
const addDRMAdvancedField = (name, valueName, suggestions) => {
|
|
144
134
|
// All advanced fields of a given type are set at once.
|
|
@@ -177,299 +167,254 @@ shakaDemo.Config = class {
|
|
|
177
167
|
const sessionTypeSuggestions = ['temporary', 'persistent-license'];
|
|
178
168
|
|
|
179
169
|
addDRMAdvancedField(
|
|
180
|
-
|
|
181
|
-
'videoRobustness',
|
|
182
|
-
robustnessSuggestions);
|
|
183
|
-
addDRMAdvancedField(
|
|
184
|
-
MessageIds.AUDIO_ROBUSTNESS,
|
|
185
|
-
'audioRobustness',
|
|
186
|
-
robustnessSuggestions);
|
|
170
|
+
'Video Robustness', 'videoRobustness', robustnessSuggestions);
|
|
187
171
|
addDRMAdvancedField(
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
sessionTypeSuggestions);
|
|
172
|
+
'Audio Robustness', 'audioRobustness', robustnessSuggestions);
|
|
173
|
+
addDRMAdvancedField('Session Type', 'sessionType', sessionTypeSuggestions);
|
|
191
174
|
|
|
192
|
-
this.addRetrySection_('drm',
|
|
175
|
+
this.addRetrySection_('drm', 'DRM Retry Parameters');
|
|
193
176
|
}
|
|
194
177
|
|
|
195
178
|
/** @private */
|
|
196
179
|
addManifestSection_() {
|
|
197
|
-
const MessageIds = shakaDemo.MessageIds;
|
|
198
180
|
const docLink = this.resolveExternLink_('.ManifestConfiguration');
|
|
199
|
-
this.addSection_(
|
|
200
|
-
.addBoolInput_(
|
|
201
|
-
|
|
202
|
-
.addBoolInput_(MessageIds.AUTO_CORRECT_DASH_DRIFT,
|
|
181
|
+
this.addSection_('Manifest', docLink)
|
|
182
|
+
.addBoolInput_('Ignore DASH DRM Info', 'manifest.dash.ignoreDrmInfo')
|
|
183
|
+
.addBoolInput_('Auto-Correct DASH Drift',
|
|
203
184
|
'manifest.dash.autoCorrectDrift')
|
|
204
|
-
.addBoolInput_(
|
|
185
|
+
.addBoolInput_('Disable Xlink processing',
|
|
205
186
|
'manifest.dash.disableXlinkProcessing')
|
|
206
|
-
.addBoolInput_(
|
|
187
|
+
.addBoolInput_('Xlink Should Fail Gracefully',
|
|
207
188
|
'manifest.dash.xlinkFailGracefully')
|
|
208
|
-
.addBoolInput_(
|
|
189
|
+
.addBoolInput_('Ignore DASH suggestedPresentationDelay',
|
|
209
190
|
'manifest.dash.ignoreSuggestedPresentationDelay')
|
|
210
|
-
.addBoolInput_(
|
|
191
|
+
.addBoolInput_('Ignore empty DASH AdaptationSets',
|
|
211
192
|
'manifest.dash.ignoreEmptyAdaptationSet')
|
|
212
|
-
.addBoolInput_(
|
|
193
|
+
.addBoolInput_('Ignore DASH maxSegmentDuration',
|
|
213
194
|
'manifest.dash.ignoreMaxSegmentDuration')
|
|
214
|
-
.addBoolInput_(
|
|
195
|
+
.addBoolInput_('Ignore HLS Text Stream Failures',
|
|
215
196
|
'manifest.hls.ignoreTextStreamFailures')
|
|
216
|
-
.addBoolInput_(
|
|
197
|
+
.addBoolInput_('Ignore HLS Image Stream Failures',
|
|
217
198
|
'manifest.hls.ignoreImageStreamFailures')
|
|
218
|
-
.addTextInput_(
|
|
219
|
-
|
|
220
|
-
.
|
|
221
|
-
'manifest.hls.defaultVideoCodec')
|
|
222
|
-
.addBoolInput_(MessageIds.IGNORE_MANIFEST_PROGRAM_DATE_TIME,
|
|
199
|
+
.addTextInput_('Default Audio Codec', 'manifest.hls.defaultAudioCodec')
|
|
200
|
+
.addTextInput_('Default Video Codec', 'manifest.hls.defaultVideoCodec')
|
|
201
|
+
.addBoolInput_('Ignore Program Date Time from manifest',
|
|
223
202
|
'manifest.hls.ignoreManifestProgramDateTime')
|
|
224
|
-
.addBoolInput_(
|
|
203
|
+
.addBoolInput_('Use Safari behavior for live',
|
|
225
204
|
'manifest.hls.useSafariBehaviorForLive')
|
|
226
|
-
.addNumberInput_(
|
|
205
|
+
.addNumberInput_('Live segments delay',
|
|
227
206
|
'manifest.hls.liveSegmentsDelay')
|
|
228
|
-
.addBoolInput_(
|
|
229
|
-
|
|
230
|
-
.addBoolInput_(MessageIds.IGNORE_MANIFEST_TIMESTAMPS_IN_SEGMENTS_MODE,
|
|
207
|
+
.addBoolInput_('Enable HLS sequence mode', 'manifest.hls.sequenceMode')
|
|
208
|
+
.addBoolInput_('Ignore Manifest Timestamps in Segments Mode',
|
|
231
209
|
'manifest.hls.ignoreManifestTimestampsInSegmentsMode')
|
|
232
|
-
.addNumberInput_(
|
|
210
|
+
.addNumberInput_('Availability Window Override',
|
|
233
211
|
'manifest.availabilityWindowOverride',
|
|
234
212
|
/* canBeDecimal= */ true,
|
|
235
213
|
/* canBeZero= */ false,
|
|
236
214
|
/* canBeUnset= */ true)
|
|
237
|
-
.addTextInput_(
|
|
238
|
-
.addNumberInput_(
|
|
215
|
+
.addTextInput_('Clock Sync URI', 'manifest.dash.clockSyncUri')
|
|
216
|
+
.addNumberInput_('Default Presentation Delay',
|
|
239
217
|
'manifest.defaultPresentationDelay')
|
|
240
|
-
.addBoolInput_(
|
|
218
|
+
.addBoolInput_('Enable Audio Groups', 'manifest.dash.enableAudioGroups')
|
|
219
|
+
.addBoolInput_('Ignore Min Buffer Time',
|
|
241
220
|
'manifest.dash.ignoreMinBufferTime')
|
|
242
|
-
.addNumberInput_(
|
|
221
|
+
.addNumberInput_('Initial Segment Limit',
|
|
243
222
|
'manifest.dash.initialSegmentLimit',
|
|
244
223
|
/* canBeDecimal= */ false,
|
|
245
224
|
/* canBeZero= */ false,
|
|
246
225
|
/* canBeUnset= */ true)
|
|
247
|
-
.addBoolInput_(
|
|
226
|
+
.addBoolInput_('Enable DASH sequence mode',
|
|
248
227
|
'manifest.dash.sequenceMode')
|
|
249
|
-
.addBoolInput_(
|
|
250
|
-
|
|
251
|
-
.addBoolInput_(
|
|
252
|
-
|
|
253
|
-
.addBoolInput_(
|
|
254
|
-
'manifest.disableText')
|
|
255
|
-
.addBoolInput_(MessageIds.DISABLE_THUMBNAILS,
|
|
256
|
-
'manifest.disableThumbnails')
|
|
257
|
-
.addBoolInput_(MessageIds.SEGMENT_RELATIVE_VTT_TIMING,
|
|
228
|
+
.addBoolInput_('Disable Audio', 'manifest.disableAudio')
|
|
229
|
+
.addBoolInput_('Disable Video', 'manifest.disableVideo')
|
|
230
|
+
.addBoolInput_('Disable Text', 'manifest.disableText')
|
|
231
|
+
.addBoolInput_('Disable Thumbnails', 'manifest.disableThumbnails')
|
|
232
|
+
.addBoolInput_('Enable segment-relative VTT Timing',
|
|
258
233
|
'manifest.segmentRelativeVttTiming')
|
|
259
|
-
.addBoolInput_(
|
|
260
|
-
'manifest.mss.sequenceMode');
|
|
234
|
+
.addBoolInput_('Enable MSS sequence mode', 'manifest.mss.sequenceMode');
|
|
261
235
|
|
|
262
|
-
this.addRetrySection_('manifest',
|
|
236
|
+
this.addRetrySection_('manifest', 'Manifest Retry Parameters');
|
|
263
237
|
}
|
|
264
238
|
|
|
265
239
|
/** @private */
|
|
266
240
|
addAbrSection_() {
|
|
267
|
-
const MessageIds = shakaDemo.MessageIds;
|
|
268
241
|
const docLink = this.resolveExternLink_('.AbrConfiguration');
|
|
269
|
-
this.addSection_(
|
|
270
|
-
.addBoolInput_(
|
|
271
|
-
.addBoolInput_(
|
|
242
|
+
this.addSection_('Adaptation', docLink)
|
|
243
|
+
.addBoolInput_('Enabled', 'abr.enabled')
|
|
244
|
+
.addBoolInput_('Use Network Information API',
|
|
272
245
|
'abr.useNetworkInformation')
|
|
273
|
-
.addNumberInput_(
|
|
246
|
+
.addNumberInput_('Default Bandwidth EstimatZ',
|
|
274
247
|
'abr.defaultBandwidthEstimate')
|
|
275
|
-
.addNumberInput_(
|
|
248
|
+
.addNumberInput_('Bandwidth Downgrade Target',
|
|
276
249
|
'abr.bandwidthDowngradeTarget',
|
|
277
250
|
/* canBeDecimal= */ true)
|
|
278
|
-
.addNumberInput_(
|
|
251
|
+
.addNumberInput_('Bandwidth Upgrade Target',
|
|
279
252
|
'abr.bandwidthUpgradeTarget',
|
|
280
253
|
/* canBeDecimal= */ true)
|
|
281
|
-
.addNumberInput_(
|
|
282
|
-
'abr.switchInterval',
|
|
254
|
+
.addNumberInput_('Switch Interval', 'abr.switchInterval',
|
|
283
255
|
/* canBeDecimal= */ true)
|
|
284
|
-
.addNumberInput_(
|
|
285
|
-
|
|
286
|
-
.addNumberInput_(
|
|
287
|
-
'abr.advanced.minBytes')
|
|
288
|
-
.addNumberInput_(MessageIds.FAST_HALF_LIFE,
|
|
289
|
-
'abr.advanced.fastHalfLife',
|
|
256
|
+
.addNumberInput_('Min total Bytes', 'abr.advanced.minTotalBytes')
|
|
257
|
+
.addNumberInput_('Min Bytes', 'abr.advanced.minBytes')
|
|
258
|
+
.addNumberInput_('Fast half life', 'abr.advanced.fastHalfLife',
|
|
290
259
|
/* canBeDecimal= */ true)
|
|
291
|
-
.addNumberInput_(
|
|
292
|
-
'abr.advanced.slowHalfLife',
|
|
260
|
+
.addNumberInput_('Slow half life', 'abr.advanced.slowHalfLife',
|
|
293
261
|
/* canBeDecimal= */ true)
|
|
294
|
-
.addBoolInput_(
|
|
295
|
-
|
|
296
|
-
.addBoolInput_(
|
|
297
|
-
'abr.restrictToScreenSize')
|
|
298
|
-
.addBoolInput_(MessageIds.IGNORE_DEVICE_PIXEL_RATIO,
|
|
262
|
+
.addBoolInput_('Restrict to element size', 'abr.restrictToElementSize')
|
|
263
|
+
.addBoolInput_('Restrict to screen size', 'abr.restrictToScreenSize')
|
|
264
|
+
.addBoolInput_('Ignore device pixel ratio',
|
|
299
265
|
'abr.ignoreDevicePixelRatio')
|
|
300
|
-
.addBoolInput_(
|
|
266
|
+
.addBoolInput_('Clear video buffer on abr rendition switch',
|
|
301
267
|
'abr.clearBufferSwitch')
|
|
302
|
-
.addNumberInput_(
|
|
268
|
+
.addNumberInput_('Safe margin on abr switch rendition',
|
|
303
269
|
'abr.safeMarginSwitch',
|
|
304
270
|
/* canBeDecimal= */ true);
|
|
305
|
-
this.addRetrictionsSection_('abr',
|
|
306
|
-
MessageIds.ADAPTATION_RESTRICTIONS_SECTION_HEADER);
|
|
271
|
+
this.addRetrictionsSection_('abr', 'Adaptation Restrictions');
|
|
307
272
|
}
|
|
308
273
|
|
|
309
274
|
/** @private */
|
|
310
275
|
addCmcdSection_() {
|
|
311
|
-
const MessageIds = shakaDemo.MessageIds;
|
|
312
276
|
const docLink = this.resolveExternLink_('.CmcdConfiguration');
|
|
313
|
-
this.addSection_(
|
|
314
|
-
.addBoolInput_(
|
|
315
|
-
.addTextInput_(
|
|
316
|
-
.addTextInput_(
|
|
317
|
-
.addBoolInput_(
|
|
277
|
+
this.addSection_('CMCD', docLink)
|
|
278
|
+
.addBoolInput_('Enabled', 'cmcd.enabled')
|
|
279
|
+
.addTextInput_('Session ID', 'cmcd.sessionId')
|
|
280
|
+
.addTextInput_('Content ID', 'cmcd.contentId')
|
|
281
|
+
.addBoolInput_('Use Headers', 'cmcd.useHeaders');
|
|
318
282
|
}
|
|
319
283
|
|
|
320
284
|
/** @private */
|
|
321
285
|
addLcevcSection_() {
|
|
322
|
-
const MessageIds = shakaDemo.MessageIds;
|
|
323
286
|
const docLink = this.resolveExternLink_('.LcevcConfiguration');
|
|
324
|
-
this.addSection_(
|
|
325
|
-
.addBoolInput_(
|
|
326
|
-
.addBoolInput_(
|
|
287
|
+
this.addSection_('MPEG-5 Part-2 LCEVC', docLink)
|
|
288
|
+
.addBoolInput_('Enabled', 'lcevc.enabled')
|
|
289
|
+
.addBoolInput_('LCEVC Dynamic Performance scaling',
|
|
327
290
|
'lcevc.dynamicPerformanceScaling')
|
|
328
|
-
.addNumberInput_(
|
|
329
|
-
.addBoolInput_(
|
|
291
|
+
.addNumberInput_('LCEVC Log Level', 'lcevc.logLevel')
|
|
292
|
+
.addBoolInput_('Draw LCEVC Logo', 'lcevc.drawLogo');
|
|
330
293
|
}
|
|
331
294
|
|
|
332
295
|
/** @private */
|
|
333
296
|
addAdsSection_() {
|
|
334
|
-
const MessageIds = shakaDemo.MessageIds;
|
|
335
297
|
const docLink = this.resolveExternLink_('.AdsConfiguration');
|
|
336
|
-
this.addSection_(
|
|
337
|
-
.addBoolInput_(
|
|
298
|
+
this.addSection_('Ads', docLink)
|
|
299
|
+
.addBoolInput_('Custom playhead tracker',
|
|
338
300
|
'ads.customPlayheadTracker');
|
|
339
301
|
}
|
|
340
302
|
|
|
341
303
|
/**
|
|
342
304
|
* @param {string} category
|
|
343
|
-
* @param {
|
|
305
|
+
* @param {string} sectionName
|
|
344
306
|
* @private
|
|
345
307
|
*/
|
|
346
308
|
addRetrictionsSection_(category, sectionName) {
|
|
347
|
-
const MessageIds = shakaDemo.MessageIds;
|
|
348
309
|
const prefix = (category ? category + '.' : '') + 'restrictions.';
|
|
349
310
|
const docLink = this.resolveExternLink_('.Restrictions');
|
|
350
311
|
this.addSection_(sectionName, docLink)
|
|
351
|
-
.addNumberInput_(
|
|
352
|
-
.addNumberInput_(
|
|
353
|
-
.addNumberInput_(
|
|
354
|
-
.addNumberInput_(
|
|
355
|
-
.addNumberInput_(
|
|
356
|
-
.addNumberInput_(
|
|
357
|
-
.addNumberInput_(
|
|
358
|
-
.addNumberInput_(
|
|
359
|
-
.addNumberInput_(
|
|
360
|
-
.addNumberInput_(
|
|
312
|
+
.addNumberInput_('Min Width', prefix + 'minWidth')
|
|
313
|
+
.addNumberInput_('Max Width', prefix + 'maxWidth')
|
|
314
|
+
.addNumberInput_('Min Height', prefix + 'minHeight')
|
|
315
|
+
.addNumberInput_('Max Height', prefix + 'maxHeight')
|
|
316
|
+
.addNumberInput_('Min Pixels', prefix + 'minPixels')
|
|
317
|
+
.addNumberInput_('Max Pixels', prefix + 'maxPixels')
|
|
318
|
+
.addNumberInput_('Min Framerate', prefix + 'minFrameRate')
|
|
319
|
+
.addNumberInput_('Max Framerate', prefix + 'maxFrameRate')
|
|
320
|
+
.addNumberInput_('Min Bandwidth', prefix + 'minBandwidth')
|
|
321
|
+
.addNumberInput_('Max Bandwidth', prefix + 'maxBandwidth');
|
|
361
322
|
}
|
|
362
323
|
|
|
363
324
|
/**
|
|
364
325
|
* @param {string} category
|
|
365
|
-
* @param {
|
|
326
|
+
* @param {string} sectionName
|
|
366
327
|
* @private
|
|
367
328
|
*/
|
|
368
329
|
addRetrySection_(category, sectionName) {
|
|
369
|
-
const MessageIds = shakaDemo.MessageIds;
|
|
370
330
|
const prefix = category + '.retryParameters.';
|
|
371
331
|
const docLink = this.resolveExternLink_('.RetryParameters');
|
|
372
332
|
this.addSection_(sectionName, docLink)
|
|
373
|
-
.addNumberInput_(
|
|
374
|
-
.addNumberInput_(
|
|
333
|
+
.addNumberInput_('Max Attempts', prefix + 'maxAttempts')
|
|
334
|
+
.addNumberInput_('Base Delay', prefix + 'baseDelay',
|
|
375
335
|
/* canBeDecimal= */ true)
|
|
376
|
-
.addNumberInput_(
|
|
336
|
+
.addNumberInput_('Backoff Factor', prefix + 'backoffFactor',
|
|
377
337
|
/* canBeDecimal= */ true)
|
|
378
|
-
.addNumberInput_(
|
|
338
|
+
.addNumberInput_('Fuzz Factor', prefix + 'fuzzFactor',
|
|
379
339
|
/* canBeDecimal= */ true)
|
|
380
|
-
.addNumberInput_(
|
|
340
|
+
.addNumberInput_('Timeout Factor', prefix + 'timeout',
|
|
381
341
|
/* canBeDecimal= */ true)
|
|
382
|
-
.addNumberInput_(
|
|
342
|
+
.addNumberInput_('Stall Timeout', prefix + 'stallTimeout',
|
|
383
343
|
/* canBeDecimal= */ true)
|
|
384
|
-
.addNumberInput_(
|
|
385
|
-
prefix + 'connectionTimeout',
|
|
344
|
+
.addNumberInput_('Connection Timeout', prefix + 'connectionTimeout',
|
|
386
345
|
/* canBeDecimal= */ true);
|
|
387
346
|
}
|
|
388
347
|
|
|
389
348
|
/** @private */
|
|
390
349
|
addOfflineSection_() {
|
|
391
|
-
const MessageIds = shakaDemo.MessageIds;
|
|
392
350
|
const docLink = this.resolveExternLink_('.OfflineConfiguration');
|
|
393
|
-
this.addSection_(
|
|
394
|
-
.addBoolInput_(
|
|
351
|
+
this.addSection_('Offline', docLink)
|
|
352
|
+
.addBoolInput_('Use Persistent Licenses',
|
|
395
353
|
'offline.usePersistentLicense')
|
|
396
|
-
.addNumberInput_(
|
|
354
|
+
.addNumberInput_('Number of Parallel Downloads',
|
|
397
355
|
'offline.numberOfParallelDownloads');
|
|
398
356
|
}
|
|
399
357
|
|
|
400
358
|
/** @private */
|
|
401
359
|
addStreamingSection_() {
|
|
402
|
-
const MessageIds = shakaDemo.MessageIds;
|
|
403
360
|
const docLink = this.resolveExternLink_('.StreamingConfiguration');
|
|
404
|
-
this.addSection_(
|
|
405
|
-
.addNumberInput_(
|
|
361
|
+
this.addSection_('Streaming', docLink)
|
|
362
|
+
.addNumberInput_('Gap detection threshold',
|
|
406
363
|
'streaming.gapDetectionThreshold',
|
|
407
364
|
/* canBeDecimal= */ true)
|
|
408
|
-
.addNumberInput_(
|
|
409
|
-
'streaming.gapJumpTimerTime',
|
|
365
|
+
.addNumberInput_('Gap Jump Timer Time', 'streaming.gapJumpTimerTime',
|
|
410
366
|
/* canBeDecimal= */ true)
|
|
411
|
-
.addNumberInput_(
|
|
412
|
-
'streaming.bufferingGoal',
|
|
367
|
+
.addNumberInput_('Buffering Goal', 'streaming.bufferingGoal',
|
|
413
368
|
/* canBeDecimal= */ true)
|
|
414
|
-
.addNumberInput_(
|
|
415
|
-
'streaming.durationBackoff',
|
|
369
|
+
.addNumberInput_('Duration Backoff', 'streaming.durationBackoff',
|
|
416
370
|
/* canBeDecimal= */ true)
|
|
417
|
-
.addNumberInput_(
|
|
418
|
-
'streaming.rebufferingGoal',
|
|
371
|
+
.addNumberInput_('Rebuffering Goal', 'streaming.rebufferingGoal',
|
|
419
372
|
/* canBeDecimal= */ true)
|
|
420
|
-
.addNumberInput_(
|
|
421
|
-
'streaming.bufferBehind',
|
|
373
|
+
.addNumberInput_('Buffer Behind', 'streaming.bufferBehind',
|
|
422
374
|
/* canBeDecimal= */ true)
|
|
423
|
-
.addNumberInput_(
|
|
424
|
-
'streaming.safeSeekOffset',
|
|
375
|
+
.addNumberInput_('Safe Seek Offset', 'streaming.safeSeekOffset',
|
|
425
376
|
/* canBeDecimal= */ true)
|
|
426
|
-
.addNumberInput_(
|
|
427
|
-
'streaming.stallThreshold',
|
|
377
|
+
.addNumberInput_('Stall Threshold', 'streaming.stallThreshold',
|
|
428
378
|
/* canBeDecimal= */ true)
|
|
429
|
-
.addNumberInput_(
|
|
430
|
-
'streaming.stallSkip',
|
|
379
|
+
.addNumberInput_('Safe Skip Distance', 'streaming.stallSkip',
|
|
431
380
|
/* canBeDecimal= */ true)
|
|
432
|
-
.addNumberInput_(
|
|
381
|
+
.addNumberInput_('Inaccurate Manifest Tolerance',
|
|
433
382
|
'streaming.inaccurateManifestTolerance',
|
|
434
383
|
/* canBeDecimal= */ true)
|
|
435
|
-
.addBoolInput_(
|
|
436
|
-
|
|
437
|
-
.addBoolInput_(
|
|
438
|
-
|
|
439
|
-
.addBoolInput_(MessageIds.FORCE_HTTPS,
|
|
440
|
-
'streaming.forceHTTPS')
|
|
441
|
-
.addBoolInput_(MessageIds.PREFER_NATIVE_HLS,
|
|
384
|
+
.addBoolInput_('Low Latency Mode', 'streaming.lowLatencyMode')
|
|
385
|
+
.addBoolInput_('Auto Low Latency Mode', 'streaming.autoLowLatencyMode')
|
|
386
|
+
.addBoolInput_('Force HTTPS', 'streaming.forceHTTPS')
|
|
387
|
+
.addBoolInput_('Prefer native HLS playback when available',
|
|
442
388
|
'streaming.preferNativeHls')
|
|
443
|
-
.addNumberInput_(
|
|
389
|
+
.addNumberInput_('Update interval seconds',
|
|
444
390
|
'streaming.updateIntervalSeconds',
|
|
445
391
|
/* canBeDecimal= */ true)
|
|
446
|
-
.addBoolInput_(
|
|
392
|
+
.addBoolInput_('Dispatch all emsg boxes',
|
|
447
393
|
'streaming.dispatchAllEmsgBoxes')
|
|
448
|
-
.addBoolInput_(
|
|
394
|
+
.addBoolInput_('Observe media quality changes',
|
|
449
395
|
'streaming.observeQualityChanges')
|
|
450
|
-
.addNumberInput_(
|
|
396
|
+
.addNumberInput_('Max Variant Disabled Time',
|
|
451
397
|
'streaming.maxDisabledTime')
|
|
452
|
-
.addNumberInput_(
|
|
398
|
+
.addNumberInput_('Segment Prefetch Limit',
|
|
453
399
|
'streaming.segmentPrefetchLimit')
|
|
454
|
-
.addBoolInput_(
|
|
455
|
-
|
|
456
|
-
.addNumberInput_(MessageIds.LIVE_SYNC_MAX_LATENCY,
|
|
400
|
+
.addBoolInput_('Live Sync', 'streaming.liveSync')
|
|
401
|
+
.addNumberInput_('Max latency for live sync',
|
|
457
402
|
'streaming.liveSyncMaxLatency',
|
|
458
403
|
/* canBeDecimal= */ true,
|
|
459
404
|
/* canBeZero= */ true)
|
|
460
|
-
.addNumberInput_(
|
|
405
|
+
.addNumberInput_('Playback rate for live sync',
|
|
461
406
|
'streaming.liveSyncPlaybackRate',
|
|
462
407
|
/* canBeDecimal= */ true,
|
|
463
408
|
/* canBeZero= */ false);
|
|
464
409
|
|
|
465
410
|
if (!shakaDemoMain.getNativeControlsEnabled()) {
|
|
466
|
-
this.addBoolInput_(
|
|
467
|
-
'streaming.alwaysStreamText');
|
|
411
|
+
this.addBoolInput_('Always Stream Text', 'streaming.alwaysStreamText');
|
|
468
412
|
} else {
|
|
469
413
|
// Add a fake custom fixed "input" that warns the users not to change it.
|
|
470
414
|
const noop = (input) => {};
|
|
471
|
-
this.addCustomBoolInput_(
|
|
472
|
-
|
|
415
|
+
this.addCustomBoolInput_('Always Stream Text', noop,
|
|
416
|
+
'Text must always be streamed while native controls are enabled, ' +
|
|
417
|
+
'for captions to work.');
|
|
473
418
|
this.latestInput_.input().disabled = true;
|
|
474
419
|
this.latestInput_.input().checked = true;
|
|
475
420
|
}
|
|
@@ -481,65 +426,66 @@ shakaDemo.Config = class {
|
|
|
481
426
|
'PQ': 'PQ',
|
|
482
427
|
'HLG': 'HLG',
|
|
483
428
|
};
|
|
484
|
-
const localize = (name) => shakaDemoMain.getLocalizedString(name);
|
|
485
429
|
const hdrLevelNames = {
|
|
486
|
-
'AUTO':
|
|
487
|
-
'SDR':
|
|
488
|
-
'PQ':
|
|
489
|
-
'HLG':
|
|
490
|
-
'':
|
|
430
|
+
'AUTO': 'Auto Detect',
|
|
431
|
+
'SDR': 'SDR',
|
|
432
|
+
'PQ': 'PQ',
|
|
433
|
+
'HLG': 'HLG',
|
|
434
|
+
'': 'No Preference',
|
|
491
435
|
};
|
|
492
|
-
this.addSelectInput_(
|
|
436
|
+
this.addSelectInput_('Preferred HDR Level', 'preferredVideoHdrLevel',
|
|
493
437
|
hdrLevels, hdrLevelNames);
|
|
494
438
|
|
|
495
|
-
this.addBoolInput_(
|
|
439
|
+
this.addBoolInput_('Start At Segment Boundary',
|
|
496
440
|
'streaming.startAtSegmentBoundary')
|
|
497
|
-
.addBoolInput_(
|
|
441
|
+
.addBoolInput_('Ignore Text Stream Failures',
|
|
498
442
|
'streaming.ignoreTextStreamFailures')
|
|
499
|
-
.addBoolInput_(
|
|
500
|
-
|
|
501
|
-
.addBoolInput_(MessageIds.USE_NATIVE_HLS_SAFARI,
|
|
443
|
+
.addBoolInput_('Stall Detector Enabled', 'streaming.stallEnabled')
|
|
444
|
+
.addBoolInput_('Use native HLS on Safari',
|
|
502
445
|
'streaming.useNativeHlsOnSafari');
|
|
503
|
-
this.addRetrySection_('streaming',
|
|
504
|
-
MessageIds.STREAMING_RETRY_SECTION_HEADER);
|
|
446
|
+
this.addRetrySection_('streaming', 'Streaming Retry Parameters');
|
|
505
447
|
}
|
|
506
448
|
|
|
507
449
|
/** @private */
|
|
508
450
|
addMediaSourceSection_() {
|
|
509
|
-
const
|
|
451
|
+
const strategyOptions = shaka.config.CodecSwitchingStrategy;
|
|
452
|
+
const strategyOptionsNames = {
|
|
453
|
+
'RELOAD': 'reload',
|
|
454
|
+
'SMOOTH': 'smooth',
|
|
455
|
+
};
|
|
456
|
+
|
|
510
457
|
const docLink = this.resolveExternLink_('.MediaSourceConfiguration');
|
|
511
|
-
this.addSection_(
|
|
512
|
-
.addTextInput_(
|
|
458
|
+
this.addSection_('Media source', docLink)
|
|
459
|
+
.addTextInput_('Source buffer extra features',
|
|
513
460
|
'mediaSource.sourceBufferExtraFeatures')
|
|
514
|
-
.addBoolInput_(
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
461
|
+
.addBoolInput_('Force Transmux', 'mediaSource.forceTransmux')
|
|
462
|
+
.addBoolInput_('Insert fake encryption in init segments when needed ' +
|
|
463
|
+
'by the platform.', 'mediaSource.insertFakeEncryptionInInit')
|
|
464
|
+
.addSelectInput_(
|
|
465
|
+
'Codec Switching Strategy',
|
|
466
|
+
'mediaSource.codecSwitchingStrategy',
|
|
467
|
+
strategyOptions,
|
|
468
|
+
strategyOptionsNames);
|
|
518
469
|
}
|
|
519
470
|
|
|
520
471
|
/** @private */
|
|
521
472
|
addLanguageSection_() {
|
|
522
|
-
const MessageIds = shakaDemo.MessageIds;
|
|
523
473
|
const docLink = this.resolveExternLink_('.PlayerConfiguration');
|
|
524
474
|
|
|
525
475
|
const autoShowTextOptions = shaka.config.AutoShowText;
|
|
526
|
-
const localize = (name) => shakaDemoMain.getLocalizedString(name);
|
|
527
476
|
const autoShowTextOptionNames = {
|
|
528
|
-
'NEVER':
|
|
529
|
-
'ALWAYS':
|
|
530
|
-
'IF_PREFERRED_TEXT_LANGUAGE':
|
|
531
|
-
|
|
532
|
-
'IF_SUBTITLES_MAY_BE_NEEDED':
|
|
533
|
-
localize(MessageIds.AUTO_SHOW_TEXT_IF_SUBTITLES_MAY_BE_NEEDED),
|
|
477
|
+
'NEVER': 'Never',
|
|
478
|
+
'ALWAYS': 'Always',
|
|
479
|
+
'IF_PREFERRED_TEXT_LANGUAGE': 'If preferred text language',
|
|
480
|
+
'IF_SUBTITLES_MAY_BE_NEEDED': 'If subtitles may be needed',
|
|
534
481
|
};
|
|
535
482
|
|
|
536
|
-
this.addSection_(
|
|
537
|
-
.addTextInput_(
|
|
538
|
-
.addTextInput_(
|
|
539
|
-
.addTextInput_(
|
|
540
|
-
.addTextInput_(
|
|
541
|
-
.addSelectInput_(
|
|
542
|
-
MessageIds.AUTO_SHOW_TEXT,
|
|
483
|
+
this.addSection_('Language', docLink)
|
|
484
|
+
.addTextInput_('Preferred Audio Language', 'preferredAudioLanguage')
|
|
485
|
+
.addTextInput_('Preferred Audio Label', 'preferredAudioLabel')
|
|
486
|
+
.addTextInput_('Preferred Text Language', 'preferredTextLanguage')
|
|
487
|
+
.addTextInput_('Preferred Text Role', 'preferredTextRole')
|
|
488
|
+
.addSelectInput_('Auto-Show Text',
|
|
543
489
|
'autoShowText',
|
|
544
490
|
autoShowTextOptions,
|
|
545
491
|
autoShowTextOptionNames);
|
|
@@ -547,20 +493,18 @@ shakaDemo.Config = class {
|
|
|
547
493
|
shakaDemoMain.setUILocale(input.value);
|
|
548
494
|
shakaDemoMain.remakeHash();
|
|
549
495
|
};
|
|
550
|
-
this.addCustomTextInput_(
|
|
496
|
+
this.addCustomTextInput_('Preferred UI Locale', onChange);
|
|
551
497
|
this.latestInput_.input().value = shakaDemoMain.getUILocale();
|
|
552
|
-
this.addNumberInput_(
|
|
498
|
+
this.addNumberInput_('Preferred Audio Channel Count',
|
|
553
499
|
'preferredAudioChannelCount');
|
|
554
|
-
this.addBoolInput_(
|
|
555
|
-
'preferForcedSubs');
|
|
500
|
+
this.addBoolInput_('Prefer Forced Subs', 'preferForcedSubs');
|
|
556
501
|
}
|
|
557
502
|
|
|
558
503
|
/** @private */
|
|
559
504
|
addMetaSection_() {
|
|
560
|
-
const MessageIds = shakaDemo.MessageIds;
|
|
561
505
|
this.addSection_(/* name= */ null, /* docLink= */ null);
|
|
562
506
|
|
|
563
|
-
this.addCustomBoolInput_(
|
|
507
|
+
this.addCustomBoolInput_('Shaka Controls', (input) => {
|
|
564
508
|
shakaDemoMain.setNativeControlsEnabled(!input.checked);
|
|
565
509
|
if (input.checked) {
|
|
566
510
|
// Forcibly set |streaming.alwaysStreamText| to true.
|
|
@@ -578,7 +522,7 @@ shakaDemo.Config = class {
|
|
|
578
522
|
}
|
|
579
523
|
|
|
580
524
|
if (!shakaDemoMain.getNativeControlsEnabled()) {
|
|
581
|
-
this.addCustomBoolInput_(
|
|
525
|
+
this.addCustomBoolInput_('Enabled Trick Play Controls', (input) => {
|
|
582
526
|
shakaDemoMain.setTrickPlayControlsEnabled(input.checked);
|
|
583
527
|
});
|
|
584
528
|
if (shakaDemoMain.getTrickPlayControlsEnabled()) {
|
|
@@ -587,8 +531,8 @@ shakaDemo.Config = class {
|
|
|
587
531
|
} else {
|
|
588
532
|
// Add a fake custom fixed "input" that warns the users not to change it.
|
|
589
533
|
const noop = (input) => {};
|
|
590
|
-
this.addCustomBoolInput_(
|
|
591
|
-
noop,
|
|
534
|
+
this.addCustomBoolInput_('Enabled Trick Play Controls',
|
|
535
|
+
noop, 'Trick Play controls require the Shaka UI.');
|
|
592
536
|
this.latestInput_.input().disabled = true;
|
|
593
537
|
this.latestInput_.input().checked = false;
|
|
594
538
|
}
|
|
@@ -608,12 +552,11 @@ shakaDemo.Config = class {
|
|
|
608
552
|
const Level = shaka['log']['Level'];
|
|
609
553
|
const setLevel = shaka['log']['setLevel'];
|
|
610
554
|
|
|
611
|
-
const localize = (name) => shakaDemoMain.getLocalizedString(name);
|
|
612
555
|
const logLevels = {
|
|
613
|
-
'info':
|
|
614
|
-
'debug':
|
|
615
|
-
'v':
|
|
616
|
-
'vv':
|
|
556
|
+
'info': 'Info',
|
|
557
|
+
'debug': 'Debug',
|
|
558
|
+
'v': 'Verbose',
|
|
559
|
+
'vv': 'Very Verbose',
|
|
617
560
|
};
|
|
618
561
|
const onChange = (input) => {
|
|
619
562
|
switch (input.value) {
|
|
@@ -632,7 +575,7 @@ shakaDemo.Config = class {
|
|
|
632
575
|
}
|
|
633
576
|
shakaDemoMain.remakeHash();
|
|
634
577
|
};
|
|
635
|
-
this.addCustomSelectInput_(
|
|
578
|
+
this.addCustomSelectInput_('Log Level', logLevels, onChange);
|
|
636
579
|
const input = this.latestInput_.input();
|
|
637
580
|
switch (shaka['log']['currentLevel']) {
|
|
638
581
|
case Level['DEBUG']:
|
|
@@ -660,7 +603,7 @@ shakaDemo.Config = class {
|
|
|
660
603
|
}
|
|
661
604
|
|
|
662
605
|
/**
|
|
663
|
-
* @param {?
|
|
606
|
+
* @param {?string} name
|
|
664
607
|
* @param {?string} docLink
|
|
665
608
|
* @return {!shakaDemo.Config}
|
|
666
609
|
* @private
|
|
@@ -676,9 +619,9 @@ shakaDemo.Config = class {
|
|
|
676
619
|
}
|
|
677
620
|
|
|
678
621
|
/**
|
|
679
|
-
* @param {
|
|
622
|
+
* @param {string} name
|
|
680
623
|
* @param {string} valueName
|
|
681
|
-
* @param {
|
|
624
|
+
* @param {string=} tooltipMessage
|
|
682
625
|
* @return {!shakaDemo.Config}
|
|
683
626
|
* @private
|
|
684
627
|
*/
|
|
@@ -695,24 +638,23 @@ shakaDemo.Config = class {
|
|
|
695
638
|
}
|
|
696
639
|
|
|
697
640
|
/**
|
|
698
|
-
* @param {
|
|
641
|
+
* @param {string} name
|
|
699
642
|
* @param {function(!HTMLInputElement)} onChange
|
|
700
|
-
* @param {
|
|
643
|
+
* @param {string=} tooltipMessage
|
|
701
644
|
* @return {!shakaDemo.Config}
|
|
702
645
|
* @private
|
|
703
646
|
*/
|
|
704
647
|
addCustomBoolInput_(name, onChange, tooltipMessage) {
|
|
705
648
|
this.createRow_(name, tooltipMessage);
|
|
706
|
-
const localized = shakaDemoMain.getLocalizedString(name);
|
|
707
649
|
this.latestInput_ = new shakaDemo.BoolInput(
|
|
708
|
-
this.getLatestSection_(),
|
|
650
|
+
this.getLatestSection_(), name, onChange);
|
|
709
651
|
return this;
|
|
710
652
|
}
|
|
711
653
|
|
|
712
654
|
/**
|
|
713
|
-
* @param {!
|
|
655
|
+
* @param {!string} name
|
|
714
656
|
* @param {string} valueName
|
|
715
|
-
* @param {
|
|
657
|
+
* @param {string=} tooltipMessage
|
|
716
658
|
* @return {!shakaDemo.Config}
|
|
717
659
|
* @private
|
|
718
660
|
*/
|
|
@@ -728,27 +670,26 @@ shakaDemo.Config = class {
|
|
|
728
670
|
}
|
|
729
671
|
|
|
730
672
|
/**
|
|
731
|
-
* @param {
|
|
673
|
+
* @param {string} name
|
|
732
674
|
* @param {function(!HTMLInputElement)} onChange
|
|
733
|
-
* @param {
|
|
675
|
+
* @param {string=} tooltipMessage
|
|
734
676
|
* @return {!shakaDemo.Config}
|
|
735
677
|
* @private
|
|
736
678
|
*/
|
|
737
679
|
addCustomTextInput_(name, onChange, tooltipMessage) {
|
|
738
680
|
this.createRow_(name, tooltipMessage);
|
|
739
|
-
const localized = shakaDemoMain.getLocalizedString(name);
|
|
740
681
|
this.latestInput_ = new shakaDemo.TextInput(
|
|
741
|
-
this.getLatestSection_(),
|
|
682
|
+
this.getLatestSection_(), name, onChange);
|
|
742
683
|
return this;
|
|
743
684
|
}
|
|
744
685
|
|
|
745
686
|
/**
|
|
746
|
-
* @param {
|
|
687
|
+
* @param {string} name
|
|
747
688
|
* @param {string} valueName
|
|
748
689
|
* @param {boolean=} canBeDecimal
|
|
749
690
|
* @param {boolean=} canBeZero
|
|
750
691
|
* @param {boolean=} canBeUnset
|
|
751
|
-
* @param {
|
|
692
|
+
* @param {string=} tooltipMessage
|
|
752
693
|
* @return {!shakaDemo.Config}
|
|
753
694
|
* @private
|
|
754
695
|
*/
|
|
@@ -778,9 +719,8 @@ shakaDemo.Config = class {
|
|
|
778
719
|
}
|
|
779
720
|
};
|
|
780
721
|
this.createRow_(name, tooltipMessage);
|
|
781
|
-
const localized = shakaDemoMain.getLocalizedString(name);
|
|
782
722
|
this.latestInput_ = new shakaDemo.NumberInput(
|
|
783
|
-
this.getLatestSection_(),
|
|
723
|
+
this.getLatestSection_(), name, onChange, canBeDecimal, canBeZero,
|
|
784
724
|
canBeUnset);
|
|
785
725
|
this.latestInput_.input().value =
|
|
786
726
|
shakaDemoMain.getCurrentConfigValue(valueName);
|
|
@@ -791,26 +731,25 @@ shakaDemo.Config = class {
|
|
|
791
731
|
}
|
|
792
732
|
|
|
793
733
|
/**
|
|
794
|
-
* @param {
|
|
734
|
+
* @param {string} name
|
|
795
735
|
* @param {!Array.<string>} values
|
|
796
736
|
* @param {function(!HTMLInputElement)} onChange
|
|
797
|
-
* @param {
|
|
737
|
+
* @param {string=} tooltipMessage
|
|
798
738
|
* @return {!shakaDemo.Config}
|
|
799
739
|
* @private
|
|
800
740
|
*/
|
|
801
741
|
addDatalistInput_(name, values, onChange, tooltipMessage) {
|
|
802
742
|
this.createRow_(name, tooltipMessage);
|
|
803
|
-
const localized = shakaDemoMain.getLocalizedString(name);
|
|
804
743
|
this.latestInput_ = new shakaDemo.DatalistInput(
|
|
805
|
-
this.getLatestSection_(),
|
|
744
|
+
this.getLatestSection_(), name, onChange, values);
|
|
806
745
|
return this;
|
|
807
746
|
}
|
|
808
747
|
|
|
809
748
|
/**
|
|
810
|
-
* @param {
|
|
749
|
+
* @param {string} name
|
|
811
750
|
* @param {!Object.<string, string>} values
|
|
812
751
|
* @param {function(!HTMLInputElement)} onChange
|
|
813
|
-
* @param {
|
|
752
|
+
* @param {string=} tooltipMessage
|
|
814
753
|
* @return {!shakaDemo.Config}
|
|
815
754
|
* @private
|
|
816
755
|
*/
|
|
@@ -824,11 +763,11 @@ shakaDemo.Config = class {
|
|
|
824
763
|
}
|
|
825
764
|
|
|
826
765
|
/**
|
|
827
|
-
* @param {
|
|
766
|
+
* @param {string} name
|
|
828
767
|
* @param {string} valueName
|
|
829
768
|
* @param {!Object.<string, ?>} options
|
|
830
769
|
* @param {!Object.<string, string>} optionNames
|
|
831
|
-
* @param {
|
|
770
|
+
* @param {string=} tooltipMessage
|
|
832
771
|
* @return {!shakaDemo.Config}
|
|
833
772
|
* @private
|
|
834
773
|
*/
|
|
@@ -860,8 +799,8 @@ shakaDemo.Config = class {
|
|
|
860
799
|
}
|
|
861
800
|
|
|
862
801
|
/**
|
|
863
|
-
* @param {
|
|
864
|
-
* @param {
|
|
802
|
+
* @param {string} name
|
|
803
|
+
* @param {string=} tooltipMessage
|
|
865
804
|
* @private
|
|
866
805
|
*/
|
|
867
806
|
createRow_(name, tooltipMessage) {
|