Share Posted September 29, 2016 Hi. Maybe a simple question. But how do I start and stop a HTML5 video from a button in an HTML5 ad? I have looket in the forum but found nothing so simple Regards Olle Link to comment Share on other sites More sharing options...
Share Posted September 29, 2016 Hello olleka, and Welcome to the GreenSock Forum! This is not really a GSAP API question. We try to stay focused on answering questions about the GSAP API and GSAP Plugins. This is more of a question on how to use the HTML5 <video> element. Which you can find more out about here: HTMLMediaElement: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement But to answer your question, the following can be used for pausing a <video> element, it presumes you have an id named video: <video id="video" width="480" height="280" autoplay> <source src="my-video.mp4"> <source src="my-video.ogv"> </video> // using jQuery $("#video")[0].pause(); // native javascript var video = document.getElementById("video"); video.pause(); Happy Tweening 1 Link to comment Share on other sites More sharing options...
Author Share Posted September 29, 2016 Ok, I understand. Thank you! Regards Olle 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now