Player View 是使用 Swift 的 AVPlayer 的委托视图
玩家视图
一个优雅的包装器API,用于AVPlayer通过委托获取事件,因此您不需要使用KVO
安装
PlayerView可通过CocoaPods获得。要安装
它,只需将以下行添加到您的 Podfile 中:
可可豆荚
PlayerView
可通过 CocoaPods 获得。要安装
它,只需将以下行添加到您的:Podfile
迦太基
也可以使用依赖关系管理器迦太基进行安装。
要集成,请将以下行添加到您的 :Cartfile
Swift Package Manager
可以使用 Swift 包管理器完成安装,请在您的 :Package.swift
用法
To run the example project, clone the repo, and run from the Example directory first.pod install
Storyboard
Just add a view and add as a class on Identity inspector > Custom Class > Class, make sure to add Module if is imported externaly (Pod, Package manager ....)
Code
Just need to add de view as a normal View:
Control
Delegate
you could get event data from the PlayerView, just implement the delegate
all the functions are optionals
Extra Info
-
If you like another shorcut, have a better implementation of something or just say thanks, just send me an email [davidlondono9@gmail.com](mailto:davidlondono9@gmail.com?subject=PlayerView is Awesome)
-
Im using a video on http, so I needed to add this on the to accept all on http,
this is not safe to use on production, so better to add only trusted domains or use httpsinfo.plist
Author
David Alejandro, [davidlondono9@gmail.com](mailto:davidlondono9@gmail.com?subject=PlayerView is Awesome)
License
PlayerView is available under the MIT license. See the LICENSE file for more info.