I've been following this blog to help me make a simple music player function with an Android app (http://simonmacdonald.blogspot.com/2011/05/using-media-class-in-phonegap.html).
All works well - but I would like some way to extract a list of all music media stored on the phone so the user can click a file and play it. Does anyone know if this is possible via phone gap? I'd need to access track name/artist etc and a link to the track.
Cheers
Paul
Prognosis is not good.... PhoneGap does not have an API for accessing the media library. So, you would have to fall back to the File API to locate music files, and then... you would have to read the binary data in the actual files to extract out the track/artist metadata. Ouch. Seems pretty impractical.
[EDIT]
By the way, PhoneGap is not the only game in town. Appcelerator seems to solve the same problem, and apparently has a richer API, which includes
access to media metadata
Related
I have found an app on play store using my absolute path of mp3 files to his/her app to stream my mp3 files. I think he/she created a script which crawling my website and getting mp3 files with title of the songs or albums and then creating his/her database and then creating a web service which generates json. So he/she can use it in app. I have tried to prevent hotlinking of mp3 files from my .htaccess from my server but i think this trick is only working for websites not working for android applications. Please tell me how to stop mp3 files from third parties android apps or any other platforms except my own app. I have my own app on android so i don't need to stop that too. Thanks
Waiting for solution from experts :)
tahir issue is very simple. when some one wants to access your mp3 file ask app secret key in web service call . for sure now you will authenticate service no spams calls
I'm serving an audio file (WAV file that contains a short uncompressed PCM) from my GAE app using BlobStore.
On a click event, I set audio.src and call audio.play().
Now here is the weird part:
When working locally - it plays well on both IOS and Android.
After deploying to GAE, it plays well on IOS - but not on Android!
No error is shown - it just plays nothing.
As far as I can tell from GAE logs, the audio file is served in all cases.
In case of Android I can see a requests from "Player/LG Player 1.0 for Android 4.4.2 (stagefright alternative)".
Any idea what's going on, or how to debug this?
Update
Tried playing files from Google Cloud Storage, according to Stuart Langley's suggestion.
In that case, Android plays well, and IOS doesn't (intermittently. Sometimes gives an error).
So a workaround that works for me is storing the file on Cloud Storage, and also calling createGsBlobKey in order to serve it as a blob.
On the client side I check whether it's Android (navigator.userAgent.match(/Android/i)). In case of Android I set audio.src to the Cloud Storage file, and in case of IOS I set it to my servlet which serves the file using BlobstoreService.serve with the blob key I got from createGsBlobKey.
This is a cumbersome workaround and I didn't check other mobile OSs to see what works for each, so if anyone has a better solution please let me know.
Most likely this is due to the chunked response when serving a blob.
Here is an issue tracker item about audio files not playing correctly in some browsers.
Here is a test web site I put together while back that illustrates the problem.
As for workarounds - You can put the file on cloud storage and then play it from there, as long as you're not concerned about people hotlinking the file.
everyone!
Me and my team are developing some audio books that we will sell through our android application and our users will also listen them using the in-app mp3 player. We want to find a method (paid or free) to be able to protect our mp3's so the user cannot copy them and play with their own player.
I am aware that someone that is determined can crack anything, but our user targets are not computer geeks, but regular people that want a product that works and occasionally might try to cheat the system
Do you know any system that is easy to implement and can meet our objectives ?
Thank you in advance.
Do you know any system that is easy to implement and can meet our objectives ?
Stream the files from your server (e.g., using RTSP), or store them in internal storage on the device. Those will stop "regular people that want a product that works and occasionally might try to cheat the system" from being able to access MP3 files, which you can then play back using MediaPlayer within your own app ("in-app mp3 player").
In my app,I want to make sure user can record his sound and sent to other user to listen to it.
In android platform I choose .amr ,it's not too big and easy to record.
Then I realized I should make sure my ios user can chat with my android user,but .amr seems not support in ios(after v4.3).
So is there a certain audio file format that can use between android and ios platform?
Or I have to let my Server to do the Transcoding job?
Both android and iOS should be able to handle mp3 files.
You can encode to mp3 on the device using various open source projects (could be a combination of steps).
I would personally go for a server-side encoding/conversion, because too many things can go wrong (especially on all the various Android versions and devices)
At last we use amr. Ios client do the decode job.
I have just started studying Android and I am still lost.
I would just like to ask if playlist for video files is supported in Android 2.3.3 and above?
I just found out that there is MediaStore.Audio.Playlist but no MediaStore.Video.Playlist.
Any feedback would be greatly appreciated.
Thanks,
artsylar
Well yeah there is no such thing as MediaStore.Video.Playlist. And second thing is that if you want to play a list of video I strongly recommend you play them by folder (meaning you have a sort of listview that displays all of video in a folder you specified and play all of them, same as playlist). Why?
Because:
The point of using MediaStore is to have a convenient way to access ContentProvider which is sort of database that contains meta-data of copyright audio (tracks). If your audio is not licensed which means you are not buying the tracks from legal source, you wouldn't able to use MediaStore. So the same thing happens with videos
Use MX Player, it plays continuous videos also gives buttons to play next previous video in the list