I am making a VR video player using google VR SDK for android. I want to have gaze control in my VR player to add media pause and play controls in the player. I know we can achieve this using unity but I need to do this using android or java code. Is there any way to implement it in native android code without using unity.
Open the YouTube app on Android. Search for a VR video or go to the YouTube Virtual Reality house channel by searching for "Virtual Reality." Look for this icon to find the right channel . Select a VR video. To start playback, tap the play button.
Yes, you can, but you will need to calculate if the user is gazing at the buttons yourself. Google has provided an example Android VR project that does this here. Take a look at the isLookingAtObject()
method at the very bottom of the linked file. You can apply this to buttons whose position you have in world space, instead of a cube target like in the demo.
However since you are just making a video player where neither the camera nor the buttons move, you could just hard-code the angles at which you are looking at certain buttons, and if the camera rotation is within a threshold of a given button's viewing angle then you know you are gazing at the button.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With