是否可以在列出视频时间轴时制作peview图片,例如在带有AVPlayer的Netflix App中? exmple here
已更新。我发现mp4
视频具有该预览窗口,但m3u8
格式没有它
此处的代码:
func playVideo(cell: MovieCell) {
guard let urlVideo = URL(string: cell.movieSrc) else {
return
}
// Create an AVPlayer, passing it the HTTP Live Streaming URL.
let player = AVPlayer(url: urlVideo)
// Create a new AVPlayerViewController and pass it a reference to the player.
let controller = AVPlayerViewController()
controller.player = player
// Modally present the player and call the player's play() method when complete.
self.present(controller, animated: true) {
player.play()
}
}
答案 0 :(得分:0)
这被称为“技巧游戏”,必须包含在AVPlayer
的HLS清单中才能为您处理。
请参见Trick Play中的HLS Authoring Specification for Apple Devices部分:
6.1。必须提供I帧播放列表(EXT-X-I-FRAME-STREAM-INF)以支持清理和扫描UI。