It is a Titanium module for realizing of a VRPanoramaView and VRVideoView. Currently only the android version auf PanoramaView and VideoView are realized.
OpenGL has strict texture size requirements acceptable image sizes:
4096 × 2048
2048 × 1024
1024 × 512
512 × 256
256 × 128
… (any smaller power of 2)
var image = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, "pano.jpg");
image.write(Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, "pano.jpg").read());
var VR = require("ti.vrview");
var win = Ti.UI.createWindow({
});
var panoView = VR.createPanoramaView({
type : VR.TYPE_MONO,
image : Ti.Filessystem.getFile(Ti.Filesystem.applicationDataDirectory, "pano.jpg").nativePath,
onload : function() {},
onchanged : function(e) {
console.log(e.yaw);
console.log(e.pitch);
},
fullscreenButtonEnabled : false,
infoButtonEnabled : false,
stereoModeButtonEnabled : false,
touchTrackingEnabled : true,
transitionViewEnabled : false,
sensorDelay : VR.SENSOR_DELAY_NORMAL
});
var videoView = VR.createVideoView({
onchanged : function(e) {
console.log(e.yaw);
console.log(e.pitch);
}
onload : function() {},
type : VR.TYPE_STEREO_OVER_UNDER,
format : VR.FORMAT_DEFAULT,
image : Ti.Filessystem.getFile(Ti.Filesystem.applicationDataDirectory, "pano.mp4")).nativePath,
fullscreenButtonEnabled : false,
infoButtonEnabled : false,
stereoModeButtonEnabled : false,
touchTrackingEnabled : true,
transitionViewEnabled : false
});
win.add(panoView);
-
FORMAT_DEFAULT Indicates that the video is in a standard video container format such as mp4, webm, ogg, aac.
-
FORMAT_HLS Indicates that the video uses the HTTP Live Streaming (HLS) format.
-
TYPE_MONO Each video frame is a monocular equirectangular panorama.
-
TYPE_STEREO_OVER_UNDER Each video frame contains two vertically-stacked equirectangular panoramas.
- SENSOR_DELAY_NORMAL (2 sec.)
- SENSOR_DELAY_FASTEST (0)
- SENSOR_DELAY_GAME (20 ms)
- SENSOR_DELAY_UI (60 ms)
-
createPanoramaView()
-
createVideoView()
This is Hyperloop-Version Thanks to miga.