How to get player instance for already initialized videos?
Briareos17 opened this issue · 7 comments
I have slider with video in some slides, I need to control video playback when slide goes active or goes out, How can I get Player instance to use play() stop() methods?
It sounds like you're using some slideshow package to play YouTube videos? I would look at the documentation for your slideshow package. Without additional info, I can't help you.
I'm using Slick but does not matter what I am using, because question about getting player instance from selected DOM element.
For example $('.player').player.play()
or something like this.
There's no way to get the player instance from the selected DOM element. I would change the code that creates the player so that it provides a way for you to get access to the yt-player
instance.
Thanks a lot, it would be great.
@Briareos17 Sorry if I wasn't clear. I was suggesting that you should change the code in Slick, since I don't know how it works and it's not part of this project. Cheers.
@feross Problem not in slick itself, Let's imagine that I handling event on slide change, so I get current slide DOM element, and i know that this element has player inside And I want to programmatically start playing video. So question is - how can I get YTPlayer instance from player element to trigger play()?
Sorry, but my English knowlage is no so good to give more detailed explanation.
Sorry, we can't add support for what you're asking in this library. Find another approach to solve your problem.