开发者

Monotouch: Playing MP3 on remote server

I want to play a MP3 which is on a remote server. What can i do to play开发者_运维知识库 the MP3 in a iOS application?


The AVPlayer will work, if you want low-level access to the media pipeline, you can use the AVAudioFile APIs that let you stream the data yourself and then feed it to the audio decoders.

See my sample at:

http://github.com/migueldeicaza/monotouch-samples/tree/master/StreamingAudio/

This is a low-level API, just keep that in mind. The sample does its own file fetching from the remote site.


You could try AVPlayer. For example,

avPlayer = MonoTouch.AVFoundation.AVPlayer.FromUrl(new NSUrl("http://www.robtowns.com/music/blind_willie.mp3"));
avPlayer.Play();

Check out the MonoTouch or Apple documentation for more details.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