[wp-hackers] stopping an embedded video with javascript

Steve Taylor steve at sltaylor.co.uk
Wed Sep 11 11:03:07 UTC 2013

Hi folks,

Does anyone know how to stop the playing of an embedded video (e.g.
YouTube) using JavaScript?

I'm looking at the YT docs
(https://developers.google.com/youtube/player_parameters) and the WP
core source, but I'm having trouble finding how to target the actual
player object.

I'm embedding the actual video programmatically, something like this:

echo wp_oembed_get( $url . '&enablejsapi=1', array( 'width' => 500,
'height' => 362 ) );

Any pointers welcome!



More information about the wp-hackers mailing list