Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

221
Vistas
View video once and redirect to another website

I have been assigned with task of only allowing a video to be viewed once using WordPress website and after being watch once and the video end, have the website URL redirect to another page. The video does not play but still redirect after 1 minutes.

Here is my code

[videojs_video url="http://tecfa.unige.ch/guides/html/html5-video/videos/state-of-wikipedia-480x272.mp4" preload="auto" controls ="false" autoplay = "true" loop="true"]
    <script>
         setTimeout(function(){
            window.location.href = 'https://www.tutorialspoint.com/javascript/';
         }, 60000);
      </script>
      <p>Web page redirects after 1 minute.</p>
   
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use the ended event to detect if the video has finished playing:

let myVideo = document.getElementById('my-video');

myVideo.addEventListener('ended', videoCompleted, false);

function videoCompleted(e) {
  console.log('video has completed');
  window.location.href = 'https://www.tutorialspoint.com/javascript/';
}
<video controls src="https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_640_3MG.mp4" id="my-video"></video>

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda