ios – 如何在AVPlayerViewController中禁用音频和字幕设置

ios – 如何在AVPlayerViewController中禁用音频和字幕设置,第1张

概述我想从播放器(iOS8,iOS9)中删除音频字幕设置按钮: 玩家的控制器初始化: - (void) configureMoviePlayer { if(self.moviePlayerController == nil) { self.moviePlayerController = [[AVPlayerViewCont 我想从播放器(iOS8,iOS9)中删除音频和字幕设置按钮:

玩家的控制器初始化:

- (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中禁用音频和字幕设置所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1003681.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-22
下一篇2022-05-22

发表评论

登录后才能评论

评论列表(0条)

    保存