Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I play a mp3 without download from the url? [closed]

Tags:

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.

like image 951
realuser Avatar asked Dec 13 '11 08:12

realuser


People also ask

How do you play music from URL?

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();

How can I convert an MP3 file to a URL link?

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.

How do I download MP3 instead of browser?

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.


1 Answers

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..

like image 75
user370305 Avatar answered Oct 09 '22 18:10

user370305