Answer the question
In order to leave comments, you need to log in
How to perform some action when clicking on play youtube video (if there are many of them on the page)?
Good afternoon.
The situation is as follows: there are several youtube videos on the WordPress page, which are inserted using the Youtube wordpress plugin as follows:
[embedyt]link_to_video[/embedyt]. I need to perform some action (for example, alert('aaa');) if the user clicked on the play/pause button on any of these videos.
Answer the question
In order to leave comments, you need to log in
Why does no one know how to search for information? There are manuals for this API in Russian.
https://developers.google.com/youtube/iframe_api_r... -- see example. It is worth paying attention to YT.PlayerState.PLAYING (judging by the code it has the value true/false).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question