diff --git a/ext/handle_video/main.php b/ext/handle_video/main.php index 53e65ad6..4fd5d80a 100644 --- a/ext/handle_video/main.php +++ b/ext/handle_video/main.php @@ -4,6 +4,7 @@ abstract class VideoFileHandlerConfig { public const PLAYBACK_AUTOPLAY = "video_playback_autoplay"; public const PLAYBACK_LOOP = "video_playback_loop"; + public const PLAYBACK_MUTE = "video_playback_mute"; public const ENABLED_FORMATS = "video_enabled_formats"; } @@ -27,6 +28,7 @@ class VideoFileHandler extends DataHandlerExtension $config->set_default_bool(VideoFileHandlerConfig::PLAYBACK_AUTOPLAY, true); $config->set_default_bool(VideoFileHandlerConfig::PLAYBACK_LOOP, true); + $config->set_default_bool(VideoFileHandlerConfig::PLAYBACK_MUTE, false); $config->set_default_array( VideoFileHandlerConfig::ENABLED_FORMATS, [MIME_TYPE_FLASH_VIDEO, MIME_TYPE_MP4_VIDEO, MIME_TYPE_OGG_VIDEO, MIME_TYPE_WEBM] @@ -45,11 +47,12 @@ class VideoFileHandler extends DataHandlerExtension public function onSetupBuilding(SetupBuildingEvent $event) { $sb = new SetupBlock("Video Options"); - $sb->add_bool_option(VideoFileHandlerConfig::PLAYBACK_AUTOPLAY, "Autoplay: "); - $sb->add_label("
"); - $sb->add_bool_option(VideoFileHandlerConfig::PLAYBACK_LOOP, "Loop: "); - $sb->add_label("
Enabled Formats:"); - $sb->add_multichoice_option(VideoFileHandlerConfig::ENABLED_FORMATS, $this->get_options()); + $sb->start_table(); + $sb->add_bool_option(VideoFileHandlerConfig::PLAYBACK_AUTOPLAY, "Autoplay", true); + $sb->add_bool_option(VideoFileHandlerConfig::PLAYBACK_LOOP, "Loop", true); + $sb->add_bool_option(VideoFileHandlerConfig::PLAYBACK_MUTE, "Mute", true); + $sb->add_multichoice_option(VideoFileHandlerConfig::ENABLED_FORMATS, $this->get_options(), "Enabled Formats", true); + $sb->end_table(); $event->panel->add_block($sb); } diff --git a/ext/handle_video/theme.php b/ext/handle_video/theme.php index 6149131b..b38516ea 100644 --- a/ext/handle_video/theme.php +++ b/ext/handle_video/theme.php @@ -11,6 +11,7 @@ class VideoFileHandlerTheme extends Themelet $full_url = make_http($ilink); $autoplay = $config->get_bool(VideoFileHandlerConfig::PLAYBACK_AUTOPLAY); $loop = $config->get_bool(VideoFileHandlerConfig::PLAYBACK_LOOP); + $mute = $config->get_bool(VideoFileHandlerConfig::PLAYBACK_MUTE); $player = make_link('vendor/bower-asset/mediaelement/build/flashmediaelement.swf'); $width="auto"; @@ -56,9 +57,10 @@ class VideoFileHandlerTheme extends Themelet } else { $autoplay = ($autoplay ? ' autoplay' : ''); $loop = ($loop ? ' loop' : ''); + $mute = ($mute ? ' muted' : ''); $html .= " -