aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library_html5.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/library_html5.js b/src/library_html5.js
index 703f9a74..f9b8a8c7 100644
--- a/src/library_html5.js
+++ b/src/library_html5.js
@@ -980,18 +980,23 @@ var LibraryJSEvents = {
if (allowedOrientations & 2) orientations.push("portrait-secondary");
if (allowedOrientations & 4) orientations.push("landscape-primary");
if (allowedOrientations & 8) orientations.push("landscape-secondary");
+ var succeeded;
if (window.screen.lockOrientation) {
- window.screen.lockOrientation(orientations);
+ succeeded = window.screen.lockOrientation(orientations);
} else if (window.screen.mozLockOrientation) {
- window.screen.mozLockOrientation(orientations);
+ succeeded = window.screen.mozLockOrientation(orientations);
} else if (window.screen.webkitLockOrientation) {
- window.screen.webkitLockOrientation(orientations);
+ succeeded = window.screen.webkitLockOrientation(orientations);
} else if (window.screen.msLockOrientation) {
- window.screen.msLockOrientation(orientations);
+ succeeded = window.screen.msLockOrientation(orientations);
} else {
return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
}
- return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ if (succeeded) {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ } else {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_FAILED') }}};
+ }
},
emscripten_unlock_orientation: function() {