Can't lock screen orientation

Hey, i’m trying to lock orientation to portrait on only one page, and i lose a whole day and my progress is 0.
i install ngCordova and install the plugin cordova-plugin-screen-orientation. I try until now this codes and none of this works.

this was the closest:
window.screen.orientation.lock(“portrait”);
Error = DOMException: screen.orientation.lock() is not available on this device.
Then i try this:
if (document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen) {
setTimeout(function(){
window.screen.orientation.lock(“landscape”);
} , 200);
}
no errors, but nothing happened.

screen.LockOrientation(“portrait”);
Error = is not a function;

$cordovaDeviceOrientation.lockOrientation();
Error : is not function

Can anybody help me, i am desperate?!?! :confused:

2 Likes