Read / Write Screen Rotation for Users Locked in Portrait Mode |
|||||
Issue descriptionSteps to reproduce the problem: 1. On Android, lock the screen orientation to portrait. 2. Visit https://webrtc.github.io/samples/src/content/getusermedia/record/ 3. Rotate the device to landscape 4. Record a video. 5. Play back the video. 6. Observe that the video is sideways. What is the expected behavior? WebRTC should have some mechanism to correct for locked orientations and rotate the video stream. What went wrong? Without any means of correcting the locked screen orientation, the video captured sideways in portrait orientation, rather than correctly in landscape orientation. Did this work before? No Does this work in other browsers? No Chrome version: 69.0.3497.92 Channel: stable OS Version: Flash Version: I believe the page doesn't receive orientation change events when the screen orientation is locked. Our use case involves WebRTC, but this problem extends beyond WebRTC. As an example, YouTube mobile web cannot detect when the screen orientation changes while locked and can't full screen / landscape the video. However, YouTube's Android app can (and does) do this. Being able to detect orientation change events even when the device orientation is locked would be very helpful for web developers to provide these native-like experiences to their users.
,
Sep 16
YouTube Android (at least, on my Pixel device running Android P) does not auto-rotate when I have portrait lock. Nor doens YouTube mWeb. However, both do if I disable portrait lock.
I'm not fully certain how the rotation of the device affects the orientation of the video but I wonder if this could be solved by calling the orientation lock all the time when recording. Basically, at step 4, you could call screen.orientation.lock('portrait') if believe the orientation should be portrait. Another solution would simply be to lock to 'any' which would override the system lock and allow all orientations.
Is the application running fullscreen? This would be needed in order to request orientation lock. Or be installed as a PWA.
,
Sep 16
,
Sep 17
,
Sep 19
As per comment#2 adding Needs=Feedback label @douglasparker: Could you please respond to comment#2. Thanks!
,
Sep 19
Sorry for the delay, was a little held up the last couple days. I played around with the screen.orientation.lock() API and it does seem that setting it with 'any' after fullscreening an element overrides the device setting. The page will re-orient itself and capture video in the correct orientation. This requires that the app is full screened, which is a little annoying but doable for our use case. That seems to be simplest solution to this particular problem, thanks for the pointers here!
,
Sep 19
Issue 803144 has been merged into this issue. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by gov...@chromium.org
, Sep 12