I am using Magic Fields 2 to add custom fields/meta boxes.
One custom field is for a Vimeo or YouTube video URL to be displayed.
The following code oEmbeds the video URL:
<?php if (!((get_post_meta($post->ID, 'video_url', TRUE))=='')) {
echo wp_oembed_get( get_post_meta($post->ID, "video_url", true) );
}?>
To resize the video, I have used added the code inside <div class="video">
and resized it using CSS - .video iframe {width:500px;height:312px}
.
The problem, this method is not responsive.
I have also tried .video iframe {width:95%;height:95%}
. This outputs looks like -
The Fluid Video Embeds plugin seems to do the job for oEmbeds through the normal WordPress method and through shortcode, but not with using a custom field.