New Landing How can we help? Themeforest Theme Support Dante Youtube Related Videos

Viewing 8 posts - 1 through 8 (of 8 total)
  • Posted in: Dante
  • #141284
    tzvimoshe
    Member
    Post count: 33

    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

    #141358
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please try out this plugin https://wordpress.org should/plugins/hide-youtube-related-videos/. Hope that should resolve the issue.
    Thanks
    Mohammad

    #141601
    tzvimoshe
    Member
    Post count: 33

    The plugin is already installed and not working.

    #141605
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please provide me specific page url with issue and wordpress admin login detail after installing WPIDE plugin.
    Thanks
    Mohammad

    #141896
    tzvimoshe
    Member
    Post count: 33
    This reply has been marked as private.
    #141904
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    I see that your website is not working. Please just provide me your FTP login detail to resolve the issue easily.
    Thanks
    Mohammad

    #142053
    tzvimoshe
    Member
    Post count: 33

    Hi, the site is back up.
    I see that someone put this code in that took it down…

    function sf_video_youtube($url, $width = 640, $height = 480) {
    preg_match('/[\\?\\&]v=([^\\?\\&]+)/', $url, $video_id);
    return '<iframe itemprop="video" src="http://www.youtube.com/embed/'. $video_id[1] .'?wmode=transparent&rel=0" width="'. $width .'" height="'. $height .'" ></iframe>';
    }

    #142118
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    I have resolved the issue so please check. I used this code.

    function sf_get_embed_src($url) {
    			if (strpos($url,'youtube')){
    				preg_match('/[\\?\\&]v=([^\\?\\&]+)/', $url, $video_id);
    				if (isset($video_id[1])) {
    					return 'http://www.youtube.com/embed/'. $video_id[1] .'?autoplay=1&wmode=transparent&rel=0';
    				}
    			} else {
    				preg_match('/http:\/\/vimeo.com\/(\d+)$/', $url, $video_id);
    				if (isset($video_id[1])) {
    					return 'http://player.vimeo.com/video/'. $video_id[1] .'?title=0&byline=0&portrait=0&autoplay=1&wmode=transparent&rel=0';
    				}
    			}
    		}

    Thanks
    Mohammad

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.