


npm install @tencentcloud/roomkit-web-vue3@5 tuikit-atomicx-vue3 @tencentcloud/uikit-base-component-vue3 @tencentcloud/universal-api
pnpm install @tencentcloud/roomkit-web-vue3@5 tuikit-atomicx-vue3 @tencentcloud/uikit-base-component-vue3 @tencentcloud/universal-api
yarn add @tencentcloud/roomkit-web-vue3@5 tuikit-atomicx-vue3 @tencentcloud/uikit-base-component-vue3 @tencentcloud/universal-api
<template><UIKitProvider theme="light" language="zh-CN"><ConferenceMainView></ConferenceMainView></UIKitProvider></template><script setup lang="ts">import { UIKitProvider } from '@tencentcloud/uikit-base-component-vue3';import { ConferenceMainView } from '@tencentcloud/roomkit-web-vue3';</script>
conference.login method immediately after your business system completes authentication (when the user logs into your web page). After authentication, call conference.setSelfInfo to set the user's display name and avatar, which appear in the participant video area and member list.import { onMounted } from 'vue';import { conference } from '@tencentcloud/roomkit-web-vue3';// Replace these values with your actual business data and SDKAppID from the consoleconst SDKAppID = 0;const userId = 'your_user_id';const userSig = 'your_dynamic_user_sig';const userName = 'Display Name';onMounted(async () => {try {// 1. Log in to the SDKawait conference.login({sdkAppId: SDKAppID,userId,userSig,});// 2. (Optional) Set user profile informationawait conference.setSelfInfo({userName,avatarUrl: 'https://your-avatar-url.com/image.png',});} catch (error) {console.error('TUIRoomKit login failed:', error);}});
conference.login logic may not have executed when the room entry page loads. Use watch to observe loginUserInfo.value?.userId; when this field is populated, TUIRoomKit login is successful.import { watch } from 'vue';import { useLoginState } from 'tuikit-atomicx-vue3/room';import { conference, RoomType } from '@tencentcloud/roomkit-web-vue3';const { loginUserInfo } = useLoginState();watch(() => loginUserInfo.value?.userId, async (userId) => {if (userId) {await conference.joinRoom({ roomId: 'webinar_123456', roomType: RoomType.Webinar });}}, { immediate: true });
conference.createAndJoinRoom to create and enter the webinar. Other participants should follow Step 5 and call conference.joinRoom to join.import { conference, RoomType } from '@tencentcloud/roomkit-web-vue3';const startWebinar = async () => {await conference.createAndJoinRoom({roomId: 'webinar_123456', // Replace with your actual roomId. Prefix webinar roomIds with 'webinar_' for clarity.roomType: RoomType.Webinar,options: {roomName: 'My Webinar',},});};
RoomType to "Live" and specify the guest seat template in SeatTemplate.POST /v4/live_engine_http_srv/create_room{"RoomInfo": {"RoomId": "webinar_123456","RoomType": "Live","RoomName": "My Webinar","Owner_Account": "host-user-id","SeatTemplate": "VideoLandscapeAudioMix10Seats","IsPublicVisible": false}}
Template Value | Platform | Description |
VideoLandscapeAudioMix10Seats | Web Desktop | Landscape video layout, up to 10 guest seats |
VideoPortraitAudioMix10Seats | Mobile | Portrait video layout, up to 10 guest seats |
Owner_Account) enters the room as the owner using the conference.joinRoom API. See Step 5 for details.conference.joinRoom and providing the corresponding roomId.joinRoom enters as an audience. Audience can use the "raise hand" feature to request guest access, or be promoted to guest by the host or administrator in the member list. Currently, joining as a guest via parameters is not supported.import { conference, RoomType } from '@tencentcloud/roomkit-web-vue3';const joinWebinar = async (sharedRoomId: string) => {await conference.joinRoom({roomId: sharedRoomId, // Replace with your actual roomIdroomType: RoomType.Webinar,});};
leaveRoom() to exit the webinar. This does not affect other members; the room remains active.import { conference } from '@tencentcloud/roomkit-web-vue3';await conference.leaveRoom();
endRoom(), all members receive a notification that the room has ended.import { conference } from '@tencentcloud/roomkit-web-vue3';await conference.endRoom();
endRoom() after successfully entering the room. Calling it as a non-host or before entering the room will result in an error.onMounted) and remove them when unmounted (onUnmounted).<template><ConferenceMainView></ConferenceMainView></template><script setup lang="ts">import { ref, onMounted, onUnmounted } from 'vue';import { ConferenceMainView, conference, RoomEvent } from '@tencentcloud/roomkit-web-vue3';const backToHome = () => {};const backToLogin = () => {};onMounted(() => {conference.on(RoomEvent.ROOM_DISMISS, backToHome);conference.on(RoomEvent.ROOM_LEAVE, backToHome);conference.on(RoomEvent.ROOM_ERROR, backToHome);conference.on(RoomEvent.KICKED_OUT, backToHome);conference.on(RoomEvent.KICKED_OFFLINE, backToLogin);conference.on(RoomEvent.USER_SIG_EXPIRED, backToLogin);});onUnmounted(() => {conference.off(RoomEvent.ROOM_DISMISS, backToHome);conference.off(RoomEvent.ROOM_LEAVE, backToHome);conference.off(RoomEvent.ROOM_ERROR, backToHome);conference.off(RoomEvent.KICKED_OUT, backToHome);conference.off(RoomEvent.KICKED_OFFLINE, backToLogin);conference.off(RoomEvent.USER_SIG_EXPIRED, backToLogin);});</script>
Event | Trigger Timing | Recommended Handling |
RoomEvent.ROOM_DISMISS | Room ended, triggered for all members | Return to home or meeting list |
RoomEvent.ROOM_LEAVE | User clicks "Leave" in TUIRoomKit UI | Return to home or meeting list |
RoomEvent.ROOM_ERROR | Room entry failed or unhandled error | Return to home or meeting list |
RoomEvent.KICKED_OUT | Kicked out by host | Return to home or meeting list |
RoomEvent.KICKED_OFFLINE | Same account logged in on another device, current device forced offline | Redirect to login page |
RoomEvent.USER_SIG_EXPIRED | UserSig expired | Redirect to login page |
npm run dev
pnpm run dev
yarn run dev

UIKitProvider parameters in App.vue. UIKitProvider Parameter | Available Values | Default Value |
theme | "light" | "dark" | "light" |
language | "zh-CN" | "en-US" | "en-US" |
<UIKitProvider theme="light" language="zh-CN"><router-view /></UIKitProvider><script setup lang="ts">import { UIKitProvider } from '@tencentcloud/uikit-base-component-vue3';
conference.setFeatureConfig after successfully joining or creating a room.import { conference } from '@tencentcloud/roomkit-web-vue3';// Call after conference.createAndJoinRoom or conference.joinRoom succeeds, when roomId is availableconst roomId = 'webinar_123456';conference.setFeatureConfig({shareLink: `https://your-domain.com/room?roomId=${roomId}`,});
conference.endRoom()// Enable microphone, camera, screen sharing, and fullscreen permissions<iframe src="https://your-domain.com/index.html" allow="microphone; camera; display-capture; display; fullscreen;">
// Set intranet proxy parameters before entering the roomimport TUIRoomEngine from '@tencentcloud/tuiroom-engine-js';import { useRoomEngine } from 'tuikit-atomicx-vue3/room';const { roomEngine } = useRoomEngine();TUIRoomEngine.once('ready', () => {const trtcCloud = roomEngine.instance?.getTRTCCloud();trtcCloud.callExperimentalAPI(JSON.stringify({api: 'setNetworkProxy',params: {websocketProxy: "wss://proxy.example.com/ws/",turnServer: [{url: '14.3.3.3:3478',username: 'turn',credential: 'turn',}],iceTransportPolicy: 'relay',},}));});
피드백