问题
I'm using this Code to stream an MP3 audio file in background mode in Phonegap. But the Problem is: With this Code there is no way to get the current position and all the other phonegap functions with this Code. I tried the native quicktime/childbrowser method to play the file. This works great and shows timeline etc. BUT there is no way to hide the quicktime player and browse in the app and there is also no way to save the position and set the position in the audio files. Any Ideas to solve the issue?
回答1:
One other option (if you are not scared of code in development) is a plugin for streaming audio (including fixed length files like mp3's) for PhoneGap on iOS.
https://github.com/devgeeks/phonegap-plugins/tree/AudioStreamer/iPhone/AudioStream
It's currently in development and may have bugs, but it is fairly feature rich.
I also have an example iPhone project that uses it:
https://github.com/devgeeks/ExampleAudioStreamer
If you give it a try and find any bugs let me know. I am pretty quick to squash them as I am trying to get it ready to fold in to the main PhoneGap plugins repo.
来源:https://stackoverflow.com/questions/7959275/iphone-phonegap-audio-playing-in-background