本文へスキップ

onVideoSizeChange()

onVideoSizeChange: ({ GLctx, computeCtx, videoWidth, videoHeight, canvasWidth, canvasHeight, orientation })

説明

onVideoSizeChange()は、キャンバスのサイズが変更されたときに呼び出されます。 ビデオとキャンバスの寸法、およびデバイスの向きで呼び出されます。

パラメータ

パラメータ説明
GLctx描画キャンバスの WebGLRenderingContext または WebGL2RenderingContext.
computeCtxコンピュートキャンバスの WebGLRenderingContext または WebGL2RenderingContext.
videoWidthカメラフィードの幅(ピクセル単位)。
videoHeightカメラフィードの高さ(ピクセル単位)。
canvasWidthGLctx キャンバスの幅をピクセル単位で指定する。
canvasHeightGLctx キャンバスの高さをピクセル単位で指定する。
orientationポートレートからのUIの回転を度単位で指定する(-90, 0, 90, 180)。

XR8.addCameraPipelineModule({
name: 'mycamerapipelinemodule',
onVideoSizeChange: ({ GLctx, videoWidth, videoHeight, canvasWidth, canvasHeight }) => {
myHandleResize({ GLctx, videoWidth, videoHeight, canvasWidth, canvasHeight })
},
})