Skip to main content

onDeviceOrientationChange()

onDeviceOrientationChange: ({ GLctx, computeCtx, videoWidth, videoHeight, orientation })

Description

onDeviceOrientationChange() is called when the device changes landscape/portrait orientation.

Parameters

ParameterDescription
GLctxThe drawing canvas's WebGLRenderingContext or WebGL2RenderingContext.
computeCtxThe compute canvas's WebGLRenderingContext or WebGL2RenderingContext.
videoWidthThe width of the camera feed, in pixels.
videoHeightThe height of the camera feed, in pixels.
orientationThe rotation of the UI from portrait, in degrees (-90, 0, 90, 180).

Example

XR8.addCameraPipelineModule({
name: 'mycamerapipelinemodule',
onDeviceOrientationChange: ({ GLctx, videoWidth, videoHeight, orientation }) => {
// handleResize({ GLctx, videoWidth, videoHeight, orientation })
},
})