if (null === $height) {
$height = $link->height;
}
- return '<iframe width="' . $width . '" height="' . $height . '" src="' . self::getEmbedURL($link) . '" frameborder="0" allowfullscreen></iframe>';
+ return '<iframe width="' . $width . '" height="' . $height . '" src="' . self::getEmbedURL($link) . '" frameborder="0" allowfullscreen allow="autoplay"></iframe>';
}
public static function getEmbedURL($data) {
+ $sound = $data->video_sound_on ? '1' : '0';
+ $muted = (!$data->video_sound_on) ? '1' : '0';
+ $autoplay = $data->video_auto_start ? '1' : '0';
+ $loop = $data->video_loop ? '1' : '0';
switch ($data->video_service) {
case 0:
case 'youtube':
return 'https://www.dailymotion.com/embed/video/' . $data->to;
case 2:
case 'vimeo':
- return 'https://player.vimeo.com/video/' . $data->to;
+ return 'https://player.vimeo.com/video/' . $data->to . '?autoplay=' . $autoplay . '&loop=' . $loop . '&muted=' . $muted;
case 3:
default:
return $data->to;