Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to play 360º video in iPhone SDK

Before downvote please read the question, I also see other question but doesn't find useful.

I have a requirement in my current app, where i needed to play 360º video (Like Panorama). one app on app store doing same Name "GoPano"

http://itunes.apple.com/ke/app/gopano/id459463884?mt=8

like image 935
Mangesh Avatar asked May 16 '12 11:05

Mangesh


People also ask

How do you watch 360 videos?

Open the YouTube app on Android. Search for a VR video or go to the YouTube Virtual Reality house channel by searching for "Virtual Reality." Look for this icon to find the right channel . Select a VR video. To start playback, tap the play button.

How do I play videos on IOS?

Play a videoAs you browse photos and videos in the Photos app, tap a video to play it on your iPhone. While it plays, you can do any of the following: Tap the player controls below the video to pause, unmute, favorite, share, delete, or see video information; tap the screen to hide the player controls.


2 Answers

I created a framework over the last 2.5 years, which plays back 360° panoramic video playback on iOS, similar to your requirements. It is compatible with versions 4.3 up to 6.x at this point.

You can download it at www.panframe.com and try if this is what you are looking for.

The framework supplies a UIView that you can easily add as a child and an asset class which you can connect to the view and which will take care of playing spherical panoramic content. You can look at the interface I used.

You can use it like this dynamically for example in your UIViewController at runtime:

    // initialize an PFView
    PFView pfView = [PFObjectFactory viewWithFrame:[self.view bounds]];
    pfView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);

    // set the appropriate navigation mode PFView
    [pfView setNavigationMode:PF_NAVIGATION_MOTION];

    // add the view to the current stack of views
    [self.view addSubview:pfView];
    [self.view sendSubviewToBack:pfView];

And when you want to play an 360 video asset (from a file URL) you implement the following:

    PFView pfAsset = [PFObjectFactory assetFromUrl:[NSURL fileURLWithPath:filePath] observer:(PFAssetObserver*)self];

    if ([pfAsset getStatus] != PF_ASSET_ERROR)
    {
        [pfView displayAsset:pfAsset];
        [pfAsset play];
    }

Update: In case some one wants to use it in cordova apps, you can find plugin here

like image 142
Ron Bakker Avatar answered Sep 28 '22 07:09

Ron Bakker


I found these repos useful when creating my own video 360° player:

  • https://github.com/hanton/HTY360Player
  • https://github.com/Aralekk/simple360player_iOS
  • https://github.com/nomtek/spherical_video_player_ios

The last one is mine, and here is it's description.

like image 31
lechec Avatar answered Sep 28 '22 07:09

lechec