5 Replies Latest reply on Aug 9, 2007 2:40 AM by RedorDead

    FLV & SWF player with XML Playlist

    RedorDead
      What I want is to create a player that can handle SWFs and FLVs or just FLVs, that load from a XML playlist.

      Now I have seen the tutorial (Creating a Dynamic Playlist for Progressive Flash Video) url: http://www.adobe.com/devnet/flash/articles/prog_download.html

      But this populates a list that you have to click to play the next movie, but I want it to play swf1 or flv1 then 2 then 3 and so on, then loop. But I can't find a tutorial for this anywhere?

      Any ideas, I need a detailed tutorial or a working example?
        • 1. Re: FLV & SWF player with XML Playlist
          shurleynova
          Here is a mostly working example, I am still working out a few kinks but I think this is more or less what you are looking for. When the clip in the playlist is somplete you want it to automatically go to the next one right?

          http://www.hurleymultimedia.com/vidstream/agency/

          This is actually a combination of several different tutorials and some of my own customization. I have a php page that creates the playlist and uploads the files to the server. This one does not play swf's it was designed for FLVs.

          If you have gotten as far as creating the player with an XML playlist I might be able to help you get it to step to the next file in line. Can you post your AS code that might be helpful.
          • 2. Re: FLV & SWF player with XML Playlist
            arandlett Level 1
            Go to this url: http://www.gotoandlearn.com/flex/gotoAndLearn.html Lee has several tutorials on building a video player and using and xml list to do it.
            • 3. Re: FLV & SWF player with XML Playlist
              leoserra
              I recently made something like that, but then my project consultor, made me change to use only flv files.

              The project is going to be an internal tv channel for a university, here in Portugal. First I thought of mixing SWF and FLV's together, but then it required that someone that used the system, knew how to program SWF's, because you need to change a flag (variable) at the end of the playback of the SWF. This change of flag status indicates that this SWF is over and pass to the next entry of the playlist. Without this, I think that you would never know when to go to next entry. so, the code resembled a little like this:

              if ((_root.percen_tx.text == "100%") || (_global.over == 1 && _global.tipo[_global.num]=="1")) {
              _global.over = 0;
              _root.percen_tx.text = "";
              if (_global.num == (_global.filmes.length-1)) {
              _global.num = 0;
              switch (_global.tipo[_global.num]) {
              case "1" :
              loadMovie(_global.filmes[_global.num], _root.swf_cont);
              _root.descr_tx.text = "";
              _root.percen_tx.text = "";
              break;
              case "0" :
              _root.contentor.my_FLVPlybk.contentPath = _global.filmes[_global.num];
              _root.descr_tx.text = _global.descr[_global.num];
              break;
              }
              } else {

              _global.num += 1;
              _root.percen_tx.text = "";
              switch (_global.tipo[_global.num]) {
              case "1" :
              _global.over=0;
              loadMovie(_global.filmes[_global.num], _root.swf_cont);
              _root.descr_tx.text = "";
              _root.percen_tx.text = "";
              break;
              case "0" :
              _root.contentor.my_FLVPlybk.contentPath = _global.filmes[_global.num];
              _root.descr_tx.text = _global.descr[_global.num];
              break;
              }
              }
              }

              A brief explanantion:
              _global.over -> 0 (not over); 1 (is over)
              _global.tipo -> value that comes from an xml, and indicates if this playlist entry is a SWF or a FLV (they go to different MC's);
              _root.percen_tx -> Indicates the percentage of the FLV file that was already read. "100%" is over

              This is not the most efficient way to do it, because you can use listeners and so on, but at the time I abbandoned this, at this stage. Now it's only FLV, and only a few lines of code.

              You can see the project at www.ipvctv.com

              Hope it helped a bit.
              • 4. FLV & SWF player with XML Playlist
                RedorDead Level 1
                Thanks for this shurleynova,

                You can download what I have from the adobe:

                It's the: videosourcepro.zip(14.8 MB) from: http://www.adobe.com/devnet/flash/articles/prog_download.html

                I think I need to work from a download, as I am pants at AS :D

                ---------------------------------------------
                Thank you arandlett,

                but that tutorial is the same kind of thing as the adobe one?

                --------------------------------------------
                Thanks leoserra,

                As I am no good at action script, could you send me a working fla with the xml etc, as I don't understand it otherwise?

                Can you help?

                One thing I will say is this is going local, not on the web :D

                Thanks again
                • 5. FLV & SWF player with XML Playlist
                  RedorDead Level 1
                  Hi leoserra, your solution is perfect for what I am trying to achieve. Could you possibly please please send me an FLA?

                  I am desperate! a link to a detail tutorial may help? I just don't understand the above

                  Ta Andy