BlueBomberman opened a new issue #81: URL: https://github.com/apache/cordova-plugin-screen-orientation/issues/81
# Bug Report Hi everyone this is the first issue that i write on github, so correct me if something is not right. ## Problem I'm trying to open a videoplayer on fullscreen when rotating the device, and as I read on [MDN ](https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen) this shoud be possible, because the rotation is considered a user gesture. ### What is expected to happen? The Video player goes fullscreen when rotating the device. ### What does actually happen? I get an error saying > Msg: Failed to execute 'requestFullscreen' on 'Element': API can only be initiated by a user gesture. ## Information I have tried with both window.addEventListener("orientationchange",..), and screen.orientation.addEventListener('change',..) but it doesn't seem to change. ### Command or Code `window.screen.orientation.addEventListener("change", function () { if (window.screen.orientation.type.startsWith("landscape") && !document.fullscreenElement) { try { container.requestFullscreen(); } catch (err) {...); } } else if ( window.screen.orientation.type.startsWith("portrait") && document.fullscreenElement ) { try { document.exitFullscreen(); } catch (err) { ... } } }); });` ### Version information Plugin version: 3.0.2. The project is a ionic 5.6.3 application, with capacitor 2.4.7, I have only tested android for now. ## Checklist - [x] I searched for existing GitHub issues - [x] I updated all Cordova tooling to most recent version - [] I included all the necessary information above -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
