gpt4 book ai didi

ios - 如何隐藏 AVPlayerViewController 控制栏?

转载 作者:行者123 更新时间:2023-11-29 12:09:42 30 4
gpt4 key购买 nike

我已经实现了 iAd 的前置视频广告,我想保证我的用户会观看整个广告。如何隐藏 AVPlayerViewController 的控制栏,以便用户无法点击“完成”并在视频结束前离开?

self.canDisplayBannerAds = YES;
[AVPlayerViewController preparePrerollAds];
player = [[AVPlayerViewController alloc] init];
player.showsPlaybackControls = NO;
player.delegate = self;

最佳答案

简单代码

// create an AVPlayer
AVPlayer *player = [AVPlayer playerWithURL:videoURL];

// create a player view controller
AVPlayerViewController *controller = [[AVPlayerViewController alloc]init];
controller.player = player;
controller.showsPlaybackControls = FALSE;

关于ios - 如何隐藏 AVPlayerViewController 控制栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33828940/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com