Skip to content
/ Player Public
forked from piemonte/Player

iOS video player in Swift, simple drop in component for playing and streaming media

License

Notifications You must be signed in to change notification settings

confile/Player

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Player

Player

Player is a simple iOS video player library written in Swift.

Features

  • plays local media or streams remote media over HTTP
  • customizable UI and user interaction
  • no size restrictions
  • orientation change support
  • simple API

If you're looking for a video player library written in Objective-C, checkout PBJVideoPlayer. For video recording, checkout PBJVision.

Build Status Pod Version

Installation

CocoaPods

Player is available and recommended for installation using the Cocoa dependency manager CocoaPods. Swift is supported as of version 0.36.

To integrate, add the following to your Podfile:

source ‘https://github.com/CocoaPods/Specs.git'
platform :iOS, ‘8.0
use_frameworks!

pod ‘Player’

Carthage

Installation is also available using the dependency manager Carthage.

To integrate, add the following line to your Cartfile:

github “piemonte/Player” >= 0.0.5

Manual

You can also simply copy the Player.swift file into your Xcode project.

Usage

The sample project provides an example of how to integrate Player, otherwise you can follow these steps.

Allocate and add the Player controller to your view hierarchy.

 self.player = Player()
 self.player.delegate = self
 self.player.view.frame = self.view.bounds
    
 self.addChildViewController(self.player)
 self.view.addSubview(self.player.view)
 self.player.didMoveToParentViewController(self)

Provide the file path to the resource you would like to play locally or stream. Ensure you're including the file extension.

 self.player.path = "Video.mp4"

play/pause/chill

 self.player.playFromBeginning()

Adjust the fill mode for the video, if needed.

 self.player.fillMode = “AVLayerVideoGravityResizeAspect”

Community

Resources

License

Player is available under the MIT license, see the LICENSE file for more information.

About

iOS video player in Swift, simple drop in component for playing and streaming media

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 91.7%
  • C++ 6.0%
  • Ruby 2.3%