5 Replies Latest reply on May 26, 2009 12:12 PM by SDG-QD

    Embedding flv in html using player swf w/o importing

    SDG-QD

      Looking for info on available options for embedding flv in html using a player swf but without actually importing the flv into the swf, so that you can embed any number of flvs in any number of html pages without creating multiple swfs.

       

      I've found solutions online using various player swfs hosted around the Internet, but I'm hoping for a better solution. I'd like to host the player swf on my own servers, not someone else's. And I'd like to not have to deal with, e.g., external branding.

       

      Sample <object> code that references a player swf hosted at walkernewsdownload.googlepages.com.

       

      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
           codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0, 40,0"
          width="480" height="360">
          <param name="flashvars"
          value="file=your-video.flv" />
          <param name="movie"
          value="http://walkernewsdownload.googlepages.com/mediaplayer.swf" />
          <embed src="http://walkernewsdownload.googlepages.com/mediaplayer.swf"
          width="480" height="360" type="application/x-shockwave-flash"
          pluginspage="http://www.macromedia.com/go/getflashplayer"
          flashvars="file=your-video.flv" />
      </object>

       

      I'm guessing there's probably a range of available downloadable players, some for purchase and some for free, with various pros and cons. I'm hoping for a professional-grade solution, and while I could possibly spend some money for it, a free solution would obviously be better.

       

      I'd be up for building my own, but I'm still too much of a Flash newbie to know where to start.

       

      Any insight?

        • 1. Re: Embedding flv in html using player swf w/o importing
          kglad Adobe Community Professional & MVP

          what's wrong with the standard flash flvplayback component?  or make your own player if you want to completely customize it?

          • 2. Re: Embedding flv in html using player swf w/o importing
            SDG-QD Level 1

            Can the FLVPlayback component be used to create a player swf that can then be called in html to play any flv referenced in the html? That's what I like about the example above.

             

            In the past, when I wanted to embed a flv, I imported it into a swf and customized the skin to get the lookandfeel I wanted. This of course means that if I have ten videos, I have a minimum of 21 files: 10 flvs, 10 player swfs and 1 skin swf.

             

            The solution of embedding any number of flvs directly into any number of html pages and simply referencing a single all-purpose player swf that will play any flv is appealing. I don't know where to begin building my own though.

            • 3. Re: Embedding flv in html using player swf w/o importing
              kglad Adobe Community Professional & MVP

              that's just using flashvars to pass an flv title to the player.  you can use flashvars with any swf.  and creating an flv player is as easy as dragging an flvplayback component out of the library and placing it onstage.  you would then assign its contentPath to the flv you want to play.

               

              and even easing than using flashvars to pass the flv title to the swf is using an xml file to pass the title(s).  then you wouldn't need to edit the html file, either.

              1 person found this helpful
              • 4. Re: Embedding flv in html using player swf w/o importing
                Simonangele

                The option I suggest you is Flash Video Encoder, because it's affordable and offers most of the options people require for displaying video online. Here's a screenshot of how I use Flash Video Encoder to embed flv/swf in html.

                skin.gif

                 

                You just need to choose "Embed the video in SWF and play in timeline". means the flv video is embedded in the swf file, but also with large file size. you can play flv independently without relying on other file. If you choose "Progressive download from a web  server", the video will be saved as a flv file. it is a Independent FLV player.

                More info, you can view:

                http://www.flash-video-soft.com/blog//?p=195

                • 5. Re: Embedding flv in html using player swf w/o importing
                  SDG-QD Level 1

                  Thanks for the tips so far.

                   

                  From what I can tell, FLVPlayback with FlashVars looks like the way to go for my present purposes. I am brand-new to both FLVPlayback and FlashVars.

                   

                  I am now trying to find documentation on the needed ActionScript. Haven't found it yet. One discussion makes it look as if all you need is


                  myFLV.contentPath = path/myFLV.flv;

                   

                  which seems clearly wrong, while another suggests something likethis:

                   

                  //Import flvplayback library
                  import fl.video.*;

                   

                  //Init vars
                  var myFlashVar:String;
                  var my_FLVPlybk = new FLVPlayback();

                   

                  //Add new element
                  addChild(my_FLVPlybk);

                   

                  //New element properties
                  my_FLVPlybk.x = 0;
                  my_FLVPlybk.y = 0;
                  my_FLVPlybk.height = 500;
                  my_FLVPlybk.width = 750;

                   

                  //Skin import
                  my_FLVPlybk.skin = "skin.swf"

                   

                  //Flashvars code
                  var varName:String;
                  var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
                  for (varName in paramObj) {     myFlashVar = String(paramObj[varName]);
                  }

                   

                  //Placed in html
                  params my_FLVPlybk.source = myFlashVar;

                   

                  which looks like it might be close but not quite right.

                   

                  Any help?