Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

162
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda