Youtube video is not pausing when change the slide #192
-
I have tried with below code. const pauseVieo = () => { <Lightbox In the above method not able get what is player object. Even if i get it after reading from documentation, how it will connect this youtube video. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I do not see you even trying to obtain the player object. Calling a method of an undefined object is not going to magically work. Here is how you can solve this problem:
Alternatively, you can use a 3rd-party library like react-youtube as you may find it easier to use. p.s. Please consider formatting your code in the future, as good manners can go a long way. |
Beta Was this translation helpful? Give feedback.
I do not see you even trying to obtain the player object. Calling a method of an undefined object is not going to magically work.
Here is how you can solve this problem:
offset !== 0
and pause video if it's playing.Alternatively, you can use a 3rd-party library like react-youtube as you may find it easier to use.
p.s. Please consider formatting your code in the future, as good manners can go a long way.