- From: Johanna <notifications@github.com>
- Date: Tue, 15 Jan 2019 13:46:35 -0800
- To: w3c/screen-orientation <screen-orientation@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Tuesday, 15 January 2019 21:46:57 UTC
Johanna-hub commented on this pull request. > </p> <pre class='example html'> <script> - var show = function() { - console.log("Orientation type is " + screen.orientation.type); - console.log("Orientation angle is " + screen.orientation.angle); - } +async function lockLandscape(){ + await document.documentElement.requestFullscreen() + await screen.orientation.lock('landscape'); +} + +async function unlock() { + await screen.orientation.unlock(); +} + +async function portrait(){ + await screen.orientation.lock('portrait'); I have added these in, just wanted to explain the reason I didn't put it in. On my phone once you have locked to landscape you can only stay in full screen. If you try to exit full screen it just takes you back to portrait. So, for this specific example, where we are locking to landscape and then unlocking, we don't need the check. Other phones might be different of course, so probably better to put it in! 😊 -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/screen-orientation/pull/133#discussion_r248075303
Received on Tuesday, 15 January 2019 21:46:57 UTC