Support » Plugin: Velocity - Video Lazy Loading for YouTube, Twitch and Vimeo » Where do we place the youtubes http:url for the video

  • Resolved ccwordpressf

    (@ccwordpressf)


    Hello,

    Where in the velocity shortcode creation panel do we place the http:url for either the youtube, vimeo or soundcloud iframe?

    I also get undefined variable sounde_type.

    Here is the code I have for getting and echoing the video from the content editor:

    function thirty_eight_get_embedded_media( $type = array() ){

    $content = do_shortcode( apply_filters( ‘the_content’, get_the_content() ) );
    $embed = get_media_embedded_in_content( $content, $type );
    if( in_array( ‘audio’, $type ) ){
    $output = str_replace( ‘?visual=true’, ‘?visual=false’, $embed[0] );
    } else {
    $output = $embed[0];
    }

    return $output;

    }

    echo get_media_embedded_in_content(array( ‘video’, ‘iframe’) );

    Thanks for the help and guidance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author dcooney

    (@dcooney)

    Hi @ccwordpressf,
    I’ve released a fixed for that warning notice.

    You pass the youtube ID, not the iframe code.

    As seen here – https://connekthq.com/plugins/velocity/
    [velocity type="youtube" id="2smWSF_NGWk" options="showinfo=0" img="https://connekthq.com/wp-content/uploads/snooooooopdogg.jpg" alt="Play Video" color="#000000" bkg_color="#FFFFFF"]

    Hope this helps.

    Thread Starter ccwordpressf

    (@ccwordpressf)

    dcooney,

    thanks for the quick response.

    I am using this code to grab the first video, audio:

    function thirty_eight_get_embedded_media( $type = array() ){

    $content = do_shortcode( apply_filters( ‘the_content’, get_the_content() ) );
    $embed = get_media_embedded_in_content( $content, $type );
    if( in_array( ‘audio’, $type ) ){
    $output = str_replace( ‘?visual=true’, ‘?visual=false’, $embed[0] );
    } else {
    $output = $embed[0];
    }

    return $output;

    }

    echo get_media_embedded_in_content(array( ‘video’, ‘iframe’) );

    QUESTION: how can i grab your shortcode instead?

    Plugin Author dcooney

    (@dcooney)

    I’m still not completely sure what you are doing in the code above.

    But if you can grab the video type and ID then you can just render out the shortcode in the place of the video.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Where do we place the youtubes http:url for the video’ is closed to new replies.