[wp-hackers] stopping an embedded video with javascript

Nikola Nikolov nikolov.tmw at gmail.com
Wed Sep 11 17:07:57 UTC 2013


As a side note - I believe that pausing the carousel is the better solution
to this problem. I personally would dislike if I start watching a video and
then out of a sudden it scrolls out of view(no matter whether pausing or
not).

But that's just my opinion :)


On Wed, Sep 11, 2013 at 8:05 PM, Otto <otto at ottodestruct.com> wrote:

> Perhaps not. Try something like this:
>
>
> http://stackoverflow.com/questions/7443578/youtube-iframe-api-how-do-i-control-a-iframe-player-thats-already-in-the-html
>
> -Otto
>
>
> 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
> _______________________________________________
> 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