gpt4 book ai didi

ios - AVI 视频不适用于 AVPlayerViewController

转载 作者:可可西里 更新时间:2023-11-01 01:56:50 34 4
gpt4 key购买 nike

我正在尝试使用播放流视频,AVPlayerViewController,所有其他扩展都可以正常工作“3GP MP4 ...”,但“.avi”视频以空白屏幕开始。

  if let videoURL = URL(string: "http://techslides.com/demos/samples/sample.avi"){
let player = AVPlayer(url: videoURL)

let playerViewController = AVPlayerViewController()

playerViewController.player = player

self.present(playerViewController, animated: true) {
playerViewController.player!.play()
}
}

最佳答案

阅读 AVPlayer docs

An AVPlayer is a controller object used to manage the playback and timing of a media asset. You can use an AVPlayer to play local and remote file-based media, such as QuickTime movies and MP3 audio files

因此QuickTime应该支持视频格式

目前 QuickTime 列表支持的格式不包含 .avi

因此,一个合适的解决方案是使用自定义视频播放器。

关于ios - AVI 视频不适用于 AVPlayerViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52308616/

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