
玩家的控制器初始化:
- (voID) configureMovIEPlayer { if(self.movIEPlayerController == nil) { self.movIEPlayerController = [[AVPlayerVIEwController alloc] init]; [self.vIEw setTranslatesautoresizingMaskIntoConstraints:NO]; [self.movIEPlayerController.vIEw setTranslatesautoresizingMaskIntoConstraints:NO]; [self.vIEw addSubvIEw: [self.movIEPlayerController vIEw]]; NSDictionary *vIEws = @{ @"selfvIEw" : self.vIEw,@"movIEControllerVIEw" : [self movIEPlayerController].vIEw}; [self.vIEw addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[movIEControllerVIEw]|" options:0 metrics:nil vIEws:vIEws]]; [self.vIEw addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[movIEControllerVIEw]|" options:0 metrics:nil vIEws:vIEws]]; } } 收到流URL后,它将传递给新的播放器实例:
self.movIEPlayerController.player = [AVPlayer playerWithURL:self.contentUrl]; //self.movIEPlayerController.showsPlaybackControls = YES; if([self.movIEPlayerController respondsToSelector:@selector(allowsPictureInPicturePlayback)]) { self.movIEPlayerController.allowsPictureInPicturePlayback = YES;} 示例in the WWDC video不包含按钮.有没有办法只禁用单个按钮,或获取默认工具栏按钮的数组并禁用特定的按钮.
解决方法 在我们的例子中,此处的信息删除了不需要的按钮https://developer.apple.com/library/content/qa/qa1801/_index.html
您需要明确声明内容不包含隐藏式字幕(CLOSED-CAPTIONS = NONE,上面注释中的完整详细信息)
总结以上是内存溢出为你收集整理的ios – 如何在AVPlayerViewController中禁用音频和字幕设置全部内容,希望文章能够帮你解决ios – 如何在AVPlayerViewController中禁用音频和字幕设置所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)