I am developing an android application for Online Music streaming. I want to download MP3 files from the server and play that file when the user is offline. And the downloaded file can only be played through applicaion
please give your best solution
Related
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 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.
I've a web app which uses HTML5 player to play audio mp3 files hosted on the server. I want to use PhoneGap to convert it to iPhone/Android apps. I want users to cache the audio files on the device. It would be really nice if I can somehow encode it and save it on the device rather than flat mp3 files. Just wondering that how can I do on iPhone/Android using PhoneGap.
We want to play m3u8 with ts files stored locally on SD card in Android 4.0 and above devices.
I tried using video TAG inside HTML residing locally on the SD card and android native media player.
Both the codes are failing with the error. The same set of ts and m3u8 files are working fine when played from online when served from a webserver connected through http.
Can we play m3u8 using native support for files stored offline or do we need to use 3rd party libraries. I searched in internet and didn’t find article about not supporting the same.
Any help or recommendation would help my work.
Thanks a lot
Issue Solved
we used nano http server to serve m3u8 file to with all videos parts. Very simple and easy way to play m3u8 video file.
I need to develop application for Android which decrypts audio and video files saved on SDCARD
and plays them without saving on SDCARD or on phone.
Is there any way to do using standard Android MediaPlayern class?
Thanks, Costa.
The solution is to build HTTP server on the phone and play the files using the server.
There the link to server I used (and it worked good):
http://www.prasannatech.net/2008/10/simple-http-server-java.html
Thanks!