Posts Tagged ‘cs3’

Sample Source code for the Media Server

Monday, August 11th, 2008
Features: 
  • Streaming video in mp2 and mp4 format
  • Streaming audio in mp3, wav formats
  • Web based player uses adobe flash version 9
  • Security controlled log in screen to determine what videos the user has access to.
  • Radio player, Live streaming Video player.
  • Sql database to catagorize content.
  • Themes for  background
  • Full screen video playback, and HD video playback.
  • Video on demand.
  • Flash Media Server for streaming audio an video content.
Media Server Version 12

Media Server Version 12

START of code:

 var LoggedIn:Boolean;
 var Administrator:Boolean;

 var Hostname:String ;
 if (Hostname == null) {Hostname = “dkwizard1.servegame.com”}

 var Statustext:String = “”
 var request2:URLRequest = new URLRequest()
 var url:String;
// var url:String = “http://”+Hostname+”/flash/status.php“;�
 var loader4:URLLoader = new URLLoader();   //Url Variable

// Security.allowDomain(“localhost, 64.173.224.224, dkwizard1.servegame.com, mobilemediacenter.servegame.com”);
// Security.allowDomain(“http://localhost“);
// Security.allowDomain(“http://64.173.224.224“);
// Security.allowDomain(“http://dkwizard1.servegame.com“);
// Security.allowDomain(“http://mobilemediacenter.servegame.com“);
// Security.allowDomain(“*”);
 LoggedInMenu();�
//Read From Database
ReadST();

function ReadST() {
 request2.url = “http://”+Hostname+”/flash/status.php“;
 loader4.load(request2);
}
//LoadComplete Status – Update statustext with results
function LoadComplete4(event:Event):void {
 Statustext = event.target.data;�
 //Statustext = “Serverrf:http://mobilemediacenter.servegame.com/flash/mediaserver10.swf:Server” //remove test
 var statusarray:Array = Statustext.split(“:”);   //Create the array that holds Movie Title, filename, catagory

  if (statusarray[1] != “”)
   {
   //Serverrf:http://mobilemediacenter.servegame.com/flash/mediaserver10.swf:Server
   //statusarray[1]= “mobilemediacenter.servegame.com/flash/mediacenter.html”;
   trace (“0″+statusarray[0]); �
   trace (“1″+statusarray[1]); �
   trace (“2″+statusarray[2]); �
   statusarray[2] = statusarray[2].slice (0,statusarray[2].lastIndexOf(“mediaserver/”)-1); //Strip off at flash
   trace (statusarray[2]); //   //mobilemediacenter.servegame.com
   trace(statusarray[2].slice(2,statusarray[2].length));
   statusarray[2] = statusarray[2].slice(2,statusarray[2].length)
   Hostname = statusarray[2];
   }
  else
   {Hostname = “mobilemediacenter.servegame.com”}
    // Could not find the hostname – Point to johns server
     HomeText.text += “\nStatus: ” + Statustext;
     HomeText.text += “\nHostname: ” + Hostname;
}
//Done Loading�
 loader4.addEventListener(Event.COMPLETE, LoadComplete4);   //when done loading, go to the LoadComplete function

 HomeText.text += “\nServer: ” + Hostname;
 LoggedInStatus();

// Display the ripple logo
 var request:URLRequest = new URLRequest(“http://dkwizard1.servegame.com/flash/DavidsRipple.swf“);
 var loader3:Loader = new Loader();
 loader3.load(request);
 loader3.x = 400; loader3.y = 20;   //Sets the location on the screen
 addChild(loader3);
// stop();�

Home.addEventListener(MouseEvent.MOUSE_UP, gohome);
MemberLogin.addEventListener(MouseEvent.MOUSE_UP, gologin);
Movies.addEventListener(MouseEvent.MOUSE_UP, gomovies);
LiveVideoBtn.addEventListener(MouseEvent.MOUSE_UP, gomovies);
MusicBtn.addEventListener(MouseEvent.MOUSE_UP, go2music);
Radio.addEventListener(MouseEvent.MOUSE_UP, gomovies);
AboutBtn.addEventListener(MouseEvent.MOUSE_UP, goabout);
Contact.addEventListener(MouseEvent.MOUSE_UP, gocontact);
Help.addEventListener(MouseEvent.MOUSE_UP, gohelp);
admin.addEventListener(MouseEvent.MOUSE_UP, goadmin);
//adobe.addEventListener(MouseEvent.MOUSE_UP, gomovies);   //Already Defined somewhere else to go to the website
//LoggedIn.addEventListener(MouseEvent.CLICK, updatemenu);   //about checkbox clicked�
function LoggedInStatus(){
 if (LoggedIn == true)
  {HomeText.text += “\nLogged in”}
 else �
  {HomeText.text += “\nLogged out”}
 HomeText.text += “\nAdministrator:” + Administrator;
}

function gohome(evt:Event):void { gotoAndStop(“Home”);   } // Jumps to the Home KeyFrame
function gologin(evt:Event):void { gotoAndStop(“Login”);  } // Jumps to the Login KeyFrame
function gomovies(evt:Event):void { gotoAndStop(“PlayVideo”); } // Jumps to the PlayVideo KeyFrame
function go2music(evt:Event):void { gotoAndStop(“Music”);  } // Jumps to the PlayMusic KeyFrame
function goabout(evt:Event):void { gotoAndStop(“About”);  } // Jumps to the About KeyFrame
function gocontact(evt:Event):void { gotoAndStop(“ContactUs”); } // Jumps to the ContactUs KeyFrame
function gohelp(evt:Event):void { gotoAndStop(“Help”);   } // Jumps to the Help KeyFrame
function goadmin(evt:Event):void { gotoAndStop(“Admin”);  } // Jumps to the Help KeyFrame

function updatemenu(event:Event):void {LoggedInMenu();}

function LoggedInMenu(){
 Movies.visible = LoggedIn;
 LiveVideoBtn.visible = LoggedIn;
 MusicBtn.visible = LoggedIn;
 Radio.visible = LoggedIn;
 admin.visible = Administrator;
}

My Latest Video
Weather forecast in San Bernardino
My Photos on Pond 5
Royalty-Free Stock Video at Pond5
Posts
Speedtest 2014 B
Speedtest.net Mini requires at least version 8 of Flash. Please update your client.
Speed Test
Recent Posts
    Sponsers
    Tech
    Your IP Info
    Login