我正在尝试播放来自以下站点的音频流:http://www.radioteofilotoni.com.br/
我有:
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:@"http://stream.jshost.com.br:1935/mobile/8056.stream/playlist.m3u8"]];
player.movieSourceType = MPMovieSourceTypeStreaming;
player.view.hidden = YES;
[self.view addSubview:player.view];
[player play];没有播放任何东西,出什么问题了?我可以从Safari访问这个m3u8链接并进行播放。
谢谢。
发布于 2013-04-19 08:33:23
该URL不返回音频流--它返回一个文本文件,如下所示:
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=52855
http://stream.jshost.com.br:1935/mobile/8056.stream/playlist.m3u8?wowzasessionid=1884064341加载该URL将提供更多非音频内容,您可以使用这些内容最终获得音频流URL。看起来Mobile Safari解析文本文件以获得流URL。您也必须这样做,因为显然MPMoviePlayerController不会这样做。
https://stackoverflow.com/questions/16093869
复制相似问题