Git Product home page Git Product logo

playerkit's Introduction

PlayerKit

CI Status Version License Platform

PlayerKit is a modular video player system for iOS and tvOS.

Motivation

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.

Goals

  • Provide an interface defining a common API and delegate callback strategy for different types of players to implement
  • Allow players to define their capabilities using protocol conformance

Example

To run the example project, clone the repo, and run pod install from the Example directory.

Minimum Requirements

  • iOS 8.0 / tvOS 9.0
  • Swift 4.2

Installation

PlayerKit is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "PlayerKit"

Usage

Using RegularPlayer

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"))

player.play()

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

Creating New Types of Players

You can create your own players by creating objects that conform to the Player protocol and call the delegate methods when appropriate.

Questions?

Post on Stackoverflow with the tag vimeo-ios. Get in touch here. Interested in working at Vimeo? We're hiring!

License

PlayerKit is available under the MIT license. See the LICENSE file for more info.

playerkit's People

Contributors

bryantjustin avatar dependabot[bot] avatar ghking avatar jasonhawkins avatar jumhyn avatar legonaftik avatar mikew-personal avatar nicolelehrer avatar supperspidey avatar wilrnh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.