Jump to content


GS overwrites video 'play' function? Is there a workaround

Moderator Tag

Recommended Posts

Hi There, 


We're trying to play video automatically upon clicking a button on a page (ie without pressing play on the video skin) but it seems GSAP, which is used extensively on the site, overwrites the html5 'play' function so it doesn't work.

Does anyone know of a work-around that will allow triggering of video? I need to create a lightbox-like effect that will autoplay a video when a user clicks the relevant button on the page.





Link to comment
Share on other sites

I can't imagine how GSAP could possibly overwrite the HTML5 play function - could you show us an example of that? What leads you to believe it's GSAP? 

Link to comment
Share on other sites

We think it's gsap because the function used to play the video is .play(), and so is the function to play the timeline in gsap. The error in the js console is saying cannot call play() on a non-object, which implies that it's trying to play a timeline, not a video.

Link to comment
Share on other sites

I don't think so - a TimelineLite or TimelineMax is an object, so you wouldn't get an error about it being a non-object. Could you please create a simple codepen or jsfiddle that demonstrates the issue so that we can see what's going on? I'm 99.9% sure this has nothing to do with GSAP, but it's tough to troubleshoot blind. I honestly can't imagine how GSAP could possibly hijack the play() call of anything else. Does that error go away if you remove GSAP from the page? (even if it does, that doesn't mean it was GSAP, by the way, but if the error persists we at least know that it has nothing to do with GSAP). 

Link to comment
Share on other sites

Sorry Jack,


It turned out to be JQuery not Greensock.


How could I have doubted.....


Many thanks anyway


  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.