播放本地video(swift)
发布时间:2020-12-14 07:17:47 所属栏目:百科 来源:网络整理
导读:播放本地video(swift) 1.定义AVPlayer var playViewController = AVPlayerViewController() var playerView = AVPlayer() 2.初始化AVPlayer let path = NSBundle .mainBundle () .pathForResource ( "player" ,ofType: "mp4" )playerView = AVPlayer(URL: NS
播放本地video(swift)
var playViewController = AVPlayerViewController()
var playerView = AVPlayer()
let path = NSBundle.mainBundle().pathForResource("player",ofType: "mp4")
playerView = AVPlayer(URL: NSURL(fileURLWithPath: path!))
playViewController.player = playerView
self.presentViewController(playViewController,animated: true) {
self.playViewController.player?.play()
}
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- C/C++ char a[ ] 和 char *a 的差别,改变 char *a爆内存错
- BenchmarkSQL安装使用介绍
- postgresql – 更新为单个新列时,数据库大小加倍
- sqlite – Flex:如何将S:列表中的Sqlist查询绑定到S:Tex
- ruby-on-rails – 如何在Rails中记录user_name?
- c# – 用于多线程Windows服务的线程库
- net.sf.json.JSONException: There is a cycle in the hier
- c – 错误:类型’int int’的类型’int int’的引用的无效
- ruby-on-rails-3 – 如何在AWS Elastic Beanstalk应用程序上
- 当c没有指定struct layout时,为什么glBufferData缓冲区可以