5 Replies Latest reply on Jun 25, 2014 4:42 PM by CPBTenner

    how to pause an embedded video

    loxfear Level 1

      hello i got a code just like this:

       

      var youtubevid = $("<iframe/>");
           sym.$("vcontainer").empty().append(youtubevid);
           youtubevid.attr('type','text/html');
           youtubevid.attr('width','425');
           youtubevid.attr('height','350');

           youtubevid.attr('src','http://www.youtube.com/embed/ykF1y2EJ2nI');  // url/Video_Id
           youtubevid.attr('frameborder','1');       // 1 | 0
           youtubevid.attr('allowfullscreen','0');   // 1 | 0

       

      and i want to pause this whith an button but how?

        • 1. Re: how to pause an embedded video
          loxfear Level 1

          i still havent figured it out yet .. anyone?

          • 2. Re: how to pause an embedded video
            Dam4222 Level 1

            Hey Loxfear,

             

            I am having the same issue except I am using a video locally. This is how I call it in compositionReady:

             

            var background = $("<video width='855' height='480'>" +

               "<source src='media/ATT_ADWORKS_INTRO2_FINAL.mp4'/>" +

               "This browser is not compatible with HTML 5" +

            "</video>");

             

             

            // stage symbol lookup, and append the above vid object to it;

            // in other words, get the div called 'vcontainer' and attach the video control to it;

            sym.$("vcontainer").append(background);

             

             

            // additional options for the video object

            background.attr('autoplay','true');

            background.attr('preload','auto');

             

            I want to be able to have the video pause/stop if another button is clicked. I tried using some basic knowledge of Jquery to do this but only got so far. Basically if I place the following code in the the Click action of my button I can get my DIV to hide. However, I cannot get the video to stop playing.

             

            sym.$("vcontainer").stop("true", "true").fadeOut();

             

            It appears we need to some how tell the iframe or in my case the <video> to pause or remove itself.

             

            Anyone else know how to do this?

             

            Adam

            • 3. Re: how to pause an embedded video
              jaketherake222222 Level 1

              I have not long been using edge.

               

              I have container that pop up that display the video but when you close the container the video carries on playing.

               

              The user needs to press a button to close the elements to then goto another one to open it up.

               

              I came up with an idea... What I done was put this on the button and it works...

               

              sym.getSymbol("vcontainer").deleteSymbol();

               

              Yes it stopped the video playing as it deleated it and no I have no idea how to pause it. The only problem now is that the user will not be able to see the video again and I have no idea how to script it to create the symbol back. LOL (Anyone!!!)

              • 4. Re: how to pause an embedded video
                Dam4222 Level 1

                Hey Jake,

                 

                So here is what I figured out. You need to use some Jquery to pause and play.  Check out my sample file:

                 

                http://dl.dropbox.com/u/9159616/VideoPauseDemo.zip

                 

                Essentially, the video Autoplays. Then upon the click of the "TRIGGER" is pauses, and then launch into another part of the timeline.

                 

                Adam

                1 person found this helpful
                • 5. Re: how to pause an embedded video
                  CPBTenner Level 1

                  Adam,

                   

                  Can you repost the sample file?  I am running into the same problem.  I have a youtube video in a div that I hide/show.  If the video is playing when the div is hidden it keeps playing. I would like it to pause, or ideally stop so that it is back at the beginning if someone clicks to show it again.  Is that what your sample does?

                   

                  Brandon