3 Replies Latest reply on Aug 23, 2013 2:31 PM by fullakingi

    Syntax small fix (video autoplay and loop)

    fullakingi Level 1

      Hi, for the life of me I don't know where to put the autoplay and loop, here's my current attempt. the video loads but it doesnt play

       

       

      vid.html('<video id= "video1" style="position: absolute;bottom: 0px; right: 0px; min-width: 100%; min-height: 100%; width: auto; height: auto; overflow: hidden" >' +

       

      "<source src='video/video.mp4' type='video/mp4' autoplay= 'autoplay' loop= 'loop'/>" +

       

      "<source src='video/video.webm' type='video/webm' autoplay= 'autoplay' loop= 'loop'/>" +

       

      "<source src='video/video.ogg' type='video/ogg' autoplay= 'autoplay' loop= 'loop'/>" +

       

      "</video>");

       

       

      What am I doing wrong?  (Apart from not understanding any code whatsoever!)

        • 1. Re: Syntax small fix (video autoplay and loop)
          RavenDesign Level 1

          You need the autoplay and loop in the video part of the code like this:

          <video preload="auto" autoplay="true" loop="true" width="100%" height="auto">

           

          How ever I do this in a completely different way 1st I set up a Html page holding the video and the code then I embed the video into Edge with an Iframe like so:

           

          Html page:

           

          <!DOCTYPE html>

          <html>

          <body>

          <style type="text/css">

          #video_background {

          position: absolute; bottom: 0px; right: 0px; min-width: 100%; min-height: 100%; width: auto; height: auto; z-index: -1000; overflow: hidden; }





          </style>

          <div id="video_background"><video preload="auto" autoplay="true" loop="true" muted="true" volume="0" width="100%" height="auto">

          <source src="folio.webm" type="video/webm">

          <source src="folio.ogg" type="video/ogg">

          <source src="folio.mp4" type="video/mp4">

            Your browser does not support the video tag.

          </video></div>



          </body>

          </html>

           

           

           

           

           

           

           

           

           

           

          JQuery:

           

          var container = sym.$('#Stage_Iframe');

          var Video = ' <iframe width="100%" height="100%" frameborder="0" scrolling="no" src="video.html"></iframe>'

          container.html(Video);

          • 2. Re: Syntax small fix (video autoplay and loop)
            fullakingi Level 1

            Cool!  Thanks for this!  Much appreciated Raven.

            • 3. Re: Syntax small fix (video autoplay and loop)
              fullakingi Level 1

              Thanks works. This is what I did:

               

              vid.html('<video id= "video1" autoplay= "autoplay" loop= "loop" style="position: absolute;bottom: 0px; right: 0px; min-width: 100%; min-height: 100%; width: auto; height: auto; overflow: hidden" >' +

               

              "<source src='video/video.mp4' type='video/mp4' />" +

              "<source src='video/video.webm' type='video/webm' />" +

              "<source src='video/video.ogv' type='video/ogv' />" +

               

               

              "</video>");