All Projects → abdullahselek → Swifty360player

abdullahselek / Swifty360player

Licence: mit
iOS 360-degree video player streaming from an AVPlayer.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Swifty360player

Fwplayer
A video player SDK for iOS, it is based on AVPlayer. https://se.linkedin.com/in/foks-huiwang, https://fokswang.wixsite.com/home
Stars: ✭ 321 (+172.03%)
Mutual labels:  media, avplayer, cocoapods, carthage
Ktvhttpcache
A powerful media cache framework.
Stars: ✭ 2,113 (+1690.68%)
Mutual labels:  media, cocoapods, carthage
Closures
Swifty closures for UIKit and Foundation
Stars: ✭ 1,720 (+1357.63%)
Mutual labels:  cocoapods, carthage, uiview
Pandoraplayer
🅿️ PandoraPlayer is a lightweight music player for iOS, based on AudioKit and completely written in Swift.
Stars: ✭ 1,037 (+778.81%)
Mutual labels:  media, streaming, cocoapods
Ezplayer
基于AVPlayer封装的视频播放器,功能丰富,快速集成,可定制性强,支持react-native。
Stars: ✭ 377 (+219.49%)
Mutual labels:  media, avplayer, carthage
Vgplayer
📺 A simple iOS video player by Vein.
Stars: ✭ 383 (+224.58%)
Mutual labels:  avplayer, cocoapods, carthage
React Native Ezplayer
EZPlayer component for react-native apps
Stars: ✭ 47 (-60.17%)
Mutual labels:  media, avplayer, carthage
Buckets Swift
Swift Collection Data Structures Library
Stars: ✭ 106 (-10.17%)
Mutual labels:  cocoapods, carthage
Nextgrowingtextview
📝 The next in the generations of 'growing textviews' optimized for iOS 8 and above.
Stars: ✭ 1,540 (+1205.08%)
Mutual labels:  cocoapods, carthage
Swifterswift
A handy collection of more than 500 native Swift extensions to boost your productivity.
Stars: ✭ 10,706 (+8972.88%)
Mutual labels:  cocoapods, carthage
Pincodeinputview
A input text view for entering pin code.
Stars: ✭ 108 (-8.47%)
Mutual labels:  cocoapods, carthage
Ihequalizerview
An Custom UIView which draws the output of an audio asset in real time.
Stars: ✭ 106 (-10.17%)
Mutual labels:  cocoapods, uiview
Ccnpreferenceswindowcontroller
CCNPreferencesWindowController is an Objective-C subclass of NSWindowController that automatically manages your custom view controllers for handling app preferences.
Stars: ✭ 105 (-11.02%)
Mutual labels:  cocoapods, carthage
Fscalendar
A fully customizable iOS calendar library, compatible with Objective-C and Swift
Stars: ✭ 9,829 (+8229.66%)
Mutual labels:  cocoapods, carthage
Tkdotsegment
TKDotSegment is a segment with dot animation
Stars: ✭ 103 (-12.71%)
Mutual labels:  cocoapods, carthage
Alamofire
Elegant HTTP Networking in Swift
Stars: ✭ 36,896 (+31167.8%)
Mutual labels:  cocoapods, carthage
Rdgliderviewcontroller Swift
Control for a floating view gliding over a ViewController Edit
Stars: ✭ 102 (-13.56%)
Mutual labels:  cocoapods, carthage
Nvactivityindicatorview
A collection of awesome loading animations
Stars: ✭ 10,031 (+8400.85%)
Mutual labels:  cocoapods, carthage
Arplayer
Playback videos using ARKit and AVFoundation.
Stars: ✭ 117 (-0.85%)
Mutual labels:  avplayer, scenekit
Device
Light weight tool for detecting the current device and screen size written in swift.
Stars: ✭ 1,503 (+1173.73%)
Mutual labels:  cocoapods, carthage

Build Status CocoaPods Compatible Carthage Compatible License

Swifty360Player Swifty360Player

iOS 360-degree video player streaming from an AVPlayer.

Demo

Swifty360Player Demo

Requirements

