armanddp / Monocle

🕶 Snapchat Spectacles video player

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Monocle

Monocle is an iOS player for circular video shot with Snapchat Spectacles.

Spectacles

Pod Version Carthage compatible Build Status

Version Compatibility

Monocle is written in Swift 3.0.

Usage

Monocle is a UIView subclass that requires an AVPlayer instantiated with a circular video.

let monocle = Monocle()
monocle.player = AVPlayer(url: \* ... \*)
view.addSubview(monocle)

By default, Monocle responds to device motion events and rotates the video. You can disable this if you want.

monocle.shouldAutorotate = false

Note that Monocle only supports video exported by Snapchat that were shot with Spectacles. Please see the sample app for a basic implementation.

Installation

CocoaPods

Monocle is available for installation using CocoaPods. To integrate, add the following to your Podfile`:

platform :ios, '9.0'
use_frameworks!

pod 'Monocle', '~> 1.0'

Carthage

Monocle is also available for installation using Carthage. To integrate, add the following to your Cartfile:

github "gizmosachin/Monocle" >= 1.0

Swift Package Manager

Monocle is also available for installation using the Swift Package Manager. Add the following to your Package.swift:

import PackageDescription

let package = Package(
    name: "MyProject",
    dependencies: [
        .Package(url: "https://github.com/gizmosachin/Monocle.git", majorVersion: 0),
    ]
)

Manual

You can also simply copy Monocle.swift into your Xcode project.

License

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

About

🕶 Snapchat Spectacles video player

License:MIT License


Languages

Language:Swift 87.9%Language:Ruby 12.1%