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

video

(Greg) #1

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


(Hans-Gerd Claßen) #2

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

have a nice day :slight_smile:


(Greg) #3

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


(Greg) #4

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


#5

Hi Greg!

Responded to You in your other post: