製品アップデート情報
Tencent Cloudオーディオビデオ端末SDKの再生アップグレードおよび承認チェック追加に関するお知らせ
TRTCアプリケーションのサブスクリプションパッケージサービスのリリースに関する説明について

SDKAppID、SDKSecretKey を取得してください。これらは TUICallKit コンポーネントを初期化する 際に必須パラメータ**として使用されます。npm install @tencentcloud/call-uikit-react
debug ディレクトリをプロジェクトディレクトリsrc/debugにコピーします。これは、ローカルで userSig を生成するときに必要です。cp -r node_modules/@tencentcloud/call-uikit-react/debug ./src
xcopy node_modules@tencentcloud\\\\call-uikit-react\\\\debug .\\\\src\\\\debug /i /e
/src/App.tsx ファイルにサンプルコードを導入することができます。import { useState } from 'react';import { TUICallKit, TUICallKitServer, TUICallType } from "@tencentcloud/call-uikit-react";import \\* as GenerateTestUserSig from "./debug/GenerateTestUserSig-es"; // Refer to Step 3
return (\\<><span> caller's ID: </span>\\<input type="text" placeholder='input caller userID' value={callerUserID} onChange={(event) => setCallerUserID(event.target.value)} /><button onClick={init}> step1. init </button> <br /><span> callee's ID: </span>\\<input type="text" placeholder='input callee userID' value={calleeUserID} onChange={(event) => setCalleeUserID(event.target.value)} /><button onClick={call}> step2. call </button>{/\\* 【1】Import the TUICallKit component: Call interface UI \\*/}<TUICallKit />\\</>);
SDKAppID、SDKSecretKey**の 2 つのパラメータを記入力する必要があります。const SDKAppID = 0; // TODO: Replace with your SDKAppID (Notice: SDKAppID is of type number)const SDKSecretKey = ''; // TODO: Replace with your SDKSecretKeyconst \\[callerUserID, setCallerUserID\\] = useState('');const \\[calleeUserID, setCalleeUserID\\] = useState('');//【2】Initialize the TUICallKit componentconst init = async () => {const { userSig } = GenerateTestUserSig.genTestUserSig({userID: callerUserID,SDKAppID,SecretKey: SDKSecretKey,});await TUICallKitServer.init({userID: callerUserID,userSig,SDKAppID,});alert('TUICallKit init succeed');}//【3】Make a 1v1 video callconst call = async () => {await TUICallKitServer.call({userID: calleeUserID.value,type: TUICallType.VIDEO_CALL,});};
パラメータ | タイプ | 説明 |
userID | String | ユーザーの一意の識別子。ユーザーが定義するものであり、大文字と小文字の英字(a-z A-Z)、数字(0~9)、アンダースコアとハイフンのみを含めることができます。 |
SDKAppID | Number | Tencent RTC コンソール で音声・動画アプリケーションの一意の識別子を作成します。 |
SDKSecretKey | String | Tencent RTC コンソール で音声・動画アプリケーションの SDKSecretKey を作成します。 |
userSig | String | ユーザーのログイン認証を行い、ユーザーが真実であることを確認し、悪意のある攻撃者による CVM へのアクセスを阻止するためのセキュリティ保護サイン。 |
debug ファイル内の genTestUserSig関数(ステップ 3.2を参照)を使用して userSig を生成することができます。この方法の SDKSecretKey は逆コンパイル・逆クラックされやすく、キーが漏洩すると、攻撃者はお客様の Tencent Cloud トラフィックを盗むことができます。//【3】Make a 1v1 video callconst call = async () => {await TUICallKitServer.call({userID: calleeUserID,type: TUICallType.VIDEO_CALL,});};
step1. init をクリックしてログインします(発呼側と着呼側)。
step2. call ** をクリックして電話をかけます。通話に問題がある場合は、よくある質問を参照してください。
フィードバック