Android: How to create YouTube-like VR-controls?
Asked Answered
D

2

16

I am trying to develop a VR video player using latest Google VR SDK for Android (v1.0.3), but there is no high-level API to build VR playback controls.

YouTube VR player uses old version of gvr toolkit and renders controls (for example, com.google.android.libraries.youtube.common.ui.TouchImageView) in some way.

enter image description here

What is the best way to implement such controls using latest VR SDK? Do I need to use custom renderer with OpenGL or NDK?

I would be very grateful for implementation details.

Depside answered 11/11, 2016 at 9:54 Comment(4)
Maybe this repository help you: github.com/Rajawali/RajawaliVRAdvice
possible duplicate: #39020603Incumber
@MiladYarmohammadi no, this question is about VR controlsDepside
@ramineftekhari thank you for your response, but RajawaliVR uses old version of GVR SDK (0.6.0) and demonstrates scene rendering in stereo mode, not controls. I'm looking for a way to render Layout/android.view.View in the way YouTube doesDepside
D
2

GVR SDK does not provide a way do draw something over VrVideoView, so we need to implement VR video by ourselves.

The main idea of solution - use GvrView with custom StereoRenderer. First of all, we need to implement VR video renderer (using VR shaders and MediaPlayer/ExoPlayer).

Then we need to implement custom controls on the scene using OpenGL ES and GVR SDK (HeadTracking, Eye, etc.).

Depside answered 21/11, 2016 at 10:13 Comment(0)
I
0

You need to use OpenGL or other engine such as Unity3D to show the video texture. Decoding the video in android and parse the texture to OpenGL or engine to show.

Inertia answered 16/11, 2016 at 9:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.