Monocle is an iOS player for circular video shot with Snapchat Spectacles.
Monocle is written in Swift 3.0.
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.
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'
Monocle is also available for installation using Carthage. To integrate, add the following to your Cartfile
:
github "gizmosachin/Monocle" >= 1.0
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),
]
)
You can also simply copy Monocle.swift
into your Xcode project.
Monocle is available under the MIT license, see the LICENSE file for more information.