Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
api.on('fullscreen', () => {
if (Modernizr.lockorientation) {
try {
Modernizr.prefixed('lockOrientation', screen)('landscape');
} catch (e) {
console.warn('lockOrientation is not supported on this browser.');
// the device does not support rotation
}
} else if (Modernizr.orientationlock) {
screen.orientation.lock('landscape').catch(() => {
console.warn('orientation.lock is not supported on this chrome.');
});
}
this.applyRatio();
});
api.on('fullscreen-exit', () => {
api.on('fullscreen', () => {
if (Modernizr.lockorientation) {
try {
Modernizr.prefixed('lockOrientation', screen)('landscape');
} catch (e) {
console.warn('lockOrientation is not supported on this browser.');
// the device does not support rotation
}
} else if (Modernizr.orientationlock) {
screen.orientation.lock('landscape').catch(() => {
console.warn('orientation.lock is not supported on this chrome.');
});
}
this.applyRatio();
});
api.on('fullscreen-exit', () => {
api.on('fullscreen-exit', () => {
if (Modernizr.lockorientation) {
Modernizr.prefixed('unlockOrientation', screen)('landscape');
} else if (Modernizr.orientationlock) {
screen.orientation.unlock();
}
this.applyRatio();
});
});
api.on('fullscreen-exit', () => {
if (Modernizr.lockorientation) {
Modernizr.prefixed('unlockOrientation', screen)('landscape');
} else if (Modernizr.orientationlock) {
screen.orientation.unlock();
}
this.applyRatio();
});
});
function prefixedClass(prop, obj) {
return obj[Modernizr.prefixed(prop, obj, false)];
}