gmullinix Posted January 3, 2020 Share Posted January 3, 2020 Loading GSAP 3 and then VideoJS (in that order) breaks VideoJS. In my Codepen, the video is still playable, but VideoJS doesn't initialize and there's a few console errors. FYI If I reverse the load order, everything works fine. Any idea what's going on? See the Pen WNbXzQR by gem0303 (@gem0303) on CodePen Link to comment Share on other sites More sharing options...
GreenSock Posted January 4, 2020 Share Posted January 4, 2020 It looks like VideoJS has this line of code in its source: window$1 = window$1 && window$1.hasOwnProperty('default') ? window$1['default'] : window$1; Which basically looks for any "default" declared on the window and if it finds one, it treats THAT as the window itself! GSAP's UMD/ES5 files export a default object as a convenience for folks that use build systems that require() or import. So when you loaded GSAP before VideoJS, that caused VideoJS to stumble and treat GSAP as if it was the window object itself. I'd say that's more of a problem with VideoJS than GSAP, but I'll go ahead and add some conditional logic that removes the default from the window if the exports object is set to the window itself. You can preview that in the upcoming release here: https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/gsap-latest-beta.min.js That seems to work well in your codepen demo (thanks for providing that by the way!) 1 2 Link to comment Share on other sites More sharing options...
gmullinix Posted January 6, 2020 Author Share Posted January 6, 2020 Thank you for looking into this and putting a fix in the next release! I reported the issue on VideoJS's Github. 1 Link to comment Share on other sites More sharing options...
friede Posted September 26, 2021 Share Posted September 26, 2021 this is still happening to me in the current version... --nevermind, it seems to be something else i think... 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