[wp-hackers] stopping an embedded video with javascript

Otto otto at ottodestruct.com
Wed Sep 11 17:05:44 UTC 2013

Perhaps not. Try something like this:



On Wed, Sep 11, 2013 at 11:59 AM, Steve Taylor <steve at sltaylor.co.uk> wrote:
> FYI, what I'm dealing with is a carousel with images and videos.
> Ideally I would pause a video if it's playing as it's scrolled out of
> view in the carousel.
>> // Get element holding the video (embed or object)
>> var player = document.getElementById("youtube_player");
> I think this is what I'm looking for. But since wp_oembed_get()
> outputs an iframe, I assume cross-domain stuff prevent me manipulating
> the player? Do I need to do my own custom embedding to let me access
> the API?
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list