2
我有一个URL(http://ms1.clickhere2.com:1935/live/power98/playlist.m3u8),并想在iPhone上玩m3u8格式,有人会帮忙,我已经使用了MPMEDIAPLAYER框架和其他东西。如何播放m3u8音频文件?
我有一个URL(http://ms1.clickhere2.com:1935/live/power98/playlist.m3u8),并想在iPhone上玩m3u8格式,有人会帮忙,我已经使用了MPMEDIAPLAYER框架和其他东西。如何播放m3u8音频文件?
尝试这样的:
NSString *path =[[NSString alloc] initWithString:@"http://stream.alayam.com/alayam/alayam/playlist.m3u8"];
NSURL *audioUrl=[NSURL URLWithString:path];
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:audioUrl];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(loadStateDidChange:) name:MPMoviePlayerLoadStateDidChangeNotification
object:player];
if ([player respondsToSelector:@selector(loadState)])
{
[player setControlStyle:MPMovieControlModeVolumeOnly];
[player setFullscreen:YES];
[player prepareToPlay];
}
的MPMoviePlayerController在iOS10贬值使用AVFoundation代替。 – 2016-10-16 22:25:45
http://stackoverflow.com/questions/2715015/streaming-to-iphone-via-m3u8 – akk 2012-03-29 09:40:36