Need a way to disable screen rotation with apps when in tablet mode
Reported by
raniel...@gmail.com,
Jun 21 2016
|
||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.41 Safari/537.36 Steps to reproduce the problem: Steps to reproduce the problem: 1. On a convertible Chromebooks such as a ASUS flip either launch a app when in table mode, or start in laptop mode and switch to table mode. 2. Rotate tablet, and screen will rotate What is the expected behavior? What went wrong? Screen rotated. Need a way to disable rotation. This is possible with Windows, Android and iOS. WebStore page: Did this work before? N/A Chrome version: 50.0.2661.94 Channel: stable OS Version: 7978.69.0 Flash Version: Shockwave Flash 22.0 r0
,
Aug 8 2016
No we need ones that disable rotation, basically like Android has.
,
Sep 20 2016
This works with Android on CrOS as expected, but not with chrome apps on CrOS.
,
Jan 5 2017
CrOS supports the html Screen Orientation API. When a tab is fullscreened rotation locks can be applied: https://www.w3.org/TR/screen-orientation/#dfn-lock-the-orientation
,
Apr 7 2017
https://www.w3.org/TR/screen-orientation/#dfn-lock-the-orientation only works when you are in tablet mode already so it doesn't meet our needs. We don't have a way to tell that. Can't we just have a way to lock the screen orientation like you have on Android on CrOS?
,
Apr 7 2017
The requests sent to that API should be saved, then applied once the tablet mode has been entered by a user. Is that not being seen? This was done for the api, as we didn't see a use case for locking the screen to portrait while in laptop form. Could you provide some background on your use case? Android on CrOS is actually using the same internal api that the html one is. The main difference being that each Android app is its own window, whereas for the web tabs need to be fullscreen before a lock is applied. There are also currently some bugs with the Android api, which can erase locks set by users/tabs. So if you are testing a mix of Android and your website, that may be impacting you.
,
Apr 7 2017
Requests to that API do not succeed when the device is in laptop mode (not tablet mode). This is the error in the console "Uncaught (in promise) DOMException: screen.orientation.lock() is not available on this device." You can try this on the demo I created here: output.jsbin.com/sozolekevu If you press the button while in laptop mode you will see the error and the orientation will not lock when switching to tablet mode. The same will work when pressing the button while in tablet mode. This is what my call looks like to lock the orientation: screen.orientation.lock('landscape');
,
Apr 7 2017
Thanks for the sample. Yeah this feels wrong, especially with it divergent from the Android support. I also see why it's occurring. girard@ ScreenOrientationProvider::LockOrientation right now exits early if screen orientation locking is not supported. However this is currently tied to touch view being active. So it doesn't go an register the request amongst the set of requests in ScreenOrientationController. It should instead always pass along the request, and only apply while in touch view.
,
May 23 2017
Any updates on this issue?
,
Jul 5 2017
Thanks jonross@, I agree and think this is something we should fix given the increasing # of convertibles in the field. girard@, are you the right owner for this?
,
Jul 25 2017
Latest CrOS (59) should have the rotation lock equivalent to Android. Please reopen if you still have an issue with this implementation.
,
Jul 26 2017
I just tried on CrOS 61 and I got the following error:
"screen.orientation.lock() is not available on this device"
The command I used was "screen.orientation.lock('landscape')'. Is there some other syntax that will work on CrOS?
,
Sep 27
I tried screen.orientation.lock('landscape') on Lenovo N20P chromebook on chrome os 68 but I get the error this api is not supported on the device.
I tried the app in kiosk mode , on non kiosk mode and also on the Chromium browser both in fullscreen and non fullscreen mode and I get the same error i.e this api is not supported on the device..
So is the lock orientation javascript api supported by chromeos, if yes then which devices and os version is it supported
,
Oct 3
The api is supported on Chrome OS, but only while the device is in a tablet state.
The following should allow the tab to assume fullscreen, and for the orientation to be locked:
document.documentElement.webkitRequestFullscreen();
screen.orientation.lock('landscape');
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by maxkirsch@chromium.org
, Jul 27 2016