SwiftVideoPlayer
示例
要运行示例项目,首先克隆仓库,然后在 Example 目录中运行 pod install
需求
安装
SwiftVideoPlayer 通过 CocoaPods 提供。要安装它,只需将以下行添加到 Podfile 中
pod 'SwiftVideoPlayer'
使用方法
let player = PlayerVC([(videoURL: URL(string: "https://v.cdn.vine.co/r/videos/AA3C120C521177175800441692160_38f2cbd1ffb.1.5.13763579289575020226.mp4")!, previewURL: nil)])
self.present(player, animated: true, completion: nil)
或
class ViewController: PlayerVC {
override func viewDidLoad() {
super.viewDidLoad()
}
}
或
var player: PlayerVC!
override func viewDidLoad() {
super.viewDidLoad()
player = PlayerVC([(videoURL: URL(string: "https://v.cdn.vine.co/r/videos/AA3C120C521177175800441692160_38f2cbd1ffb.1.5.13763579289575020226.mp4")!, previewURL: nil)])
self.player.view.frame = CGRect(x: 50, y: 50, width: view.frame.width - 100, height: view.frame.height - 100)
self.addChildViewController(player)
self.view.addSubview(player.view)
self.player.didMove(toParentViewController: self)
}
作者
hapsidra, [email protected]
许可证
SwiftVideoPlayer在MIT许可证下可用。有关更多信息,请参阅LICENSE文件。