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.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
Nick
  • 311
  • 1
  • 10
  • Maybe this repository help you: https://github.com/Rajawali/RajawaliVR – coder Nov 20 '16 at 20:26
  • possible duplicate: http://stackoverflow.com/questions/39020103/how-to-view-normal-video-in-cardboard-like-youtube – Milad Yarmohammadi Nov 21 '16 at 09:15
  • @MiladYarmohammadi no, this question is about VR _controls_ – Nick Nov 21 '16 at 09:47
  • @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 does – Nick Nov 21 '16 at 09:55

2 Answers2

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.).

Nick
  • 311
  • 1
  • 10
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.

user1419851
  • 131
  • 1
  • 1
  • 6