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

269
Views
Intenté pausar el video en html cuando el usuario cambia la pestaña del navegador y cuando vuelve a esa pestaña, el video se reproduce automáticamente desde donde se detuvo.

este es un script de etiqueta de video simple que uso en mi documento html

var video = document.getElementById('video'); var título del documento = documento.título; var updateTitleForVideo = function(estado) { if(estado === 'visible') { document.title=documentTitle; devolver; } document.title = documentTitle + ' ['+ state +']'; }; video.onpause = function() { updateTitleForVideo('Paused'); }; video.onplay = function() { updateTitleForVideo('Reproducido'); }; document.addEventListener('visibilitychange' , function(){ var state = document.visibilityState; if(!video.paused){ if(state === 'hidden'){ video.pause(); updateTitleForVideo('Paused') ; } } if(!video.played){ if(state === 'visible'){ video.play(); updateTitleForVideo('Played'); } } });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

const video = document.getElementById("video") //The rest of your code // video.onpause etc... window.addEventListener("blur", function() { video.pause(); }) window.addEventListener("focus", function(){ video.play(); })

más información

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!