Latest 0.0.8
Homepage https://github.com/Cwoodall6/DyooVideoPlayer
License MIT
Platforms ios 11.0, requires ARC
Authors

CocoaPods
Platform

A beautiful swift video player created for a collection of projects by dyoo.

Paused Playing

Why

There are a plethora of video player repos on Github, but they all needed too much aditional configuration (Adding buttons, adding as child view controller, etc.). This video player contains most of the configuration out of the box, and in only a few steps you can stream videos. This player is specifically created for dyoo products and follows the style and design set by those products.

Installation

CocoaPods is a dependency manager for Cocoa projects.
You can install it with the following command:

$ gem install cocoapods

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

pod 'DyooVideoPlayer'

Getting Started

Create an instance of DyooVideoPlayerView with an initial CGRect, initialize a DyooPlayerItem with your video URL, and set the item in the DyooVideoPlayerView:

let playerView = DyooVideoPlayerView(frame: CGRect(x: 0, y: 0, width: bounds.width, height: bounds.width * (9/16)))
let item = DyooPlayerItem(url: url)
playerView?.set(item: item)

Create an instance of DyooVideoPlayerControls and pass that to our DyooVideoPlayerView with the use(controls: DyooVideoPlayerControls) function:

let controls = DyooVideoPlayerControls()
playerView.use(controls: controls)

Adding to View

The best way to add our player view is to have it nested in a subview, that way if a user enters full screen and exits fullscreen DyooVideoPlayerView automatically resizes back to its original placement:

let subView = UIView()
addSubview(subView)
subView.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
    subView.topAnchor.constraint(equalTo: topAnchor),
    subView.widthAnchor.constraint(equalTo: widthAnchor),
    subView.heightAnchor.constraint(equalToConstant: bounds.width * (9/16)),
    subView.centerXAnchor.constraint(equalTo: centerXAnchor)
    ])

subView.addSubview(playerView)
playerView.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
    playerView.topAnchor.constraint(equalTo: subView.topAnchor),
    playerView.rightAnchor.constraint(equalTo: subView.rightAnchor),
    playerView.bottomAnchor.constraint(equalTo: subView.bottomAnchor),
    playerView.leftAnchor.constraint(equalTo: subView.leftAnchor)
    ])

Creator

Chaz Woodall – [email protected]

License

DyooVideoPlayer is available under the MIT license.

Latest podspec

{
    "name": "DyooVideoPlayer",
    "version": "0.0.8",
    "summary": "A video player created for reuse.",
    "description": "This pod is used to play videos on iOS devices.",
    "homepage": "https://github.com/Cwoodall6/DyooVideoPlayer",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Chaz Woodall": "[email protected]"
    },
    "social_media_url": "https://twitter.com/backpackchaz",
    "requires_arc": true,
    "platforms": {
        "ios": "11.0"
    },
    "swift_version": "4.2",
    "source": {
        "git": "https://github.com/Cwoodall6/DyooVideoPlayer.git",
        "tag": "0.0.8"
    },
    "source_files": "DyooVideoPlayer/**/*.{h,m,swift}",
    "resources": [
        "DyooVideoPlayer/*.xcassets"
    ]
}

Pin It on Pinterest

Share This