AVPlayer就可以播放在线音频
大家知道AVAudioPlayer只能播放本地的,而第三方的AudioStreamer只能播放在线的。audioqueue,audiostream这些非到万不得已我是不看的。。。。- -AVPlayer简单一句初始化:AVPlayer*newPlayer = [[AVPlayer alloc] initWithURL:[NSURL URLWithString:urlSt
·
大家知道AVAudioPlayer只能播放本地的,而第三方的AudioStreamer只能播放在线的。audioqueue,audiostream这些非到万不得已我是不看的。。。。- -
AVPlayer简单一句初始化:
AVPlayer *newPlayer = [[AVPlayer alloc] initWithURL:[NSURL URLWithString:urlStr]]; //在线
或
AVPlayer *newPlayer = [[AVPlayer alloc] initWithURL:[NSURL fileWithString:urlStr]]; //本地
然后[newPlayer play];
就可以勒。
超简单的有木有!!!
AVPlayer简单一句初始化:
AVPlayer *newPlayer = [[AVPlayer alloc] initWithURL:[NSURL URLWithString:urlStr]]; //在线
或
AVPlayer *newPlayer = [[AVPlayer alloc] initWithURL:[NSURL fileWithString:urlStr]]; //本地
然后[newPlayer play];
就可以勒。
超简单的有木有!!!
更多推荐
已为社区贡献1条内容
所有评论(0)