Detect device rotation in Web
In mobile there is the device.orientation-changed event, but I can't find a similar event in Web. Am I overlooking something?
I know I can use viewer.get-capabilities in a workflow to get the device's orientation, but I'd like to respond to such an event automatically.
-
Hi Berend Veldkamp thanks for bringing this up. I looked into this briefly, you're not overlooking anything that we provide. The viewer.get-capabilities operation is the current best method of getting device orientation. VSW, as of 5.27, doesn't publish an event for orientation changes.
If this is a strict requirement for your project you could implement this yourself. It is technically feasible to detect device orientation in JavaScript, via CSS, or as a React hook such as useOrientation. Using one of these approaches, you could then create your own custom event and subscribe to it.0
Please sign in to leave a comment.
Comments
1 comment