Topic: Help with playing audio file from widget (using Flashdevelop)

Here's what I'm trying to do:
1. ssh into chumby and mount a cifs share with mp3 audio files - done
2. try playing the audio files in the share using btplay /mnt/nas/TestVoice.mp3 - done
3. Download and try out a sample flashdevelop sample - done
4. Modify the sample to play a mp3 file when a menu item is selected, here's what I added:

static var _PlayAudio : Function = _global.ASNative(5,151); //xxxxx
...
   function onMenuSelect(i:Number) {
    _PlayAudio('/mnt/nas/TestVoice.mp3');
        //trace("select " + i);
    }

When testing within flashdevelop I uncommented the trace and verified that the message gets printed when selecting a menu item.
However when running the widget (tried uploading via chumby.com as well as running using stop_control_panel and chumbyflashplayer.x -i /mnt/nas/test.swf), the audio file does not play.

I would appreciate any pointers on getting this to work, if this is not possible any alternative way to accomplish playing a cifs mounted file would be fine too.

A pointer to sample flashdevelop source that does this would be even better.

Thanks.

Re: Help with playing audio file from widget (using Flashdevelop)

Anybody ?
Can some Chumby person at least confirm if the asnative call with the parameters I'm using is valid and expected to work or not?

Re: Help with playing audio file from widget (using Flashdevelop)

That ASnative is "privileged" - it's not available to widgets, unless you lower the security on the device.  This call is used primarily by the Control Panel.

There are a couple of ways around this:

1) Create the file "/psp/flashplayer.cfg" with the contents:

PrivilegedCallExceptions 65535

This lowers the security on the device to allow widgets the freedom to do anything through the ASnatives - use at your own risk.

2) Create a true "music source" widgets, instructions here.  This will get listed with the other music sources in the device, and allow the Control Panel to manage it.

4 (edited by zrak 2011-01-28 15:17:22)

Re: Help with playing audio file from widget (using Flashdevelop)

Thanks for the reply. I forgot to mention that I already have the flashplayer.cfg file created as indicated (I actually had it as PrivilegedCallExceptions=65535, then I noticed that someone had already pointed out that the "=" character should be removed and I corrected that).
I was also under the impression that when launching the widget locally as "chumbyflashplayer.x -i /mnt/nas/test.swf" the privilege restriction does not apply.

The "My streams" option in the Wiki will not work for what I'm trying to do.
Is ASNative(5,151) still supported ?, I found that API while googling but it is not listed in the Wiki or any Chumby help pages.

Re: Help with playing audio file from widget (using Flashdevelop)

Yes, the privileged calls should work if the widget is run locally without the CP.

ASnative(5,151) should work, since that's what the CP uses.

Try "_PlayAudio('/mnt/nas/TestVoice.mp3','*');"

This provides a wildcard mimetype to the call.

Re: Help with playing audio file from widget (using Flashdevelop)

No luck sad
BTW, I noticed the following error message while the widget loads:
2011-01-29 10:58:11 BtPlayObject::StartBtplay() - LaunchDaemon() call response timed out
Could this be a problem ?, if yes what can I do to fix this ?