The oEmbed feature in ACF is wonderfull.
But, there is always a ‘but’…
How can I make sure my video files (from vimeo) are scaled proportionately.
Somehow I always end up with a black bar above and beneath the video file.
And I don’t want that. If the video is 1280×720 I want it to appear relative to these dimensions, meaning that if I DIV with a width of, say, 800 px to show the video, the height must be 450 (this corresponds to the 16:9 rule).
How can I do that?
I found a workaround with the ‘Fluid Video Embeds’ plugin.
This plugin also uses shortcodes, so I’ve put the shortcode in my template:
$row_video = $select_row['movie'];
echo '<div class="video-container">';
echo do_shortcode('[fve]'. $row_video .'[/fve]');
This works, but I would like to see it working directly from ACF without the use of an extra plugin.
Thanks for the post.
For some oEmbed providers such as YouTube, you can create an <iFrame> and append player parameters directly to the end of the URL.
The code would look like so:
<iframe id="ytplayer" type="text/html" width="640" height="390"