360 Video Player for Android


Source link: https://github.com/fbsamples/360-video-player-for-android

360 Video Player for Android

360 video is the new hotness in interactive media. Imagine teleporting yourself to the most interesting places in the world, training with Lebron James, or speeding across the Jakku desert from Star Wars. These are the kinds of immersive experiences that 360 video enables.

Enclosed you'll find a sample Android application that demonstrates how to playback 360 video, specifically equirectangular video, using MediaPlayer, TextureView, and OpenGL ES. Touch and drag is supported to adjust the yaw and the pitch to see more of the 360 video.

The launch activity will load a sample 360 video included in: res/raw/sample360.mp4

Today's 360 cameras generally either output directly in equirectangular format or provide software to convert to equirectangular. Facebook ingests 360 videos in equirectangular format.

Visit:

Disclaimer

  • This code is intended as an example and is by no means production quality.
  • It may not be entirely stable.
  • It has been tested on limited high end Android devices
    • Works on Genymotion with Nexus 5 (5.1.0).
    • Didn't work on the new Android Studio 2.1 Preview 1 emulator (Nexus 5X AVD with HAX enabled).
  • It's not intended as a demonstration of "the right way" to do things.
  • It will not be supported.

Requirements

Requires Android OS version KitKat (4.0) or higher.

To build you'll need the Android SDK with build tools.

Note: the gradle project was created with Android Studio Preview 2.1 Preview 1

The included sample video is 4k 30fps so be sure to use an Android device that can handle that video decode.

GearVR compatible devices such as the Note4, Note5, S6, S7, should have no issues with video decode performance.

Usage

Android Studio

Open the directory in Android Studio and the gradle project should be imported. Run & Debug options should allow you to build the project.

Command Line

Assure you have a local.properties file in the top level directory with: sdk.dir=/path/to/your/Android/sdk

$ gradlew installDebug $ adb shell am start -n com.oculus.sample/.SphericalPlayerActivity 

Resources

A PhotoView to scale image and finish activity.

Devknox is a developer friendly plugin developed by the team behind Appknox, a cloud-based mobile security solution trusted by many businesses worldwide.

Devknox is a slick and handy security plugin for Android Studio and IntelliJ. It helps developers detect and resolve security issues as they write code.

Java 8 Optional-like APIs for everyone.

A websocket client library for Android.

A date time range picker for android written in Kotlin.

A simple view to see logcat in your app.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes