360 Video Player for Android

repository·master·Indexed 20 days ago

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

A sample Android application demonstrating 360-degree equirectangular video playback using MediaPlayer, TextureView, and OpenGL ES. It features touch-based yaw and pitch adjustments for navigating the video space and requires Android KitKat (4.0) or higher.

Tokens
468
Snippets
1
Records
4
Agent score
20%

What's inside 360-video-player-for-android

  1. Understand the 360 Video Player implementation

    master

    This project is a sample Android application demonstrating how to play back 360-degree video, specifically in equirectangular format.

    Key technical components include:

    • MediaPlayer: For video playback.
    • TextureView: For rendering the video frames.
    • OpenGL ES: For the spherical projection and rendering logic.

    Features:

    • Interaction: Supports touch and drag to adjust the yaw and pitch for navigating the 360-degree view.
    • Sample Content: The launch activity loads a sample video located at res/raw/sample360.mp4.
  2. Build and run the 360 Video Player via Command Line

    master

    To build and run the application from the command line, ensure you have a local.properties file in the top-level directory containing the path to your Android SDK:

    sdk.dir=/path/to/your/Android/sdk

    Then, use the following commands to install the debug build and launch the spherical player activity:

    $ gradlew installDebug
    $ adb shell am start -n com.oculus.sample/.SphericalPlayerActivity
  3. Check requirements for the 360 Video Player

    master

    Before building or running the project, ensure your environment meets these requirements:

    • Android OS: KitKat (4.0) or higher.
    • Build Tools: Android SDK with build tools.
    • Hardware Performance: The included sample video is 4k 30fps. Use a high-end Android device capable of 4k decoding. GearVR compatible devices (e.g., Note4, Note5, S6, S7) are recommended for optimal performance.
    • Emulator Note: The project was created with Android Studio 2.1 Preview 1. It has been tested on Genymotion with Nexus 5 (5.1.0), but may not work on certain HAX-enabled emulators.