gpt4 book ai didi

ios - 从 AVPlayerViewController 中删除 Quicktime Logo

转载 作者:行者123 更新时间:2023-12-04 12:03:43 25 4
gpt4 key购买 nike

我正在使用 AVPlayerViewController 实现视频播放器。它在流式传输视频时在 iOS 11 设备上显示快速时间标志。
如何删除这个?我需要使用自定义图像作为占位符。 enter image description here
请找到我的代码:

AVPlayerItem *playerItem = [[AVPlayerItem alloc] initWithURL:[NSURL URLWithString:self.currentPlayingURL]];

最佳答案

您需要将自定义图像添加到 AVPlayerController 的内置 contentOverlayView这是一个显示在视频内容和播放控件之间的 View 。
使用内容覆盖 View 在视频内容和控件之间添加非交互式自定义 View ,例如 Logo 或水印。
swift

let playerController = AVPlayerViewController()  
let mediaPlayer = AVPlayer(url: mediaURL)
let playerController?.player = mediaPlayer

// these next two lines are your answer
let customImageView = UIImageView(image: UIImage(named: "myCustomImage"))
playerController.contentOverlayView?.addSubview(customImageView)
obj-c
[yourPlayerViewController.contentOverlayView addSubview: addYourCustomImageViewHere]

关于ios - 从 AVPlayerViewController 中删除 Quicktime Logo ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47590291/

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