我一直在使用 AVKit 流式传输视频,下面是我用来在 TVOS 中流式传输视频的代码。但问题是我无法对 Dropbox Link 做同样的事情?是否需要 Dropbox API 集成?
func _viewVideo(_ url: Foundation.URL)
{
let url = Foundation.URL(string: "http://techslides.com/demos/sample-videos/small.mp4")
let asset = AVURLAsset(url: url)
let item = AVPlayerItem(asset: asset)
let player = AVPlayer(playerItem: item)
playerViewController?.player = player
playerViewController?.view.frame = CGRect(x: 0, y: 0, width: self.view.bounds.size.width, height: self.view.bounds.size.height)
playerViewController?.showsPlaybackControls = true
self.view.addSubview((playerViewController?.view)!)
player.play()
}