How to make video jump to a specific time and play on button click

I know that to play video on clicking any button you can add an action to a button and then make it trigger this code:

hypeDocument.getElementById(‘video1’).play();

How can I jump to a specific time in a video and play it on clicking a button? I found a similar topic here but I don’t get it as the answers assume previous knowledge which I don’t have. I’m totally new to Hype so I need something more detailed and step by step instructions.

Thanks for your help.
Greg

http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_av_prop_currenttime

have a nice day :slight_smile:

2 Likes

Thanks I’ll have a go at it and let you know how I did :grinning:

So I had a go and managed to do what I wanted to do. I created a button and then assigned an action to it so that when the button is clicked it triggers this script:

var vid = document.getElementById(“video”);
vid.currentTime = 3;
vid.play();

It works and when the button is clicked it takes me to the specified time in the video and plays the video as well. However, when the video playback comes to an end, clicking the button only takes me to the specified time but doesn’t play the video. Is there anything I can do to make it play the video as well.

Thanks
Greg

Hi Greg!

Responded to You in your other post: