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

220
Views
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 answers
Answer question

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 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!