New Landing How can we help? Themeforest Theme Support Joyn Options for youtube videos

Viewing 4 posts - 1 through 4 (of 4 total)
  • Posted in: Joyn
  • #203487
    jleon213
    Member
    Post count: 16

    Hello,

    Is there a way to embed a video with additional options? like hide related videos or autoplay.

    I’d like to hide related videos mostly.

    Thanks.

    #203500
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please use this plugin https://wordpress.org/plugins/hide-youtube-related-videos to hide related videos.
    Thanks
    Mohammad

    #203748
    jleon213
    Member
    Post count: 16

    Nope.

    This plugin doesn’t work. Apparently the Joyn theme takes the youtube link and creates the iframe embed code. So there is no way to add the variable that handles related videos.

    The solution i would do is create a raw html module and embed the code myself but this is not optimal if me or my clients need to add several videos.

    This option should be included in the video module itself.

    Thanks.

    #203780
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please paste given below code at functions.php of child theme.

    function sf_get_embed_src( $url ) {
                if ( strpos( $url, 'youtube' ) ) {
                    preg_match( '/[\\?\\&]v=([^\\?\\&]+)/', $url, $video_id );
                    $youtube_params = apply_filters( 'sf_youtube_embed_src_params', '?autoplay=1&rel=0' );
                    if ( is_ssl() ) {
                        if ( isset( $video_id[1] ) ) {
                            return 'https://www.youtube.com/embed/' . $video_id[1] . $youtube_params;
                        }
                    } else {
                        if ( isset( $video_id[1] ) ) {
                            return 'http://www.youtube.com/embed/' . $video_id[1] . $youtube_params;
                        }
                    }
                } else {
                    $url          = str_replace( 'https://', 'http://', $url );
                    $video_id     = sf_get_vimeoid( $url );
                    $vimeo_params = apply_filters( 'sf_vimeo_embed_src_params', '?title=0&byline=0&portrait=0&autoplay=1&rel=0' );
                    if ( is_ssl() ) {
                        if ( $video_id != "" ) {
                            return 'https://player.vimeo.com/video/' . $video_id . $vimeo_params;
                        }
                    } else {
                        if ( $video_id != "" ) {
                            return 'http://player.vimeo.com/video/' . $video_id . $vimeo_params;
                        }
                    }
                }
            }

    Thanks
    Mohammad

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

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register