play the internet radio from remote URL in android

All your problems with Audio, Video and Images.

play the internet radio from remote URL in android

Postby brain_first » Fri Dec 25, 2009 10:16 am

Recently I was doing a app about play the internet radio in android, as if the android can't play the url source directly when set the url to setDatasource();
app introduce:
1.i use the downLoadFile function to download the stream file into the cache and save as the temp file for playing;the file is saved in name downloadingMedia_0.dat,downloadingMedia_1.dat...and the like
2.when i note the downloadingMedia_0.dat have the initByteLength and i play it, when it plays and has a little time left ,i will play the downloadingMedia_1.dat file,in the same time ,i will delete the downloadingMedia_0.dat, the logic is easy i think.
3. you can change the URL1 variables in the main activity for testing.
now my questions is:
1. i can't make the downloadingMedia_0.dat,downloadingMedia_1.dat can play seamless, maybe the checkMediaPlayer1(),checkMediaPlayer2()i need to change the condition in if;
2. how did i handle the file i saved in the cache and can play the stream smoothly.
thanks in advance Everyone!
the attachment you can download for a test and give me your good ideas!
Attachments
streamExample.zip
this is the android pro for playing the internet Radio
(93.86 KiB) Downloaded 53 times
brain_first
Freshman
Freshman
 
Posts: 5
Joined: Fri Dec 25, 2009 2:53 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Google [Bot] and 13 guests