SVEViewPlayerView is an iOS view that diplays videos.
SVEViewPlayerView is available through Swift Package Manager. To install
it, simply add the following line to your Package.swit
:
dependencies: [
.package(url: "https://github.com/SergioEstevao/SVEVideoPlayerView.git", from: "0.1")
]
To use the video player do the following:
import SVEVideoPlayerView
let videoURL = Bundle.main.url(forResource: "video", withExtension: "mp4")
let videoView = VideoPlayerView(videoURL: videoURL)
view.addSubview(videoView)
videoView.play()
You can set a delegate to the video view to get notified of the end of play and error situations.
videoURL.delegate = self
...
func videoPlayerView(playerView: VideoPlayerView, didFailWithError error: Error) {
print("Error: \(error)\n")
}
func videoPlayerViewStarted(playerView: VideoPlayerView) {
print("Started\n")
}
func videoPlayerViewFinish(playerView: VideoPlayerView) {
print("Finish\n")
}
videoView.showsPlayBackControls = true
To run the example project, clone the repo, and open the SVEVideoPlayerView.xcproject
file
If you have questions about getting setup or just want to say hi, just drop an issue on Github with your request.
SVEVideoPlayerView is available under the MIT license. See the LICENSE file for more info.
link |
Stars: 0 |
Last commit: 4 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics