Simple 360 Video player for iOS using SceneKit

Overview

simple360player_iOS

Simple 360 Video player for iOS using SceneKit. VR ready. Stereoscopic Ready.

We generate a simple scene in which we add a sphere centered on the user point of view (i.e. the cameras in (0,0,0)). Then we project a texture displaying a SpriteKit scene showing the video on the sphere material.

We added the ability to pan through the scene with swipes.

Play with the activateStereoscopicVideo Boolean to switch between flat and 3D Stereoscopic (top/bottom) video file

Just remove the rightScene to have a non-VR video 360 Video player.

Hope this will be useful.

  • Swipe up/down to move the camera
  • Button to reset the position of the camera
  • Cardboard on/off button
  • Steroscopic Top/Bottom video compatible
  • Play/Pause
  • Slider to control playback position
  • Perf adjusted dependant on the device CPU architecture

alt tag

Other platforms

To check how to build a HTML5 simple360Player, check out this project: https://github.com/gbentaieb/simple360Player

Full VR Toolkit

You can find a basic VR toolkit for iOS in SceneKit Swift 2.0 here: https://github.com/Aralekk/VR_Toolkit_iOS

Comments
  • VR.mp4 file not playing

    VR.mp4 file not playing

    The current project compiles and runs on both the simulator and device but just displays a full grey screen.

    UIPanGestureRecognizer responds to gestures and I can see and play the VR.mp4 in xcode but still can't see the VP.mp4 video in the app.

    opened by weberbry 6
  • AVPlayer Looping

    AVPlayer Looping

    I am trying to take action when the video finishes. To do this I subscribed to the AVPlayerItemDidPlayToEndTimeNotification notification. By doing this I noticed that this notification gets called repeatedly after the video finishes, multiple times a second.

    I looked into the issue further by setting up KVO on the "rate" property of the player and noticed that after the videos finishes the rate values switches between 0 and 1 repeatedly, multiple times per second.

    This explains why AVPlayerItemDidPlayToEndTimeNotification is getting calls so much but does not explain why the rate keeps toggling. The actual on screen video is frozen at the last frame and does not seen to be impacted.

    The only thing that breaks this loop is calling videoSpriteKitNode!.pause(). Even this approach is not ideal because you still get a few AVPlayerItemDidPlayToEndTimeNotification notifications before you have a chance to call videoSpriteKitNode!.pause().

    opened by weberbry 3
  • Audio Playback

    Audio Playback

    For mp4 files that have audio I can not get the audio to be included in the playback. The volume property for the underlying AVPlayer is 1.0 but there is still no audio.

    Any suggestions?

    opened by weberbry 2
  • Memory Leak

    Memory Leak

    Hi Aralekk,

    I've discovered that with long videos, over 20 seconds, there is a major memory leak that causes the app to crash. I believe it is caused by the renderer function.

    When reworking the view controller to non stereoscopic, using only left scene camera, there are no memory issues. I've tried debugging this, but have had no success. I was wondering if you would take a look at it possibly.

    Thank you,

    Micah

    opened by micahchiang 1
  • managing device position offset while paused

    managing device position offset while paused

    i'm toying with the play/pause feature where upon going from play to pause the motion tracking pauses as well. before going back from pause to play, the orientation of the phone could change. for example, i could resume watching turned 180 degrees from where i was before.

    as a result, upon resuming the device orientation tracking will update the view to show me the content that is 180 degrees from the frame in which i paused.

    my goal is to make it such that when i resume playback under my new orientation, i will be able to resume watching from the angle in which i left off and still have the device motion tracking update as i move around while the video is playing again.

    i'm struggling to understand how i'd accomplish this as i'm not very experienced thinking in 3d graphics.

    how would you offset/update the orientation/quaternion based on the previously paused orientation to solve this use case?

    opened by stanchiang 0
  • Not playing local files from .document directory

    Not playing local files from .document directory

    Its working with the base example and the main bundle stuff

    but if i save the file in the documents directory the player is not playing the file FileExists on iphone

    any ideas?

    opened by Devintelligence 0
  • Memory leaks AVPlayer + SKVideoNode (on physical device)

    Memory leaks AVPlayer + SKVideoNode (on physical device)

    Hello,

    there are huge memory leaks not caused by you developers directly but I think that its Apple's SpriteKit and AVKit.

    Steps to reproduce are simple:

    1. downloaded project
    2. migrate to swift 3
    3. build on actual device
    4. play video, at the end of video seek with bar on the beginning and play again
    5. do this couple times
    6. in debug monitor in section with memory you can see that memory is growing all the time during playing
    7. at the end app crash
    opened by mstana 0
  • Pause not working bug

    Pause not working bug

    Just spotted this – if you run the example, pause it for a while and rotating the device a few times will autoplay the video. Even this is at paused mode?

    opened by terenzeyuen 2
  • device utilization % very high

    device utilization % very high

    hi Aralekk, I found the device getting very hot when running this player(it once induce the system restart), so I analyze with xcode instruments GPU tool, and found: renderer utilization %: 70~82 tiler utilization %:70~86 texture count: 809 device utilization %: 74~89

    maybe an issue? or is there any method to lower them? thanks a lot~

    opened by AdvanceYe 6
Owner
Arthur Swiniarski
Arthur Swiniarski
iOS 360-degree video player streaming from an AVPlayer.

Swifty360Player iOS 360-degree video player streaming from an AVPlayer. Demo Requirements Swifty360Player Version Minimum iOS Target Swift Version 0.2

Abdullah Selek 148 Dec 18, 2022
A sample project that provides the basics to create an interactive VR experience on iOS

VR_Toolkit_iOS A sample project that provides a basic toolkit to create an interactive VR experience on iOS. Written in Swift 2.0 using SceneKit. We a

Arthur Swiniarski 85 Apr 6, 2022
360 video player for iOS written in swift - a subset of SceneKit that works

DDDKit An open source library to support 360 videos and pictures. It's designed as a generic 3D library that you can use for much more! Example of use

Guillaume Sabran 123 Aug 9, 2022
Swifty360Player - iOS 360-degree video player streaming from an AVPlayer.

Swifty360Player iOS 360-degree video player streaming from an AVPlayer. Demo Requirements Swifty360Player Version Minimum iOS Target Swift Version 0.2

Abdullah Selek 148 Dec 18, 2022
Open Source iOS 360 Degree Panorama Video Player.

?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? The Metal with Swift 5.0 version is comming ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 360 VR Player A Open Source, Ad-free, Na

Hanton Yang 2k Dec 24, 2022
Open Source iOS 360 Degree Panorama Video Player.

?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? The Metal with Swift 5.0 version is comming ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 360 VR Player A Open Source, Ad-free, Na

Hanton Yang 2k Jan 1, 2023
iOS 360-degree video player streaming from an AVPlayer.

Swifty360Player iOS 360-degree video player streaming from an AVPlayer. Demo Requirements Swifty360Player Version Minimum iOS Target Swift Version 0.2

Abdullah Selek 148 Dec 18, 2022
AudioKit Sample Player (ROM Player) - EXS24, Sound Font, Wave Player

AudioKit ROM / Sample Player Welcome to the official AudioKit example of a sample-based music instrument written in Swift. It can be modified to play

AudioKit 500 Dec 27, 2022
SceneKit-MetalShader-SCNProgram - SceneKit MetalShader SCNProgram

SceneKit-MetalShader-SCNProgram Tech SceneKit (SCNProgram -> SCNGeometry or SCNM

null 1 Jul 16, 2022
NYT360Video plays 360-degree video streamed from an AVPlayer on iOS.

NYT360Video 360º video playback from The New York Times NYT360Video plays spherical 360º video, allowing the user to explore the video via pan gesture

The New York Times 270 Nov 23, 2022
ARVideoPortal - A Minimal iOS AR app to display 360 / video in sphere space

AR Video Portal A minimal iOS AR app to display 360 / video in sphere space. Xco

Yasuhito Nagatomo 6 Jun 3, 2022
NYT360Video plays 360-degree video streamed from an AVPlayer on iOS.

NYT360Video 360º video playback from The New York Times NYT360Video plays spherical 360º video, allowing the user to explore the video via pan gesture

The New York Times 270 Nov 23, 2022
Musical Player - A Simple Musical Player For iOS

Musical_Player The app is a musical player. It was written as an task for a mobi

null 1 Nov 26, 2022
Music Player for iOS which looks & feels like classic player

Prodigal Music Player APP looks and feels like a classic device. Bring back the good old player to life. Screenshots Home Page Album Gallery Home Page

bob.sun 40 Nov 11, 2022
▶️ video player in Swift, simple way to play and stream media on iOS/tvOS

Player Player is a simple iOS video player library written in Swift. Looking for an obj-c video player? Check out PBJVideoPlayer (obj-c). Looking for

patrick piemonte 2k Jan 2, 2023
VGPlayer - 📺 A simple iOS video player by Vein.

Swift developed based on AVPlayer iOS player,support horizontal gestures Fast forward, pause, vertical gestures Support brightness and volume adjustment, support full screen, adaptive screen rotation direction.

Wen Rong 399 Dec 23, 2022
▶️ video player in Swift, simple way to play and stream media on iOS/tvOS

Player Player is a simple iOS video player library written in Swift. Looking for an obj-c video player? Check out PBJVideoPlayer (obj-c). Looking for

patrick piemonte 2k Dec 24, 2022
Overlay alpha channel video animation player view using Metal.

Overlay alpha channel video animation player view using Metal. Example To run the example project, clone the repo, and run pod install from the Exampl

noppefoxwolf 244 Jan 1, 2023
AR Ruler - A simple iOS app made using ARKit and SceneKit

A simple iOS app made using ARKit and SceneKit.Which can try to simplify little things in your life such as measuring stuff.

Dishant Nagpal 5 Aug 31, 2022
ARDicee - Simple augmented reality app using SceneKit and ARKit

ARDicee Simple augmented reality app using SceneKit and ARKit Requirements Xcode

donggyu 3 Feb 4, 2022