1 Reply Latest reply on Sep 17, 2007 12:09 PM by urbanrevolution

    Flv xml Stream Playlist action script help

    matthelm88
      So if you go to this site:

      click here

      you will see a FLV player that has a list of videos that are pulled from a .xml file...
      The action script for this player is as such:

      var nc:NetConnection = new NetConnection();
      nc.connect(null);

      var ns:NetStream = new NetStream(nc);

      theVideo.attachVideo(ns);

      rewindButton.onRelease = function() {
      ns.seek(0);
      }

      playButton.onRelease = function() {
      ns.pause();
      }

      var videoInterval = setInterval(videoStatus,100);
      var amountLoaded:Number;
      var duration:Number;

      ns["onMetaData"] = function(obj) {
      duration = obj.duration;
      }

      function videoStatus() {
      amountLoaded = ns.bytesLoaded / ns.bytesTotal;
      loader.loadBar._width = amountLoaded * 194.5;
      loader.scrub._x = ns.time / duration * 194.5;
      }

      var vlist:XML = new XML();
      vlist.ignoreWhite = true;

      vlist.onLoad = function() {
      var videos:Array = this.firstChild.childNodes;
      for(i=0;i<videos.length;i++) {
      videoList.addItem(videos .attributes.desc,videos.attributes.url);
      }
      ns.play(videoList.getItemAt(0).data);
      videoList.selectedIndex = 0;
      }

      var vidList:Object = new Object();

      vidList.change = function() {
      ns.play(videoList.getItemAt(videoList.selectedIndex).data);
      }

      videoList.addEventListener("change",vidList);

      vlist.load("videos.xml");

      I want to action script something that will make the videos play one after the other, get rid of the list on the right and have buttons on player that allow you to go to the next/previous video listed in the .xml file

      Its sort of like the player at click here

      I know this is a lot to ask, but I am currently in a jam and any help would be greatly appreciated...

      Thanks

      Matthelm88
        • 1. Re: Flv xml Stream Playlist action script help
          urbanrevolution
          gotoAndLearn is a fantastic base to build off of.
          but

          i'm looking for the same thing... how do you get the files to play one after another?

          i've looked for everyhting ns. related and i can find any doc's on this one.
          i 've found the

          function complete_listener(eventObject:VideoEvent):void {
          if (my_FLVPlybk.source == "rentv1.flv") {
          my_FLVPlybk.play("rentv2.flv");
          }

          else if (my_FLVPlybk.source == "rentv2.flv") {
          my_FLVPlybk.play("rentv3.flv");
          }
          };

          on the flash video live docs.. but i can't find anything on how to tie it into the XML.

          anything anyone can offer would be a huge help ...