Page 1 of 1

media player doesn't work??

Posted: Thu Apr 25, 2013 4:01 am
by theshermanator
Does the media player not work with android devices?
I dragged the media player onto my stack, then was able to add a URL to the file which was a remote MP3. Worked.
I also added a streaming .PLU url from a streaming internet radio station. Worked great.

I createed a mac osx standalone and it worked great.

But when I save as an android app the media object shows up as a blue ugly bar and sits there and does nothing. It won't play.
Is there a special setting for this on android?

I am trying to play an MP3 URL or a PLS url

:?: :?:

Re: media player doesn't work??

Posted: Thu Apr 25, 2013 4:17 am
by Simon
Hi theshermanator,
Welcome to the forum!
Please do not double post your questions as no one will know which to follow.

Android does not use the media player, look up AndroidPlayer in the dictionary and mobileControlCreate in the Android user notes. You will have to scroll down a few pages to see the Player controls in the notes.

Simon

Re: media player doesn't work??

Posted: Thu Apr 25, 2013 4:20 am
by theshermanator
Thanks , sorry about that.
I did try mobileControlCreate however I got a handler not found error .. Do I have to install an additional plugin for this?

Re: media player doesn't work??

Posted: Thu Apr 25, 2013 4:29 am
by theshermanator
Nevermind my last post

This is what i'm doing:

mobileControlCreate "player", "movie"
put the result into sPlayerID
mobileControlSet sPlayerID, "h t t p : / / u r l t o s e r v e r : 8 0 3 0 /listen.pls", tMoviePath
play sPlayerID


Does this look right?
I'm not getting any errors
But I'm not getting any audio ...

Re: media player doesn't work??

Posted: Thu Apr 25, 2013 4:36 am
by theshermanator
actually i'm also getting this error when trying to run the code:

(Handler: can't find handler) near "mobileControlCreate", char 1

:?: :|

Re: media player doesn't work??

Posted: Thu Apr 25, 2013 4:42 am
by Simon
Android does not support .pls:
http://developer.android.com/guide/appe ... rmats.html

(Handler: can't find handler) near "mobileControlCreate", char 1
Only shows up in the IDE as it is a mobile command (not for desktop).
You should have
if the environment is "mobile" then
mobileControlCreate "player"
etc.

Simon

Re: media player doesn't work??

Posted: Thu Apr 25, 2013 5:00 am
by theshermanator
I added that in my script:

if enviornment is "mobile" then
mobileControlCreate "player", "movie"
put the result into sPlayerID
mobileControlSet sPlayerID, "h t t p : // w w w . u n i v e r s a l - s o u n d b a n k . c o m /mp3/sounds/22415.mp3", tMoviePath
end if

However nothing plays when I test the app on android

:?: :?:

Re: media player doesn't work??

Posted: Thu Apr 25, 2013 5:13 am
by Simon
You have some oddities in there. Look here it's already been discussed:
http://forums.runrev.com/phpBB2/viewtop ... yer#p63321

Simon

Re: media player doesn't work??

Posted: Thu Apr 25, 2013 6:00 am
by theshermanator
Thank Simon I tried your example but it will didn't play .... Does this support an mp3 URL verses local file ???

Re: media player doesn't work??

Posted: Thu Apr 25, 2013 6:09 am
by Simon
Try the local first just to see if you can play it (you have to know the path to it).
I know locals work.
Then try the URL, tell me if it works.

Simon

Re: media player doesn't work??

Posted: Thu Apr 25, 2013 7:49 am
by theshermanator
When trying to play a mp3 url I can a playback of a static sound .. which sounds like perhaps it's not supporting the audio compression type? Perhaps converting the mp3 url to mp4 would work? ..

I tried to play a local file without any success
..

:|

Re: media player doesn't work??

Posted: Thu Apr 25, 2013 8:20 am
by theshermanator
Okay I figured out that it's a compression issue.
Could not play a .mp3 url... However I was SUCCESSFUL at playing an audio file compressed as M4A.
likely could just be due to bitrate or sample rate on the actual file regardless of it's compression. I'm sure there is a way to get around streaming .PLS from an internet radio audio stream .. I'll continue to post my results ..

Re: media player doesn't work??

Posted: Thu Apr 25, 2013 8:24 am
by Simon
Great work!
Keep posting your findings.

Simon

Re: media player doesn't work??

Posted: Thu Apr 25, 2013 8:52 am
by theshermanator
Fixed!

I found out that you can play .MP3 and any other audio compression via URL but your audio compression must be:

Bit rate: 128 kbps rate
Sample rate: 44.100 HZ sample rate

This is the same for streaming audio such as internet radio

I was successful when playing streaming audio from internet radio. By linking directly to the source feed verses the .PLS file (which probably just confuses the stack as it's looking for audio data not a config file)
For example:
this works: h t t p : / / 6 4 . 7 1 . 1 5 8 . 1 7 2 :8030/
this does not work:h t t p : / / 6 4 . 7 1 . 1 5 8 . 1 7 2 : 8030/listen.pls

:D 8) :wink: