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

152
Views
Javascript: Detect mouse click vs video.play() OR use video.play() without triggering an event

I wan't to know if there is a modern way to detect how an event was triggered i.e. if it was a mouse click or was the code video.play() ran (With video of course being the result of a document.getElementById('video')). And if not is there a way to run video.play() without triggering an event (this seems unlikely but i'll take a shot at asking).

My issue is that i'm building a system to play videos in sync. So when I send a request to play a video and the other user receives that request it uses video.play() to play their video. Only problem is when video.play() fires on the receiving end it also triggers the event to send a request back to the original user to play the video which ends up sending two requests, this can easily turn into an infinite loop if a user clicks pause / play during this period.

about 4 years ago · Juan Pablo Isaza
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!