Tencent Real-Time Communication (TRTC)は、ローカル画面とリモート画面の回転方向と塗りつぶしモードのカスタム制御をサポートします。
setLocalRenderParamsを呼び出すことにより、ローカルレンダリングパラメータを設定できます。
import TRTCCloud, {
TRTCRenderParams, TRTCVideoRotation, TRTCVideoFillMode,
TRTCVideoMirrorType
} from 'trtc-electron-sdk';
const trtcCloud = new TRTCCloud();
const param = new TRTCRenderParams(
TRTCVideoRotation.TRTCVideoRotation90,
TRTCVideoFillMode.TRTCVideoFillMode_Fill,
TRTCVideoMirrorType.TRTCVideoMirrorType_Enable
);
trtcCloud.setLocalRenderParams(param);
const localUserDom = document.querySelector('local-user');
trtcCloud.startLocalPreview(localUserDom);
setRemoteRenderParamsを呼び出すことにより、リモートレンダリングパラメータを設定できます。
import TRTCCloud, {
TRTCRenderParams, TRTCVideoRotation, TRTCVideoFillMode,
TRTCVideoMirrorType, TRTCVideoStreamType
} from 'trtc-electron-sdk';
const trtcCloud = new TRTCCloud();
const param = new TRTCRenderParams(
TRTCVideoRotation.TRTCVideoRotation180,
TRTCVideoFillMode.TRTCVideoFillMode_Fill,
TRTCVideoMirrorType.TRTCVideoMirrorType_Disable
);
const remoteUserId = 'remoteUser';
trtcCloud.setRemoteRenderParams(remoteUserId, TRTCVideoStreamType.TRTCVideoStreamTypeBig, param);
const remoteUserDom = document.querySelector('remote-user');
trtcCloud.startRemoteView(remoteUserId, remoteUserDom, TRTCVideoStreamType.TRTCVideoStreamTypeBig);
この記事はお役に立ちましたか?