[英]Not able to play Slo-Mo Videos with AVPlayer in swift
override func tableView(_ tableView: UITableView, didSelectRowAt
indexPath: IndexPath) {
let cell = tableView.cellForRow(at: indexPath) as!
videoList_TableView_Cell_Controller
let playerController = AVPlayerViewController()
let player = AVPlayer(url: cell.videoUrl!)
playerController.player = player
self.present(playerController, animated: true, completion: {
playerController.player?.play()
})
}
那是我在用戶單擊單元格中的視頻圖標時播放視頻的代碼。但是,問題是當我想播放顯示錯誤的Slo-Mo視頻時。 我正在獲取視頻資產,然后使用url訪問它們。 請提供慢動作視頻的解決方案。
您可以使用AVPlayer
的rate
屬性,如Apple文檔所示
var rate: Float
當前播放速率。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.