PlayerKit is a modular video player system for iOS and tvOS.
Vimeo supports various types of video and playback (360 video, Chromecast, etc.). PlayerKit allows the app to create, utilize, and interact with different types of players in an abstract way.
To run the example project, clone the repo, and run
pod installfrom the Example directory.
PlayerKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
RegularPlayer is an implementation of Player used to play regular videos.
To play a video:
let player = RegularPlayer()
view.addSubview(player.view) // RegularPlayer conforms to
ProvidesView, so we can add its view
player.set(asset: AVURLAsset(URL: "https://example.com/video.mp4"))
Optionally, an object can conform to PlayerDelegate to receive updates from the player and perform actions such as UI updates. Check out the example project for an example of this.
player.delegate = delegate
You can create your own players by creating objects that conform to the Player protocol and call the delegate methods when appropriate.
Post on Stackoverflow with the tag
vimeo-ios. Get in touch here. Interested in working at Vimeo? We're hiring!
PlayerKit is available under the MIT license. See the LICENSE file for more info.