> Home > ***STAGING AREA*** > streaming test
 

 

Tool Box

 

Print  print

RSS Feed  RSS feed

Email  email  

Bookmark and Share  share

streaming test

on (load) { // Start VitalStreamMediaURL Behavior // Example Vital Stream Media URL: //http://flash.vitalstream.com/flashgen.cgi?sname=flashfile.flv&aname=xxx_vitalstream_com // Example rtmp URL, derived from VitalStream Media URL // rtmp://server/xxx_vitalstream_com //Create a XML object that will load the media url var vs_xml:XML = new XML(); vs_xml["media"] = this; vs_xml.onLoad = function(success:Boolean) { //The success event on the xml load event //We can now parse out the values we need if (success) { //We transverse the XML file to grab the appURL(rtmp://server/xxx_vitalstream_com) var appURL:String = this.firstChild.firstChild.nextSibling.firstChild.nodeValue; //The XML file passes back a file passed in from the sname querystring. This allows a developer to dynamically pass media files to a compiled swf file. var streamName:String = this.firstChild.firstChild.firstChild.nodeValue; // We don't seem to need ".flv" at the end of the file name for the Media Components. this["media"].setMedia(appURL + "/" + streamName, "FLV") } else { trace("Loading Error!"); } }; //This fires off the XML for loading. If you are using a 6.0 player and all the XML variables seem to be null read up on cross domain policy. 7.0 Players will read the cross domain policy files. vs_xml.load("http://flash.vitalstream.com/flashgen.cgi?sname=flashfile.flv&aname=xxx_vitalstream_com");