2 Replies Latest reply on Oct 26, 2015 8:17 PM by josea65722302

    Pause/stop a youtube video

    travis.self

      It seems this question has been asked before with no definitive solution, so I thought I'd try my luck.

       

      Here's how the video is embedded on compositionReady:

       

      var youtubevid = $("<iframe/>");

      sym.getSymbol("intro2").$("videoContainer").append(youtubevid);

       

      youtubevid.attr('type','text/html');

      youtubevid.attr('width','387');

      youtubevid.attr('height','218');

      youtubevid.attr('src','http://www.youtube.com/embed/qHxn1_2KfCU?enablejsapi=1');  // url/Video_Id

      youtubevid.attr('frameborder','0');       // 1 | 0

      youtubevid.attr('allowfullscreen','0');   // 1 | 0

       

      I understand that in order to play/pause/stop a youtube video, you have to go through the API:

      https://developers.google.com/youtube/iframe_api_reference#Functions

       

      It looks like the function I would want to use here is:

      player.pauseVideo();

       

      So here are the two methods I've tried with no success:

      youtubevid.pauseVideo();

      sym.getSymbol("intro2").$("videoContainer").youtubevid.pauseVideo();

       

      Any suggestions? Thank you.