I’m having a problem here:
I am passing this through a custom field: http://www.youtube.com/watch?v=E6P1Q-UycHA&autoplay=1
(notice the autoplay=1
)
But when I load the video on my theme using wp_oembed_get… it displays the video fine, but it does not listen to the autoplay=1
variable I am passing through.
I need the videos to play on the load of the page.
Any ideas?
Thanks,
Alain Fontaine
7 s
Those are not really arguments like for YouTube, more of arguments for WordPress itself.
One way to handle it would be to access your argument later inside of a filter and modify HTML output.
Pass in arguments array:
wp_oembed_get( 'http://www.youtube.com/watch?v=', array( 'autoplay' => 1 ) );
And filter:
add_filter('oembed_result','oembed_result', 10, 3);
function oembed_result($html, $url, $args) {
// $args includes custom argument
// modify $html as you need
return $html;
}