I want to develop as follows but I did not find good example:
I want to play without having to download an mp3 encoding in the url. Unless the user stops it the mp3 should play in the background. I guess I do multitasking.
Is there an example document or any advice please. Thanks.
String fileUrl = "http://192.168.1.131/myproject/songs/xyz"; String url = "http://myserver/songs/xyz"; //(myserver -> A remote server) mVideoView. setVideoURI(Uri. parse(fileUrl)); mVideoView. requestFocus();
To link to an MP3 file, you must first upload the MP3 file either to a cloud storage service like Google Drive or iCloud, or to an online music service like SoundCloud. After uploading the music, you can share it via the link.
If you have URL to mp3 song, then paste it in address bar of chrome. It will start playing the song. Then right click -> Save As... OR Crl+S to save the mp3 being played.
Look at these two tutorials, In these the .mp3 files are playing through web url,
Example of streaming mp3 mediafile from URL with Android MediaPlayer class
Play Mp3 file from a Url
Also if you want to play .mp3 file in background I think you have to use Service and AIDL for it,
Look at basic Android-Music Player demo MusicDroid - Audio Player Part II it describe how to use Service and AIDl for your Audio Player.
Thanks..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With