Android default music app - add songs from web instead of filesystem - android

I would like to leverage (reuse) the built in Android music app to play songs/artists/albums/playlist that their origin is from the web and not from SDcard/internal storage.
To be more accurate, I see that the content is retrieved from MediaStore.Audio.Media.EXTERNAL_CONTENT_URI.
Is there a way to add web audio to the media store?
Basically, why wouldn't it be possible? The mediaPlayer knows how to play remote audio.
Please advise...

Related

Building a media browser service that loads dynamically the media sources

I am newbie in the android development.
I am trying to develop an application which needs to play mp3 files in the background.
I read a lot of articles about media browser service and the new architecture approach to develop a media player application.
In my case, the media files will be loaded from a json file, which is depends on the content of the page that the user enters. When the user goes to an activity, the app loads the related information and starts to play the audio files.
If i have understood correctly, the music browser service loads the audio files at the startup and the client can browse the files or controls the playback.
Is that correct?
Can you give me an example how i can load the audio files dynamically in the service?

Android Exoplayer caching m3u8 audio for offline support

I am creating a music application.
I have used Exoplayer V2.8.0, So far I have achieved to play, pause next, prev, shuffle, repeat all songs using controls in-app and also with notification.
But all of this works only in online mode.
Now I want to add offline support to this app and allow a user to download the song offline and play while they are offline.
Audio files we are getting are *.m3u8 files.
But my problem is user should not access those downloaded files outside of my app. I have tried using one approach but it gives the mp3 files downloaded and combined from the different segments of the m3u8 file.
Can anyone guide me or give me sample or tutorial on how can I download the segments only and at the time of playing I can use that segment and play audio offline?
There is one suggestion for you,
If you want to create an offline player with .m3u8 or any other file then after download saves your file into your package folder with some of the different formats. Then while using that convert that specific formatted to mp3 or other which will help out for offline music play.
You can use a local http proxy server (NanoHttpd). Start the server and point your ExoPlayer to 127.0.0.1 so you can monitor the requests. Cache the m3u8 playlist plus the downloaded files for the first time you see a request. Next time when your proxy detects the same request, just play the files from cache.

How to implement feature like YouTube offline save video in my Android app

How does the YouTube offline feature work? I want to implement this feature in my app. Is there any solution?
Youtube Offline Features works in following manner:
Youtube app downloads the video.
Saves it into youtube app's data directory in encrypted format so other apps can't access it.
Encryption is done so that video can not be played by any other apps even if video is extracted from youtube app data directory on rooted Android device.
Video is decrypted while playing offline in the youtube app.
Video is deleted after a predefined time.

How can i allow users to save videos which are streamed in webview

I have an app which is using android webview .i am able to stream video in webview .i want know how can i allow users to to save videos automatically in thier internal storage which they stream in webview on website ? Thanks in advance
Most videos streaming to a browser (PC or mobile) will not allow download as the owner of the video may not want to allow it be saved and copied etc.
Simple http progressive download may allow you to save the video in a regular browser by simply right clicking on it.
DRM protected video will generally use a video pipeline (a sort of 'path' through your device) that does not allow an application of any kind access the raw video - this is again is to avoid people making unauthorised copies.
If you think the video in your case is allowed to be copied then you may find it easier to write some functionality to act as the streaming client and save the file locally. You could also pass the received stream along to the media player or to a webview if you wanted to play the file in parallel to saving it.

Prevent Mp3 file to play in another Media player

I am developing media player and my application download mp3 file from server .
So i want to prevent it from another media player to play it.
Case
User get file from server (music file1.mp3) in android phone ! User play it in our player but can't share it or download it in computer or play in another media player.
I try Below
I can encrypt a file and decrypt it again in my app (will take long time, it's a mobile cpu!), but then my application needs to have the decryption key inside. Basically anyone can read this key from my app so its not the good solution.
So please suggest me what i have to do ?
Thanks..
So please suggest me what i have to do ?
Write some other app.
What you are describing is DRM. There is no known DRM system that is unbreakable. There are DRM systems that have been broken, and there are DRM systems that nobody has bothered trying to break yet.

Categories

Resources