@@ -131,6 +131,7 @@ function ableplayer_settings_field( $args = array() ) {
131131 case 'text ' :
132132 case 'url ' :
133133 case 'email ' :
134+ case 'number ' :
134135 if ( $ note ) {
135136 $ note = sprintf ( str_replace ( '% ' , '' , $ note ), "<code> $ value</code> " );
136137 $ note = "<span id=' $ id-note' class='ableplayer-input-description'><i class='dashicons dashicons-editor-help' aria-hidden='true'></i> $ note</span> " ;
@@ -257,15 +258,19 @@ function ableplayer_update_settings( $post ) {
257258 $ replace_audio = ( ! empty ( $ post ['replace_audio ' ] ) && 'on ' === $ post ['replace_audio ' ] ) ? 'true ' : 'false ' ;
258259 $ replace_playlists = ( ! empty ( $ post ['replace_playlists ' ] ) && 'on ' === $ post ['replace_playlists ' ] ) ? 'true ' : 'false ' ;
259260 $ youtube_nocookie = ( ! empty ( $ post ['youtube_nocookie ' ] ) && 'on ' === $ post ['youtube_nocookie ' ] ) ? 'true ' : 'false ' ;
261+ $ play_inline = ( ! empty ( $ post ['play_inline ' ] ) && 'on ' === $ post ['play_inline ' ] ) ? 'true ' : 'false ' ;
260262 $ render_transcript = ( ! empty ( $ post ['render_transcript ' ] ) && 'on ' === $ post ['render_transcript ' ] ) ? 'true ' : 'false ' ;
261263 $ hide_controls = ( ! empty ( $ post ['hide_controls ' ] ) && 'on ' === $ post ['hide_controls ' ] ) ? 'true ' : 'false ' ;
262264 $ default_speed = ( isset ( $ post ['default_speed ' ] ) ) ? $ post ['default_speed ' ] : 'animals ' ;
263- $ default_heading = ( isset ( $ post ['default_heading ' ] ) ) ? $ post ['default_heading ' ] : 'auto ' ;
265+ $ seek_interval = ( isset ( $ post ['seek_interval ' ] ) && $ post ['seek_interval ' ] > 5 ) ? absint ( $ post ['seek_interval ' ] ) : '' ;
266+ $ default_heading = ( isset ( $ post ['default_heading ' ] ) ) ? absint ( $ post ['default_heading ' ] ) : 'auto ' ;
264267
265268 $ settings ['replace_video ' ] = $ replace_video ;
266269 $ settings ['replace_audio ' ] = $ replace_audio ;
267270 $ settings ['replace_playlists ' ] = $ replace_playlists ;
268271 $ settings ['youtube_nocookie ' ] = $ youtube_nocookie ;
272+ $ settings ['seek_interval ' ] = $ seek_interval ;
273+ $ settings ['play_inline ' ] = $ play_inline ;
269274 $ settings ['render_transcript ' ] = $ render_transcript ;
270275 $ settings ['hide_controls ' ] = $ hide_controls ;
271276 $ settings ['default_speed ' ] = $ default_speed ;
@@ -357,6 +362,17 @@ function ableplayer_settings_form() {
357362 </p>
358363 <p>
359364 <?php
365+ ableplayer_settings_field (
366+ array (
367+ 'name ' => 'play_inline ' ,
368+ 'label ' => __ ( 'Force mobile devices to play inline, instead of using their own media player. ' , 'ableplayer ' ),
369+ 'type ' => 'checkbox-single ' ,
370+ )
371+ );
372+ ?>
373+ </p>
374+ <p>
375+ <?php
360376 ableplayer_settings_field (
361377 array (
362378 'name ' => 'render_transcript ' ,
@@ -383,6 +399,21 @@ function ableplayer_settings_form() {
383399 </p>
384400 <p>
385401 <?php
402+ ableplayer_settings_field (
403+ array (
404+ 'name ' => 'seek_interval ' ,
405+ 'label ' => __ ( 'Default seek interval in seconds. ' , 'ableplayer ' ),
406+ 'type ' => 'number ' ,
407+ 'atts ' => array (
408+ 'min ' => 5 ,
409+ 'step ' => 5 ,
410+ )
411+ )
412+ );
413+ ?>
414+ </p>
415+ <p>
416+ <?php
386417 ableplayer_settings_field (
387418 array (
388419 'name ' => 'hide_controls ' ,
@@ -534,8 +565,10 @@ function ableplayer_default_settings() {
534565 'replace_audio ' => 'false ' ,
535566 'replace_playlists ' => 'false ' ,
536567 'youtube_nocookie ' => 'false ' ,
568+ 'play_inline ' => 'true ' ,
537569 'render_transcript ' => 'true ' ,
538570 'default_speed ' => 'animals ' ,
571+ 'seek_interval ' => '30 ' ,
539572 'hide_controls ' => 'false ' ,
540573 'default_heading ' => 'auto ' ,
541574 );
0 commit comments