The Cordova plugin for GVR. See GVR for more information.
$ cordova plugin add https://github.com/almas/cordova-plugin-vrviewer.git
call the vrViewer function directly
vrViewer.playVideo(pathOrUrl [, options]);
- url: The equirectangular VR video url, it also can be the fullpath of local video.
- options: Object with following attributes.
TYPE_MONO: Each video frame is a monocular equirectangular panorama. (default)
TYPE_STEREO_OVER_UNDER: Each video frame contains two vertically-stacked equirectangular panoramas.
FORMAT_DEFAULT: Indicates that the video is in a standalone, non-streaming format using container formats such as mp4, webm, ogg, aac. (default)
FORMAT_DASH: Indicates that the video uses the MPEG-DASH format.
FORMAT_HLS: Indicates that the video uses the HTTP Live Streaming (HLS) format.
If video is from assets then it should be true. Android only. Default is false.
var options = {
inputType: 'TYPE_STEREO_OVER_UNDER',
inputFormat: 'FORMAT_DEFAULT',
fromAsset: false
};
vrViewer.playVideo(url, options);
vrViewer.stopVideo()
vrViewer.startPanorama(pathOrUrl[, options]);
- url: The equirectangular panorama image url, it also can be the fullpath of local image.
- options: Object with following attribute.
TYPE_MONO: Image contains a single equirectangular panorama. (default)
TYPE_STEREO_OVER_UNDER: Image contains a pair of equally-sized equirectangular vertically-stacked panoramas.
var options = {
inputType: 'TYPE_STEREO_OVER_UNDER'
};
vrViewer.startPanorama(imagePath, options);