On our homepage of this site we have a play button. Clicking it opens a youtube video in full screen.
I’d like to turn off the related videos that appear at the end of the video, however ?rel=0 is not registering.
I added the code below to functions.php and specified the extra class, but to no avail.
function sf_video_youtube($url, $width = 640, $height = 480) {
preg_match('/[\\?\\&]v=([^\\?\\&]+)/', $url, $video_id);
$youtube_params = apply_filters('sf_youtube_embed_params', '?wmode=transparent&rel=0');
$video_padding = (intval($height, 10) / intval($width, 10)) * 100;
$inline_style = 'padding-bottom: '.$video_padding.'%;';
if (is_ssl()) {
return '<div class="sf-video-wrap" style="'.$inline_style.'"><iframe itemprop="video" class="video-embed" src="https://www.youtube.com/embed/'. $video_id[1] . $youtube_params .'" width="'. $width .'" height="'. $height .'" ></iframe></div>';
} else {
return '<div class="sf-video-wrap" style="'.$inline_style.'"><iframe itemprop="video" class="video-embed" src="http://www.youtube.com/embed/'. $video_id[1] . $youtube_params .'" width="'. $width .'" height="'. $height .'" ></iframe></div>';
}
}
?>
Can you help us out here?
Thanks,
Shevi