Re: [w3c/screen-orientation] Editorial: Example 1 (#133)

Johanna-hub commented on this pull request.



>        </p>
       <pre class='example html'>
 &lt;script&gt;
-  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