yammine
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by yammine
-
-
Hello gsap,
I have an animation and i want to play a youtube video when the animation finishes.
I aded the onComplete property to play the video,
var tag = document.createElement('script'); tag.src = "https://www.youtube.com/player_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); var player1; function onYouTubePlayerAPIReady() { player1 = new YT.Player('video', { width: '100%', height: '100%', videoId: 'reAlJKv7ptU' }); } function play(){ player1.playVideo(); } gsap.to(".video", {duration:1 , x:100, onComplete:play})
it seems that it plays the video but it stops instantly.
Thank you.
See the Pen pobzVer by YammineYammine (@YammineYammine) on CodePen
playing Youtube onComplete
in Banner Animation
Posted
Hello ZachSaucier
This was a small demo in codepen, in my real project i actually wait for the youtube player until it is ready,
the demo that you provided still has the same issue i described.
maybe its something related to the browser or the machine that i am using.