Utkarsh Srivastav
Utkarsh Srivastav

Reputation: 3227

Split normal android screen to Google cardboard view

I have created a video player using OpenGl in android and it works fine. I used the following tutorial (https://www.virag.si/2014/03/rendering-video-with-opengl-on-android/).

Now I want to create same app for Google Cardboard. I searched it on internet and found out following queries and a Rajawali Renderer. (How to make a simple VR video player by Google CardBoard Android SDK)

Now first of all Rajawali latest code is not working. So, if anyone has a working code please suggest.

Second thing is that Rajawali requires 360 degree input. But I want to view my normal videos using Google cardboard. So, I want to learn how to split my screen of Video player, so that I can see the output in Google cardboard.

Also, how to split any normal android screen so that we can see the output in Google cardboard?

Upvotes: 1

Views: 2365

Answers (1)

Erik Minarini
Erik Minarini

Reputation: 4845

You can download cardboard SDK from here: https://developers.google.com/vr/android/download

On git, there are some samples,

https://github.com/googlevr/gvr-android-sdk/blob/master/samples/sdk-simplevideowidget/src/main/java/com/google/vr/sdk/samples/simplevideowidget/SimpleVrVideoActivity.java

this is for using a video in "simplepanoview" that is a custom VR view as you can see here: https://developers.google.com/vr/android/samples/vrview#vr_view_sample_apps

In the sample is used loadVideoFromAsset("video.mp4") this method is called in AsyncTask. When the video is loaded (or if it fails) starts onLoadSuccess (or onLoadError).

You can find very good documentation here: https://developers.google.com/vr/android/reference/com/google/vr/sdk/widgets/video/VrVideoView

Hope this helps you, let me know, good luck!

Upvotes: 1

Related Questions