device orientation and screen orientation don't work when a element is fullscreen |
|||
Issue description
Chromium Version : 57.0.2979.0
Events triggered by device orientation Web API and Screen Orientation Web API are not triggered when an element is fullscreen when experimental flag chrome://flags/#video-fullscreen-orientation-lock is enabled.
Here's a code I used for info:
screen.orientation.addEventListener('change', e => {
console.log('screen.orientation', e);
});
window.addEventListener("orientationchange", e => {
console.log('orientationchange', screen.orientation);
});
,
Jan 11 2017
I expect Javascript code above to write something in my console when I change my device orientation. This is not happening sadly when element is in fullscreen. This works without flag by the way.
,
Jan 12 2017
Can you give explicit STR? :) My understanding is that you do this: 1. go to page such as youtube.com 2. press fullscreen button 3. video is now locked in landscape 4. you turn your phone in portrait orientation If that's correct, what you are seeing is the expected result: the screen orientation gives the orientation of the scree, not the device so the screen orientation will not be updated and should stay as 'landscape'. What you call device orientation is also a screen orientation of some sort (only reports angle). If you want device orientation events, the event name is called "deviceorientation", see https://w3c.github.io/deviceorientation/spec-source-orientation.html
,
Jan 12 2017
My bad, I should have used Device Orientation API. |
|||
►
Sign in to add a comment |
|||
Comment 1 by mlamouri@chromium.org
, Jan 11 2017