view raw
jalf jalf - 5 months ago 48
Javascript Question

Redirect html5 video after play

I have an html 5 video which i remove the control buttons and added a js code in order for the user to play the video when the video is clicked. What I need to do is to bind an additional script that will redirect the page after the video plays without a page reload. Below is my js code.

function play(){
var video = document.getElementById('video');

And Here is my HTML5 Video Code

<video id="video" width="770" height="882" onclick="play();">
<source src="video/Motion.mp4" type="video/mp4" />

<script src="text/javascript">
// Do not name the function "play()"
function playVideo(){
    var video = document.getElementById('video');;
        window.location = '';
<video controls id="video" width="770" height="882" onclick="playVideo()">
    <source src="video/Motion.mp4" type="video/mp4" />

Here is a list of media events to which you can bind: