A
A
Amir2017-07-14 09:43:47
YouTube
Amir, 2017-07-14 09:43:47

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.
How can I do it?
Thanks in advance for the replies.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Morgunov, 2017-07-14
@toruk0109

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 question

Ask a Question

731 491 924 answers to any question