大家知道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];
就可以勒。
超简单的有木有!!!