Kaltura SDK for iOS 和 Android 中有更新,到目前为止他们在文档中没有更改/更新。:
根据旧 SDK,KPViewController 中有方法 initWithUrl,您可以使用以下方法播放视频:
NSString *videoUrl = [NSString stringWithFormat:@"https://cdnapisec.kaltura.com/p/243342/sp/24334200/embedIframeJs/uiconf_id/12905712/partner_id/1988382?iframeembed=true&entry_id=%@",entryId];
NSURL *url = [NSURL URLWithString:videoUrl];
self.player = [[KPViewController alloc] initWithURL:url];
self.player.view.frame = [self.viewVideo bounds];
[self.player loadPlayerIntoViewController:self];
[self.viewVideo addSubview:self.player.view];
但根据新的 SDK 和演示参考应用程序:https ://github.com/kaltura/IOSReferenceApp
install the SDK using pod :
1) on terminal,go to the Project Directory and run -> pod init
2) open the Podfile and copy and paste
pod 'player-sdk-native-ios', '~> 1.1'
before this line : target 'KalturaVideo_ObjC' do
close and save the file
3) pod install
4) close your current XCode project and open your ProjectName.xcworkspace file
MediaInfoViewController_iPhone.m 中有 - (void)drawPlayer 方法,它将 KPViewController* playerViewController 添加到 ViewController
以防万一您无法使用演示应用播放视频,请调用 [self playButtonPressed];在drawPlayer方法的最后,直接播放视频,playButtonPressed方法有播放视频的实现。