-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.php
496 lines (443 loc) · 15.7 KB
/
options.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
<?php
// -----------------------------
// === Stream Player Options ===
// -----------------------------
if ( !defined( 'ABSPATH' ) ) exit;
// ------------------
// Set Plugin Options
// ------------------
$options = array(
// --------------
// --- Stream ---
// --------------
// === Source ===
// --- [Player] Streaming URL ---
'streaming_url' => array(
'type' => 'text',
'options' => 'URL',
'label' => __( 'Streaming URL', 'stream-player' ),
'default' => '',
'helper' => __( 'Enter the Streaming URL for your Stream.', 'stream-player' ),
'tab' => 'stream',
'section' => 'source',
),
// --- [Player] Stream Format ---
'streaming_format' => array(
'type' => 'select',
'options' => $formats,
'label' => __( 'Streaming Format', 'stream-player' ),
'default' => 'aac',
'helper' => __( 'Select streaming format for streaming URL.', 'stream-player' ),
'tab' => 'stream',
'section' => 'source',
),
// --- [Player] Fallback Stream URL ---
'fallback_url' => array(
'type' => 'text',
'options' => 'URL',
'label' => __( 'Fallback Stream URL', 'stream-player' ),
'default' => '',
'helper' => __( 'Enter an alternative Streaming URL for Player fallback.', 'stream-player' ),
'tab' => 'stream',
'section' => 'source',
),
// --- [Player] Fallback Stream Format ---
'fallback_format' => array(
'type' => 'select',
'options' => $formats,
'label' => __( 'Fallback Format', 'stream-player' ),
'default' => 'ogg',
'helper' => __( 'Select streaming fallback for fallback URL.', 'stream-player' ),
'tab' => 'stream',
'section' => 'source',
),
// === Channel ===
// --- [Player] Station Title ---
'station_title' => array(
'type' => 'text',
'label' => __( 'Stream Title', 'stream-player' ),
'default' => '',
'helper' => __( 'The name of your Stream.', 'stream-player' ),
'tab' => 'stream',
'section' => 'channel',
),
// --- [Player] Player Title ---
'player_title' => array(
'type' => 'checkbox',
'label' => __( 'Display Stream Title', 'stream-player' ),
'default' => 'yes',
'value' => 'yes',
'helper' => __( 'Display your Stream Title in Player by default.', 'stream-player' ),
'tab' => 'stream',
'section' => 'channel',
),
// --- [Player] Stream Image ---
'station_image' => array(
'type' => 'image',
'label' => __( 'Stream Image', 'stream-player' ),
'default' => '',
'helper' => __( 'Add a logo image for your Stream. Please ensure image is square before uploading. Recommended size 256 x 256', 'stream-player' ),
'tab' => 'stream',
'section' => 'channel',
),
// --- [Player] Display Stream Image ---
'player_image' => array(
'type' => 'checkbox',
'label' => __( 'Display Stream Image', 'stream-player' ),
'default' => 'yes',
'value' => 'yes',
'helper' => __( 'Display your Stream Image in Player by default.', 'stream-player' ),
'tab' => 'stream',
'section' => 'channel',
),
// --------------
// --- Player ---
// --------------
// === Basic Defaults ===
// --- Defaults Note ---
// 2.5.0: added note about defaults being overrideable in widgets
'player_defaults_note' => array(
'type' => 'note',
'label' => __( 'Player Defaults Note', 'stream-player' ),
'helper' => __( 'Note that you can override these defaults in specific Player Widgets.', 'stream-player' ),
'tab' => 'player',
'section' => 'basic',
),
// --- [Player] Player Script ---
'player_script' => array(
'type' => 'select',
'label' => __( 'Player Script', 'stream-player' ),
'default' => 'jplayer',
'options' => array(
'jplayer' => __( 'jPlayer', 'stream-player' ),
'howler' => __( 'Howler', 'stream-player' ),
'amplitude' => __( 'Amplitude', 'stream-player' ),
),
'helper' => __( 'Default audio script to use for playback in the Player.', 'stream-player' ),
'tab' => 'player',
'section' => 'basic',
),
// --- [Player] Fallback Scripts ---
'player_fallbacks' => array(
'type' => 'multicheck',
'label' => __( 'Fallback Scripts', 'stream-player' ),
'default' => array( 'amplitude', 'howler', 'jplayer' ),
'options' => array(
'jplayer' => __( 'jPlayer', 'stream-player' ),
'howler' => __( 'Howler', 'stream-player' ),
'amplitude' => __( 'Amplitude', 'stream-player' ),
),
'helper' => __( 'Enabled fallback audio scripts to try when the default Player script fails.', 'stream-player' ),
'tab' => 'player',
'section' => 'basic',
),
// --- [Player] Player Theme ---
'player_theme' => array(
'type' => 'select',
'label' => __( 'Default Player Theme', 'stream-player' ),
'default' => 'light',
'options' => array(
'light' => __( 'Light', 'stream-player' ),
'dark' => __( 'Dark', 'stream-player' ),
),
'helper' => __( 'Default Player Controls theme style.', 'stream-player' ),
'tab' => 'player',
'section' => 'basic',
),
// --- [Player] Player Buttons ---
'player_buttons' => array(
'type' => 'select',
'label' => __( 'Default Player Buttons', 'stream-player' ),
'default' => 'rounded',
'options' => array(
'circular' => __( 'Circular Buttons', 'stream-player' ),
'rounded' => __( 'Rounded Buttons', 'stream-player' ),
'square' => __( 'Square Buttons', 'stream-player' ),
),
'helper' => __( 'Default Player Buttons shape style.', 'stream-player' ),
'tab' => 'player',
'section' => 'basic',
),
// --- [Player] Volume Controls ---
'player_volumes' => array(
'type' => 'multicheck',
'label' => __( 'Volume Controls', 'stream-player' ),
'default' => array( 'slider', 'updown', 'mute', 'max' ),
'options' => array(
'slider' => __( 'Volume Slider', 'stream-player' ),
'updown' => __( 'Volume Plus / Minus', 'stream-player' ),
'mute' => __( 'Mute Volume Toggle', 'stream-player' ),
'max' => __( 'Maximize Volume', 'stream-player' ),
),
'helper' => __( 'Which volume controls to display in the Player by default.', 'stream-player' ),
'tab' => 'player',
'section' => 'basic',
),
// --- [Player] Player Debug Mode ---
'player_debug' => array(
'type' => 'checkbox',
'label' => __( 'Player Debug Mode', 'stream-player' ),
'default' => '',
'value' => 'yes',
'helper' => __( 'Output player debug information in browser javascript console.', 'stream-player' ),
'tab' => 'player',
'section' => 'basic',
'pro' => false,
),
// === Player Colors ===
// --- [Pro/Player] Playing Highlight Color ---
'player_playing_color' => array(
'type' => 'color',
'label' => __( 'Playing Icon Highlight Color', 'stream-player' ),
'default' => '#70E070',
'helper' => __( 'Default highlight color to use for Play button icon when playing.', 'stream-player' ),
'tab' => 'player',
'section' => 'colors',
'pro' => true,
),
// --- [Pro/Player] Control Icons Highlight Color ---
'player_buttons_color' => array(
'type' => 'color',
'label' => __( 'Control Icons Highlight Color', 'stream-player' ),
'default' => '#00A0E0',
'helper' => __( 'Default highlight color to use for Control button icons when active.', 'stream-player' ),
'tab' => 'player',
'section' => 'colors',
'pro' => true,
),
// --- [Pro/Player] Volume Knob Color ---
'player_thumb_color' => array(
'type' => 'color',
'label' => __( 'Volume Knob Color', 'stream-player' ),
'default' => '#80C080',
'helper' => __( 'Default Knob Color for Player Volume Slider.', 'stream-player' ),
'tab' => 'player',
'section' => 'colors',
'pro' => true,
),
// --- [Pro/Player] Volume Track Color ---
'player_range_color' => array(
'type' => 'coloralpha',
'label' => __( 'Volume Track Color', 'stream-player' ),
'default' => '#80C080',
'helper' => __( 'Default Track Color for Player Volume Slider.', 'stream-player' ),
'tab' => 'player',
'section' => 'colors',
'pro' => true,
),
// === Advanced Defaults ===
// --- [Player] Player Volume ---
'player_volume' => array(
'type' => 'number',
'label' => __( 'Player Start Volume', 'stream-player' ),
'default' => 77,
'min' => 0,
'step' => 1,
'max' => 100,
'helper' => __( 'Initial volume for when the Player starts playback.', 'stream-player' ),
'tab' => 'player',
'section' => 'advanced',
),
// --- [Player] Single Player ---
'player_single' => array(
'type' => 'checkbox',
'label' => __( 'Single Player at Once', 'stream-player' ),
'default' => 'yes',
'value' => 'yes',
'helper' => __( 'Stop any existing Players on the page or in other windows or tabs when a Player is started.', 'stream-player' ),
'tab' => 'player',
'section' => 'advanced',
),
// --- [Pro/Player] Player Autoresume ---
'player_autoresume' => array(
'type' => 'checkbox',
'label' => __( 'Autoresume Playback', 'stream-player' ),
'default' => 'yes',
'value' => 'yes',
'helper' => __( 'Attempt to resume playback if visitor was playing. Only triggered when the user first interacts with the page.', 'stream-player' ),
'tab' => 'player',
'section' => 'advanced',
'pro' => true,
),
// --- [Pro/Player] Popup Player Button ---
// 2.5.0: enabled popup player button
'player_popup' => array(
'type' => 'checkbox',
'label' => __( 'Popup Player Button', 'stream-player' ),
'default' => '',
'value' => 'yes',
'helper' => __( 'Add button to open Popup Player in separate window.', 'stream-player' ),
'tab' => 'player',
'section' => 'advanced',
'pro' => true,
),
// ------------------
// --- Player Bar ---
// ------------------
// === Display ===
// --- Player Bar Note ---
'player_bar_note' => array(
'type' => 'note',
'label' => __( 'Bar Defaults Note', 'stream-player' ),
'helper' => __( 'The Bar Player uses the default configurations set above.', 'stream-player' )
. ' ' . __( 'You can override these in specific Player Widgets.', 'stream-player' ),
'tab' => 'bar',
'section' => 'display',
),
// --- [Pro/Player] Sitewide Player Bar ---
'player_bar' => array(
'type' => 'select',
'label' => __( 'Sitewide Player Bar', 'stream-player' ),
'default' => 'off',
'options' => array(
'off' => __( 'No Player Bar', 'stream-player' ),
'top' => __( 'Top Player Bar', 'stream-player' ),
'bottom' => __( 'Bottom Player Bar', 'stream-player' ),
),
'tab' => 'bar',
'section' => 'display',
'helper' => __( 'Add a fixed position Player Bar which displays Sitewide.', 'stream-player' ),
'pro' => true,
),
// --- [Pro/Player] Player Bar Height ---
'player_bar_height' => array(
'type' => 'number',
'min' => 40,
'max' => 400,
'step' => 1,
'label' => __( 'Player Bar Height', 'stream-player' ),
'default' => 80,
'tab' => 'bar',
'section' => 'display',
'helper' => __( 'Set the height of the Sitewide Player Bar in pixels.', 'stream-player' ),
'pro' => true,
),
// --- [Pro/Player] Fade In Player Bar ---
'player_bar_fadein' => array(
'type' => 'number',
'label' => __( 'Fade In Player Bar', 'stream-player' ),
'default' => 2500,
'min' => 0,
'step' => 100,
'max' => 10000,
'helper' => __( 'Number of milliseconds after Page load over which to fade in Player Bar. Use 0 for instant display.', 'stream-player' ),
'tab' => 'bar',
'section' => 'display',
'pro' => true,
),
// --- [Pro/Player] Bar Player Text Color ---
'player_bar_text' => array(
'type' => 'color',
'label' => __( 'Bar Player Text Color', 'stream-player' ),
'default' => '#FFFFFF',
'helper' => __( 'Text color for the fixed position Sitewide Bar Player.', 'stream-player' ),
'tab' => 'bar',
'section' => 'display',
'pro' => true,
),
// --- [Pro/Player] Bar Player Background Color ---
'player_bar_background' => array(
'type' => 'coloralpha',
'label' => __( 'Bar Player Background Color', 'stream-player' ),
'default' => 'rgba(0,0,0,255)',
'helper' => __( 'Background color for the fixed position Sitewide Bar Player.', 'stream-player' ),
'tab' => 'bar',
'section' => 'display',
'pro' => true,
),
// === Persistent Player ===
// --- [Pro/Player] Continuous Playback ---
'player_bar_continuous' => array(
'type' => 'checkbox',
'label' => __( 'Continuous Playback', 'stream-player' ),
'default' => 'yes',
'value' => 'yes',
'helper' => __( 'Uninterrupted Sitewide Bar playback while user is navigating between pages! Pages are loaded in background and faded in while Player Bar persists.', 'stream-player' ),
'tab' => 'bar',
'section' => 'persistent',
'pro' => true,
),
// --- [Pro/Player] Player Page Fade ---
'player_bar_pagefade' => array(
'type' => 'number',
'label' => __( 'Page Fade Time', 'stream-player' ),
'default' => 2000,
'min' => 0,
'step' => 100,
'max' => 10000,
'helper' => __( 'Number of milliseconds over which to fade in new Pages (when continuous playback is enabled.) Use 0 for instant display.', 'stream-player' ),
'tab' => 'bar',
'section' => 'persistent',
'pro' => true,
),
// --- [Pro/Player] Page Load Timeout ---
'player_bar_timeout' => array(
'type' => 'number',
'label' => __( 'Page Load Timeout', 'stream-player' ),
'default' => 7000,
'min' => 0,
'step' => 500,
'max' => 20000,
'helper' => __( 'Number of milliseconds to wait for new Page to load before fading in anyway (when continuous playback is enabled.)', 'stream-player' ),
'tab' => 'bar',
'section' => 'persistent',
'pro' => true,
),
// === Metadata ===
// --- [Pro/Player] Display Metadata ---
'player_bar_nowplaying' => array(
'type' => 'checkbox',
'label' => __( 'Display Now Playing', 'stream-player' ),
'value' => 'yes',
'default' => 'yes',
'tab' => 'bar',
'section' => 'metadata',
'helper' => __( 'Display the currently playing song in the Player Bar, if a supported metadata format is available. (Icy Meta, Icecast, Shoutcast 1/2, Current Playlist)', 'stream-player' ),
'pro' => true,
),
// --- [Pro/Player] Metadata URL ---
'player_bar_metadata' => array(
'type' => 'text',
'options' => 'URL',
'label' => __( 'Metadata URL', 'stream-player' ),
'default' => '',
'tab' => 'bar',
'section' => 'metadata',
'helper' => __( 'Now playing metadata is normally retrieved via the Stream URL. Use this setting if you need to provide an alternative metadata location.', 'stream-player' ),
'pro' => true,
),
// --- [Pro/Player] Track Animation ---
'player_bar_track_animation' => array(
'type' => 'select',
'label' => __( 'Track Animation', 'stream-player' ),
'default' => 'backandforth',
'options' => array(
'none' => __( 'No Animation', 'stream-player' ),
'lefttoright' => __( 'Left to Right Ticker', 'stream-player' ),
'righttoleft' => __( 'Right to Left Ticker', 'stream-player' ),
'backandforth' => __( 'Back and Forth', 'stream-player' ),
),
'tab' => 'player',
'section' => 'bar',
'helper' => __( 'How to animate the currently playing track display.', 'stream-player' ),
'pro' => true,
),
// === Tabs and Sections ===
// --- Tab Labels ---
'tabs' => array(
'stream' => __( 'Stream', 'stream-player' ),
'player' => __( 'Player', 'stream-player' ),
'bar' => __( 'Bar', 'stream-player' ),
),
// --- Section Labels ---
'sections' => array(
'source' => __( 'Source', 'stream-player' ),
'channel' => __( 'Channel', 'stream-player' ),
'basic' => __( 'Basic Defaults', 'stream-player' ),
'colors' => __( 'Player Colors', 'stream-player' ),
'advanced' => __( 'Advanced Defaults', 'stream-player' ),
'display' => __( 'Bar Display', 'stream-player' ),
'persistent' => __( 'Persistent Playback', 'stream-player' ),
'metadata' => __( 'Metadata Display', 'stream-player' ),
),
);