webvr-polyfill
Advanced tools
Comparing version 0.9.6 to 0.9.7
{ | ||
"name": "webvr-polyfill", | ||
"version": "0.9.6", | ||
"version": "0.9.7", | ||
"homepage": "https://github.com/borismus/webvr-polyfill", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -54,2 +54,4 @@ /* | ||
this.wakelock_ = new WakeLock(); | ||
this.presentModeClassName = 'WEBVR_POLYFILL_PRESENT'; | ||
} | ||
@@ -100,4 +102,5 @@ | ||
VRDisplay.prototype.removeFullscreenWrapper = function() { | ||
if (!this.fullscreenElement_) | ||
if (!this.fullscreenElement_) { | ||
return; | ||
} | ||
@@ -153,2 +156,3 @@ var element = this.fullscreenElement_; | ||
self.beginPresent_(); | ||
self.setForceCanvasFullscreen_(true); | ||
resolve(); | ||
@@ -159,2 +163,3 @@ } else { | ||
} | ||
self.setForceCanvasFullscreen_(false); | ||
self.removeFullscreenWrapper(); | ||
@@ -219,4 +224,2 @@ self.wakelock_.release(); | ||
self.removeFullscreenWrapper(); | ||
resolve(); | ||
@@ -303,6 +306,14 @@ } else { | ||
VRDisplay.prototype.getEyeParameters = function(whichEye) { | ||
// Override to return accurate eye parameters is canPresent is true. | ||
// Override to return accurate eye parameters if canPresent is true. | ||
return null; | ||
}; | ||
VRDisplay.prototype.setForceCanvasFullscreen_ = function(isFullscreen) { | ||
if (isFullscreen) { | ||
this.fullscreenElement_.classList.add(this.presentModeClassName); | ||
} else { | ||
this.fullscreenElement_.classList.remove(this.presentModeClassName); | ||
} | ||
}; | ||
/* | ||
@@ -309,0 +320,0 @@ * Deprecated classes |
@@ -56,2 +56,4 @@ /* | ||
this.rotateInstructions_ = new RotateInstructions(); | ||
this.injectPresentModeCssClass_(); | ||
} | ||
@@ -212,2 +214,18 @@ CardboardVRDisplay.prototype = new VRDisplay(); | ||
CardboardVRDisplay.prototype.injectPresentModeCssClass_ = function() { | ||
var cssProperties = [ | ||
'width: 100% !important', | ||
'height: 100% !important', | ||
'top: 0 !important', | ||
'left: 0 !important', | ||
'right: 0 !important', | ||
'bottom: 0 !important', | ||
'z-index: 999999 !important' | ||
]; | ||
var style = document.createElement('style'); | ||
style.type = 'text/css'; | ||
style.innerHTML = '.' + this.presentModeClassName + '{' + cssProperties.join(';') + '}'; | ||
document.getElementsByTagName('head')[0].appendChild(style); | ||
}; | ||
module.exports = CardboardVRDisplay; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
800671
13364