<LiveMainView />:
The component body of TUILiveKit UI.LiveMainView
provided API.API | Description |
Access the roomEngine instance. If roomEngine does not exist, it will return null. | |
Listen to specified types of apid Integration with TUIRoomKit. Event. When the event occurs, the callback function will be called. | |
Cancel listening for events of a specified type. | |
Log in to the live system. | |
Log out of the live system. | |
Start a new live. | |
Join an existing live. | |
Leave the current live. | |
Dismiss the current live. | |
Set your user information. | |
Set the interface language. | |
Set the interface topic. |
import { liveRoom, TUIRoomEngine } from '@tencentcloud/livekit-web-vue3';TUIRoomEngine.once('ready', () => {const roomEngine = liveRoom.getRoomEngine();});
Parameter | Type | Default Value | Meaning |
eventType | - | Event Type to Listen For | |
callback | () => void | - | Callback Function Called When the Event Occurs |
import { liveRoom, RoomEvent } from '@tencentcloud/livekit-web-vue3';liveRoom.on(RoomEvent.RoomStart, () => {console.log('[liveRoom] The live has already started.')});liveRoom.on(RoomEvent.ROOM_DISMISS, () => {console.log('[liveRoom] The live has been dismissed')});
Parameter | Type | Default Value | Meaning |
eventType | - | The type of event to cancel listening for | |
callback | () => void | - | The callback function added previously |
import { liveRoom } from '@tencentcloud/livekit-web-vue3';liveRoom.off('event', callback);
Parameter | Type | Default Value | Meaning |
params | {sdkAppId: number; userId: string; userSig: string; tim?: ChatSDK} | - | Log in to the parameter object. |
sdkAppId | number | - | In the Real-time Audio and Video Console click Application Management > create an application. After creating a new application, you can access the sdkAppId information in Application Information. |
userId | string | - | It's advised to limit the User ID length to 32 bytes, allowing only uppercase and lowercase letters (a-zA-Z), digits (0-9), underscores, and hyphens. |
userSig | string | - | userSig Signature |
tim | ChatSDK (Optional) | - | If you want to leverage more capabilities of the Instant Messaging SDK while integrating roomEngine, you can pass the created tim instance into TUIRoomEngine. For how to create a tim instance, please refer to TIM.create. |
import { liveRoom } from '@tencentcloud/livekit-web-vue3';liveRoom.login({sdkAppId: 123456,userId: 'testUser',userSig: 'testSig'});
import { liveRoom } from '@tencentcloud/livekit-web-vue3';liveRoom.logout();
Parameter | Type | Default Value | Meaning |
roomId | string | - | living Room ID |
params | - | Parameters for starting the living |
import { liveRoom } from '@tencentcloud/livekit-web-vue3';liveRoom.start('123456', {roomName: 'TestRoom',isOpenCamera: false,isOpenMicrophone: false,});
Parameter | Type | Default Value | Meaning |
roomId | string | - | living Room ID |
params | - | Parameters for joining the |
import { liveRoom } from '@tencentcloud/livekit-web-vue3';liveRoom.join('123456', {isOpenCamera: false,isOpenMicrophone: false,});
import { liveRoom } from '@tencentcloud/livekit-web-vue3';liveRoom.leave();
import { liveRoom } from '@tencentcloud/livekit-web-vue3';liveRoom.dismiss();
Parameter | Type | Default Value | Meaning |
options | {userName: string; avatarUrl: string} | - | User information object |
userName | string(Optional) | - | User's nickname |
avatarUrl | string(Optional) | - | User profile photo |
import { liveRoom } from '@tencentcloud/livekit-web-vue3';liveRoom.setSelfInfo({userName: 'test-name',avatarUlr: 'https://avatar.png'});
Parameter | Type | Default Value | Meaning |
language | 'zh-CN' | 'en-US' | - | Language |
import { liveRoom } from '@tencentcloud/livekit-web-vue3';liveRoom.setLanguage('en-US');
Parameter | Type | Default Value | Meaning |
theme | 'LIGHT' | 'DARK' | - | Topic Type |
import { liveRoom } from '@tencentcloud/livekit-web-vue3';liveRoom.setTheme('DARK');
Parameter | Type | Description |
ROOM_START | string | Creating a live room |
ROOM_JOIN | string | Joining a live room |
ROOM_LEAVE | string | Leave live room |
ROOM_DISMISS | string | Live room Dismissed |
KICKED_OFFLINE | string | User kicked offline |
KICKED_OUT | string | Participant removed from living |
USER_LOGOUT | string | User logged out |
ROOM_ERROR | string | Live room error |
ROOM_NEED_PASSWORD | string | Live room password |
Parameter | Type | Description |
SwitchTheme | string | Switch Topic Feature Button |
SwitchLanguage | string | Switch Language Feature Button |
Parameter | Type | Description | Default Value |
roomName | string (Optional) | Room Name | - |
isOpenCamera | boolean (optional) | Whether to enable the camera | false |
isOpenMicrophone | boolean (optional) | Whether to enable the microphone | false |
defaultCameraId | string (Optional) | Default Camera ID | - |
defaultMicrophoneId | string (Optional) | Default Microphone ID | - |
defaultSpeakerId | string (Optional) | Default Speaker ID | - |
Parameter | Type | Description | Default Value |
isOpenCamera | boolean (optional) | Whether to enable the camera | false |
isOpenMicrophone | boolean (optional) | Whether to enable the microphone | false |
defaultCameraId | string (Optional) | Default Camera ID | - |
defaultMicrophoneId | string (Optional) | Default Microphone ID | - |
defaultSpeakerId | string (Optional) | Default Speaker ID | - |
Was this page helpful?