Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
rojharris

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

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

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.

 

Cheers

Roger

 

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

R

  • 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.
×