tencent cloud

Feedback

Last updated: 2024-05-06 10:45:16
    This document describes how to customize the UI of TUICallKit and provides two schemes for customization: slight UI adjustment and custom UI implementation.

    Scheme 1: Slight UI Adjustment

    TUICallKit is an audio-video call component with UI. For easy source code adjustment, it is recommended to copy the component directly into your project (the source code is TypeScript).
    Note:
    The slight UI adjustment scheme is suitable for Vue3+TypeScript projects and Callkit 3.2.2 or later. If you are using other languages or technology stacks, please use the custom UI implementation scheme.

    Importing the Source Code

    1. Download the source code
    Vue3
    npm install @tencentcloud/call-uikit-vue
    2. Copy the source code to your project, for example, to the src/components/ directory:
    macOS+Vue3
    Windows+Vue3
    mkdir -p ./src/components/TUICallKit && cp -r ./node_modules/@tencentcloud/call-uikit-vue/* ./src/components/TUICallKit
    xcopy .\\node_modules\\@tencentcloud\\call-uikit-vue .\\src\\components\\TUICallKit /i /e
    3. Modify the import path
    CallKit needs to be imported from a local file instead, as shown in the code below. For details, see Integration (TUICallKit).
    import { TUICallKit, TUICallKitServer, TUICallType } from "./components/TUICallKit/src/index";
    4. Resolve errors that may be caused by copying the source code
    If you encounter an error while using the TUICallKit component, please don't worry. In most cases, this is due to inconsistencies between ESLint and TSConfig configurations. You can consult the documentation and configure correctly as required. If you need help, please feel free to contact us, and we will ensure that you can successfully use this component. Here are some common issues:
    ESLint error
    TypeScript error
    If the TUICallKit causes an error due to inconsistency with your project's code style, you can block this component's directory by adding an .eslintignore file in the root directory of your project, for example:
    # .eslintignore
    src/components/TUICallKit
    If you encounter a Cannot find module '../package.json' error, it is because the TUICallKit references a JSON file. You can add the relevant configuration in tsconfig.json, for example:
    {
    "compilerOptions": {
    "resolveJsonModule": true
    }
    }
    For other TSConfig issues, refer to TSConfig Reference.

    Replacing Icons

    You can directly modify the icon component in the TUICallKit/Components/assets folder to customize the color tone and style of all the icons in your application. When you replace an icon, make sure the filename is the same as that of the original icon.
    Desktop
    Mobile
    
    Serial Number
    Resource Path
    1
    /TUICallKit/Components/assets/button/camera-close.svg
    2
    /TUICallKit/Components/assets/button/microphone-open.svg
    3
    /TUICallKit/Components/assets/button/speaker-open.svg
    4
    /TUICallKit/Components/assets/button/desktop/inviteUser.svg
    5
    /TUICallKit/Components/assets/button/hangup.svg
    6
    /TUICallKit/Components/assets/button/desktop/minimize.svg
    7
    /TUICallKit/Components/assets/button/desktop/fullScreen.svg
    
    
    Serial Number
    Resource Path
    1
    /TUICallKit/Components/assets/button/mobile/minimize.svg
    2
    /TUICallKit/Components/assets/button/hangup.svg
    3
    /TUICallKit/Components/assets/button/accept.svg
    4
    /TUICallKit/Components/assets/button/microphone-open.svg
    5
    /TUICallKit/Components/assets/button/speaker-open.svg
    6
    /TUICallKit/Components/assets/button/camera-close.svg
    7
    /TUICallKit/Components/assets/button/switchCamera.svg

    Replacing Ringtones

    You can replace ringtones by replacing the two audio files in the TUICallKit/src/TUICallService/assets/ folder.
    Filename
    Description
    phone_dialing.mp3
    The sound of making a call
    phone_ringing.mp3
    The ringtone for an incoming call

    Scheme 2: Custom UI Implementation

    The entire call feature of TUICallKit is implemented based on the TUICallEngine SDK, which does not include UI elements. You can use TUICallEngine to implement your own UI. For details, see the documents below:
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support