是否可以像在 Netflix 应用程序中那样在滚动视频时间轴时制作预览图像?
Is it possible to make preview image while scroll video timeline like in Netflix app?
是否可以在列出视频时间轴的同时制作 peview 图像,就像在带有 AVPlayer 的 Netflix App 中一样?
exmple here
我发现 mp4
视频有预览 window,但 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()
}
}
这称为 "Trick Play",必须包含在 HLS 清单中,AVPlayer
才能为您处理。
查看 Trick Play section in HLS Authoring Specification for Apple Devices:
6.1. I-frame playlists (EXT-X-I-FRAME-STREAM-INF) MUST be provided to support scrubbing and scanning UI.
是否可以在列出视频时间轴的同时制作 peview 图像,就像在带有 AVPlayer 的 Netflix App 中一样? exmple here
我发现 mp4
视频有预览 window,但 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()
}
}
这称为 "Trick Play",必须包含在 HLS 清单中,AVPlayer
才能为您处理。
查看 Trick Play section in HLS Authoring Specification for Apple Devices:
6.1. I-frame playlists (EXT-X-I-FRAME-STREAM-INF) MUST be provided to support scrubbing and scanning UI.