1 (edited by 1315matt 2011-03-29 16:31:58)

Topic: [solved] myxml.load perl script problem

Hi

I'm trying to create a widget that will play BBC mms radio streams via mplayer.

I have created a perl script that runs and stops mplayer, which works fine when run run from a web browser like so “http://<chumby-ip>/cgi-bin/custom/BBC_player/BBC_player?RADIO1”.

When running the flash widget from a computer running flash player 10 it works fine,  But when run on the chumby “myXml.load” only runs once.

If I press play it will start playing but if I press stop and play again it won't play.

Here is the code in question.

System.security.loadPolicyFile("http://localhost/cgi-bin/custom/BBC_player/BBC_player?POLICY");

  myXml = new XML();

radio_1.onPress = function() {
  myXml.load("http://localhost/cgi-bin/custom/BBC_player/BBC_player?RADIO1");
  trace ("radio 1");
}

radio_2.onPress = function() { 
  myXml.load("http://localhost/cgi-bin/custom/BBC_player/BBC_player?RADIO2");
  trace ("radio 2");
}

radio_3.onPress = function() { 
  myXml.load("http://localhost/cgi-bin/custom/BBC_player/BBC_player?RADIO3");
  trace ("radio 3");
}

radio_4.onPress = function() {
  myXml.load("http://localhost/cgi-bin/custom/BBC_player/BBC_player?RADIO4");
  trace ("radio 4");
}

radio_stop.onPress = function() { 
  myXml.load("http://localhost/cgi-bin/custom/BBC_player/BBC_player?STOP");
  trace ("stop");
}

Here is the .swf and .fla source code.

http://mattp.homelinux.com/BBC_player.fla
http://mattp.homelinux.com/BBC_player.swf

To get the perl script and mplayer onto the chumby run.

“cd /psp/cgi-bin”

“wget http://mattp.homelinux.com/BBC_player.tar.bz2”

“tar xvjf BBC_player.tar.bz2”

Any help would be welcome

Thank you

Matt

Re: [solved] myxml.load perl script problem

I figured it out in the end,  I had to disable caching in the perl script by adding the header:

print "Cache-Control: no-cache\r\n";

Its always something so simple. roll

Matt