Swifty360Player Version Minimum iOS Target Swift Version
0.2.5 11.0 5.x
0.2.2 11.0 4.2
0.2.1 10.0 4.1
0.2 10.0 4.0

CocoaPods

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

$ gem install cocoapods

To integrate Swifty360Player into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'Swifty360Player', '0.2.5'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

brew update
brew install carthage

To integrate Swifty360Player into your Xcode project using Carthage, specify it in your Cartfile:

github "abdullahselek/Swifty360Player" ~> 0.2.5

Run carthage update to build the framework and drag the built Swifty360Player.framework into your Xcode project.

Swift Package Manager

Modify your Package.swift file to include the following dependency:

.package(url: "https://github.com/abdullahselek/Swifty360Player.git", from: "0.2.5")

Run swift package resolve

XCFramework

XCFrameworks require Xcode 11 or later and integration is very similar to integration of .framework format. Please use script scripts/build-framework.sh to generate binary Swifty360Player.xcframework archive that you can use as a dependency in Xcode.

Swifty360Player.xcframework is a Release (Optimized) binary that offer best available Swift code performance.

Example Usage

You just need an AVPlayer instance created with a valid video url and a Swifty360MotionManager instance. You can use these code snippets in a UIViewController instance.

Video url can be either local or remote.

let videoURL = URL(fileURLWithPath: Bundle.main.path(forResource: "google-help-vr", ofType: "mp4")!)
let player = AVPlayer(url: videoURL)

let motionManager = Swifty360MotionManager.shared
swifty360ViewController = Swifty360ViewController(withAVPlayer: player, motionManager: motionManager)

addChildViewController(swifty360ViewController)
view.addSubview(swifty360ViewController.view)
swifty360ViewController.didMove(toParentViewController: self)

player.play()

let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(reorientVerticalCameraAngle))
view.addGestureRecognizer(tapGestureRecognizer)

Tap Gesture Handler

@objc func reorientVerticalCameraAngle() {
    swifty360ViewController.reorientVerticalCameraAngleToHorizon(animated: true)
}

Using storyboard and Swifty360ViewController as parent class

guard let swifty360ViewController = self.storyboard?.instantiateViewController(withIdentifier: "TestViewController") as? TestViewController else {
    return
}
let videoURL = URL(fileURLWithPath: Bundle.main.path(forResource: "google-help-vr", ofType: "mp4")!)
let player = AVPlayer(url: videoURL)
let motionManager = Swifty360MotionManager.shared
swifty360ViewController.player = player
swifty360ViewController.motionManager = motionManager
self.present(swifty360ViewController, animated: true, completion: nil)
import UIKit
import Swifty360Player

class TestViewController: Swifty360ViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        player.play()
    }

}

Example use of Swifty360View with using code commands

let videoURL = URL(fileURLWithPath: Bundle.main.path(forResource: "google-help-vr", ofType: "mp4")!)
let player = AVPlayer(url: videoURL)

let motionManager = Swifty360MotionManager.shared

let swifty360View = Swifty360View(withFrame: view.bounds,
                                  player: player,
                                  motionManager: motionManager)
swifty360View.setup(player: player, motionManager: motionManager)
view.addSubview(swifty360View)

player.play()

Using Swifty360View with Storyboard

  • Add a UIView to your viewcontroller and change it's class as Swifty360View
  • Connect via IBOutlets

and

let videoURL = URL(fileURLWithPath: Bundle.main.path(forResource: "google-help-vr", ofType: "mp4")!)
let player = AVPlayer(url: videoURL)

let motionManager = Swifty360MotionManager.shared

swifty360View.setup(player: player, motionManager: motionManager)

player.play()

Tap gesture recognizers for Swifty360View, create one recognizer for your viewcontroller's view

let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(reorientVerticalCameraAngle))
view.addGestureRecognizer(tapGestureRecognizer)

and selector function

@objc func reorientVerticalCameraAngle() {
    swifty360View.reorientVerticalCameraAngleToHorizon(animated: true)
}

License

Swifty360Player is released under the MIT license. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].