Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

213
Views
Detect when users click on buttons in Youtube bar

I'm sure this should to be quite easy, but I can't find the answer elsewhere...

I'm embedding a youtube (live) video on my domain through an iframe. I've managed to detect when the user clicks on the pause/play button using javascript events defined in onYouTubeIframeAPIReady. I'd like to detect when the user clicks on the speaker icon (sound muted/sound on), on the fullscreen button, and also when he/she clicks on the "go to youtube" button.

Is this posisble?

Thanks in advance for your help.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can utilize Youtube Embed API and hide standard controls with controls:0 option. Add your own controls with all callbacks/event handlers you need.

Best option — you can use Player Events and act accordingly. There is onStateChange available, so, you can detect and verify pause/unpause. Mute status can be verified too - you need to check muted status with isMuted() method constantly.

For Youtube button click I see this way to check - you can monitor window active state via visibilitychange and check iframe focus state to get video details (will not work in fullscreen I guess).

For fullscreen - fullscreenchange event. In coupe with current active (playing) video you can check exact embedded video where fullscreen was clicked. Im not sure about the situation when fullscreen was clicked before play button was clicked by user.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!