w3c / screen-orientation

The screen orientation lock specification
https://w3c.github.io/screen-orientation/
Other
27 stars 29 forks source link

Rotate progress event #186

Closed DongHyunSong closed 5 years ago

DongHyunSong commented 5 years ago

I'm just an observer of your project. :) Be supposed that there is a device, which rotates its screen relatively slow like as TV (Samsung TV Sero) I think that rotate progress events is very helpful for the web application. Like as screen.addEventListener("rotate-progress", function(degree) {});

marcoscaceres commented 5 years ago

Could you help us understand what you would like to do with the events?

DongHyunSong commented 5 years ago

If the application can know its window starts/end to rotate, it can prepare new contents (like portrait fitted video) in advance. Of course, this is useful that in case screen rotating happens slowly with large display.

marcoscaceres commented 5 years ago

generally, that would be dealt with by a combination of CSS (e.g., orientation: "portrait") and onorientationchange, but interpolation of orientation is left to the OS. I don't think it's possible to report the actual angle as the orientation is changing.

DongHyunSong commented 5 years ago

TV side is finding the useful usage of handling rotating progress. I believe it maybe good factor for fine polishing of web contents in TV side :)

marcoscaceres commented 5 years ago

TV side is finding the useful usage of handling rotating progress.

Sure, but the problem is that we can't implement the across all platforms (i.e., I don't think there is a way of doing this in Android or iOS). The OS doesn't tell you this information, it only tells you that the orientation has changed - also, note that orientation changes are not a thing... the screen is just changing width and height, and the angle represents the angle relative to the natural orientation of the device, not how it's being rotated.

Again, it doesn't make sense to be computing things while in between the from when the screen is changing angle.

I'm closing this request, as I don't think there is a compelling use case.