I downloaded the video you linked to and was able to get it to play properly using the VrVideoView
in both regular and goggle modes. The video you linked to is not a stereoscopic video, but is a monoscopic video.
For the clarity of this answer, I'll briefly explain the two types of VR videos supported by Google's VR SDK: Monoscopic and Stereoscopic videos. With monoscopic, the video was shot with only one camera and when viewed in a regular player, it looks like the top image in your question, with all the distortions. With stereoscopic, the video was shot using two cameras and depending on the stereoscopic format (there's top/bottom and left/right), it will look like the bottom image in your question when viewed with a regular player and will also look distorted. Google's VR player only supports the top/bottom version of the stereoscopic format.
If the video you are attempting to play is a monoscopic 360 video (as is the case with the linked video), then you can play it using the VR SDK as follows:
VrVideoView vrVideoView;
// initialize the view here
Options options = new Options();
// This tells the player that the video is a monoscopic 360 video
options.inputType = Options.TYPE_MONO;
// This tells the player that it should play using HLS or progressive video play
// If you are linking to a single video file, use default.
options.inputFormat = Options.FORMAT_DEFAULT;
// Assuming you've downloaded the video...
vrVideoView.loadVideoFromAssets("my-video.mp4", options);
vrVideoView.playVideo();
Now if you are playing a stereoscopic top/bottom format 360 video, then you can similarly play it by just altering the input type of the video:
VrVideoView vrVideoView;
// initialize the view here
Options options = new Options();
// This tells the player that the video is a stereoscopic top/bottom 360 video
options.inputType = Options.TYPE_STEREO_OVER_UNDER;
// This tells the player that it should play using HLS or progressive video play
// If you are linking to a single video file, use default.
options.inputFormat = Options.FORMAT_DEFAULT;
// Assuming you've downloaded the video...
vrVideoView.loadVideoFromAssets("my-video.mp4", options);
vrVideoView.playVideo();
Now, you probably want to play this video using goggles. In this case, you can simply set the display mode of the VR player. The embedded mode is the regular small player that fits into your UI and acts as a small one-eyed viewport into the 360 video, with distortions corrected. The fullscreen monoscopic mode is similar to embedded in that is is the same one-eyed perspective, but instead the device's entire screen is used as the viewport. The fullscreen stereo option will split the video into two images, one for each eye, and will be viewable with the VR goggles. See below for the code to do this (note: this code can be called anytime after the VrVideoView
is constructed and it will adjust accordingly):
// This displays the video as inside the normal bounds for viewing without the VR goggles.
vrVideoView.setDisplayMode(DisplayMode.EMBEDDED);
// If you want to go full-screen without goggles...
vrVideoView.setDisplayMode(DisplayMode.FULLSCREEN_MONO);
// If you want to go full-screen and use goggles...
vrVideoView.setDisplayMode(DisplayMode.FULLSCREEN_STEREO);
There might be some confusion surrounding the naming of the Options
and the DisplayMode
. The Options
are simply used by the player to determine whether the source video has one perspective or two. The DisplayMode
is used by the player to determine how to display that video. You can have a monoscopically shot video that is displayed stereoscopically, it will just have each eye seeing the same perspective. Likewise, you can have a stereoscopically shot video displayed monoscopically, it's just that the viewport will only be displaying one eye's perspective and the other perspective will be ignored.
I hope that clears things up. Let me know if you have still have trouble playing the video.