screenlock
0.0.1 • Public • Published screenlock
const screenlock = module.exports = (o => {
let orientation = typeof screen === 'object'
&& (screen.orientation ||
screen.mozOrientation ||
screen.msOrientation);
return {
lock : (type='landscape-primary') => {
if (orientation && orientation.lock) {
try {
orientation.lock(type);
} catch (e) {}
}
},
unlock : () => {
if (orientation && orientation.unlock) {
try {
orientation.unlock();
} catch (e) {}
}
}
};
})({});
Package Sidebar
Install
Weekly Downloads