Support

Account

Home Forums ACF PRO oEmbed – Animoto Video not displaying

Helping

oEmbed – Animoto Video not displaying

  • I have a new oEmbed field created in ACF PRO 5.1 and I have the default code in my custom template PHP file.

    I am able to enter a YouTube video shortcode URL into the new field and it will display perfectly on my site page. But when I enter an Animoto video shortcode URL into the field it will not display and in fact the URL is not even included in the code to render the page.

    Does anyone know why YouTube works but not Animoto? I can enter the Animoto URL directly into content area of a Page/Post and it will work but not when it’s entered into the ACF custom field on the Page/Post.

    I have also noticed that when I enter a YouTube video shortcode in the field on the Page it disappears and the video does not display in the box. And when I enter an Animoto video shortcut URL into the field on the Page it remains visible and the video starts to play in the box below the field.

    <div class="video-wrap">
    <?php
    
    // get iframe HTML
    $iframe = get_field('oembed');
    
    // use preg_match to find iframe src
    preg_match('/src="(.+?)"/', $iframe, $matches);
    $src = $matches[1];
    
    // add extra params to iframe src
    $params = array(
        'controls'    => 0,
        'hd'        => 1,
        'autohide'    => 1
    );
    
    $new_src = add_query_arg($params, $src);
    
    $iframe = str_replace($src, $new_src, $iframe);
    
    // add extra attributes to iframe html
    $attributes = 'frameborder="0"';
    
    $iframe = str_replace('></iframe>', ' ' . $attributes . '></iframe>', $iframe);
    
    // echo $iframe
    echo $iframe;
    
    ?>
    	</div>
  • Hi @gixxer188,

    Thanks for the post.

    I am afraid I cannot replicate this on my end, this must have been as a result of a bug on the earlier release or perhaps a conflict on your website.

    It is always important to rule out plugin related conflicts by testing the issue on one of the stock WP themes and with all other plugins deactivated.

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

You must be logged in to reply to this topic.