2 Replies Latest reply on Nov 5, 2012 6:45 AM by Gil1

    How to control a YouTube video with buttons created with Edge Animate?

    Gil1 Level 1

      I am able to embed a YouTube video by doing:

       

      var tubeCont = sym.$("tubeCont");

      var youtube = '<iframe  width="'+tubeCont.width()+'" height="'+tubeCont.height()+'" src="http://www.youtube.com/embed/OCbrZvmLY0o?enablejsapi=1" frameborder="0" allowfullscreen ></iframe>';

      tubeCont.html(youtube);

       

      I have some buttons that go to another position on the timeline where a different object is shown. if the video is playing, it will continue playing even if the user cannot see it. Hence, I want to pause or stop the video.

       

      On the button clcik event I have tried:

       

      • sym.getComposition().getStage().getSymbol("youtube").$getSymbol("player").stopVideo();
      • sym.$("youtube").$("player").stopVideo();
      • youtube.$("player").stopVideo();
      • sym.getSymbol("youtube").$("player").stopVideo();
      • sym.getSymbol("youtube").stopVideo();

       

      And other stuff, but I cannot make it doing waht I want.

       

      Any suggestions?