我可以使用以下代码在iOS中播放直播视频:
NSURL *mediaURL = [NSURL URLWithString:@"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"];
MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:mediaURL];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:nil];
mp.view.frame = self.view.bounds;
[mp setControlStyle:MPMovieControlStyleFullscreen];
[mp setMovieSourceType:MPMovieSourceTypeStreaming];
//[mp setFullscreen:YES];
[self.view addSubview:[mp view]];
[mp prepareToPlay];
[mp play];
我传递的是.m3u8文件格式网址到MPMoviePlayerController,我可以播放直播。但是我如何使用Kaltura的直播实现它呢?
根据http://corp.kaltura.com/company/news/press-release/kaltura-%E2%80%98cracks-code%E2%80%99-reliable-hls-video-streaming-android-devices,有使用Kaltura实时视频流的Android SDK,是否有适用于直播的iOS Kaltura SDK?或者我是否必须使用内置MPMoviePlayerController的iOS进行直播,如果是,那么方式是什么?
请帮助。
答案 0 :(得分:1)
要播放Kaltura直播,您只需要使用以下参数抓取清单网址: /format/applehttp/protocol/http/a.m3u8
这里有更多细节: http://knowledge.kaltura.com/faq/how-retrieve-download-or-streaming-url-using-api-calls