Stay organized with collections Save and categorize content based on your preferences.
Warning: These components were removed in v1.190 of the GVR SDK for Android. The Video360 sample should be used as a basis for creating 360 photo and video viewers. If you still want to use these widgets, you will need to use SDK v1.180 or earlier.This page is a walkthrough of the VR View samples, which can be found in the /samples
directory when you download the Google VR SDK for Android.
There are two sample apps in the SDK that demonstrate how to embed 360° media. Both of samples are single activity applications that display an embedded panoramic image or video:
VrPanoramaView
VrVideoView
The VrPanoramaView and VrVideoView samples with their VR Views in embed mode.
They allow the user to view different parts of the panorama by rotating their phone. The VrVideoView sample also allows the user to pause and play their video by tapping on the VR View, and seek through the video using the slider. The samples expose the fullscreen mode and Cardboard mode buttons in the VR View which allow the user to change modes.
The fullscreen mode is similar to the embed mode but is immersive.
The Cardboard mode allows the user to view the panorama in a Cardboard device like any other Cardboard app.
These two apps also have an additional feature of opening arbitrary panoramas using custom Intents via adb. The syntax for the Intents is documented in the samples' respective Activities, and these Intents can be used to quickly test various media formats.
Overview of the codeA VR View can be included in a layout like any other Android View. This is the important section of the VrPanoramaView's res/layout/main_layout.xml
:
<com.google.vr.sdk.widgets.pano.VrPanoramaView android:id="@+id/pano_view" android:layout_margin="5dip" android:layout_width="match_parent" android:scrollbars="@null" android:layout_height="250dip" />
Inside the Activity, the primary method is VrPanoramaView.loadImageFromBitmap()
. Call it with a standard Android Bitmap
object and an optional VrPanoramaView.Options
object. The latter is used to configure the format of the image. The Activity also implements a VrPanoramaEventListener
which receives events when the load operation succeeds or fails.
The VrVideoView sample uses a very similar flow to VrPanoramaView. The primary difference is that VrVideoView uses either loadVideoFromAsset
or loadVideo
.
While VrPanoramaView
requires the caller to load the image and pass in configuration information, VrVideoView
accepts a file and reads in the configuration from the file's spatial-media metadata.
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-09 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["**VrPanoramaView** and **VrVideoView** are sample apps in the Google VR SDK for Android that let users view 360° photos and videos."],["These components were removed in v1.190 of the GVR SDK for Android, and the Video360 sample should be used instead."],["Users can interact with the panoramas and videos using their phone's sensors and touch controls to explore the content and adjust playback."],["To continue using VrPanoramaView and VrVideoView, developers must use SDK v1.180 or earlier."]]],["The VR SDK for Android includes two sample apps, VrPanoramaView and VrVideoView, demonstrating embedded 360° media. Users can navigate panoramas by moving their phone; VrVideoView also allows pausing, playing, and seeking. Both samples support fullscreen and Cardboard modes. VrPanoramaView uses `VrPanoramaView.loadImageFromBitmap()` to display images, while VrVideoView uses `loadVideoFromAsset` or `loadVideo` to play videos, handling spatial metadata. These allow the user to test media formats via custom Intents.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4