RTC Engine
  • 产品概述
  • Web
    • 跑通 Demo
    • SDK 快速启动
    • 基础功能
      • 屏幕分享
      • 直播
      • 媒体设备
      • 音量
      • 设置编码配置文件
      • 检测网络质量
      • 检测能力
    • 高级功能
      • 启用 AI 降噪
      • 启用混音
      • 启用水印
      • Enable Virtual Background
      • 启用美颜和特效
      • 数据消息
      • 自定义采集和渲染
    • 接口列表
    • 发布说明
    • 支持平台
    • Web 常见问题
      • 优化多人视频通话
      • 处理自动播放受限
      • 应对防火墙限制
      • 其他
  • Android
    • Run Sample Code
    • Integration
    • 集成
      • 7. 检测网络质量
      • 8. 开启屏幕共享
      • 9. 设置视频质量
      • 10. 旋转视频
    • Advanced Features
      • 测试网络质量
      • 自定义采集和渲染
      • 自定义音频采集和播放
    • 客户端API
      • 产品概述
      • TRTCCloud
      • TRTCStatistics
      • TRTCCloudListener
      • TXAudioEffectManager
      • TXBeautyManager
      • TXDeviceManager
      • 类型定义
      • 废弃接口
      • 错误码
    • 解决方案
      • 实时合唱 (TUIKaraoke)
        • 快速集成
        • 实施步骤
        • 歌曲同步
        • 歌词同步
        • 语音同步
        • 混流解决方案
        • TRTCKaraoke 相关接口
        • 常见问题
    • 发布说明
  • iOS
    • Run Sample Code
    • Integration
    • 集成
      • 7. 检测网络质量
      • 8. 开启屏幕共享
      • 9. 设置视频质量
      • 10. 旋转视频
    • Advanced Features
      • 测试网络质量
      • 自定义采集和渲染
      • 自定义音频采集和播放
    • 客户端API
      • 产品概述
      • TRTCCloud
      • TRTCCloudDelegate
      • TRTCStatistics
      • TXAudioEffectManager
      • TXBeautyManager
      • TXDeviceManager
      • 类型定义
      • 废弃接口
      • ErrorCode
    • 解决方案
      • 快速集成
      • 实施步骤
      • 歌曲同步
      • 歌词同步
      • 语音同步
      • 混流解决方案
      • TRTCKaraoke 相关接口
      • 常见问题
    • 发布说明
  • macOS
    • Run Sample Code
    • Integration
    • 集成
      • 7. 检测网络质量
      • 8. 开启屏幕共享
      • 9. 共享电脑声音
      • 10. 设置视频质量
      • 11. 旋转视频
    • Advanced Features
      • 测试硬件设备
      • 测试网络质量
      • 自定义采集和渲染
      • 自定义音频采集和播放
    • 客户端API
      • 产品概述
      • TRTCCloud
      • TRTCCloudDelegate
      • TRTCStatistics
      • TXAudioEffectManager
      • TXBeautyManager
      • TXDeviceManager
      • 类型定义
      • 废弃接口
      • ErrorCode
      • 发布说明
    • 发布说明
  • Windows
    • Run Sample Code
    • Integration
    • 集成
      • 7. 检测网络质量
      • 8. 开启屏幕共享
      • 9. 设置视频质量
      • 10. 旋转视频
    • Advanced Features
      • 测试硬件设备
      • 测试网络质量
      • 自定义采集和渲染
      • 自定义音频采集和播放
    • 客户端API
      • 产品概述
      • ITRTCCloud
      • ITRTCStatistics
      • TRTCCloudCallback
      • ITXAudioEffectManager
      • ITXDeviceManager
      • 类型定义
      • 废弃接口
      • 错误码
    • 发布说明
  • Electron
    • 集成
      • 1. 接口示例
      • 2. 导入 SDK
      • 3. 进入房间
      • 4. 订阅音视频流
      • 5. 发布音视频流
      • 6. 退出房间
      • 7. 检测网络质量
      • 8. 开启屏幕共享
      • 9. 共享电脑声音
      • 10. 设置视频质量
      • 11. 旋转视频
    • 客户端API
      • 产品概述
      • 错误码
  • Flutter
    • 集成
      • 1. 接口示例
      • 2. 导入 SDK
      • 3. 进入房间
      • 4. 订阅音视频流
      • 5. 发布音视频流
      • 6. 退出房间
      • 7. 检测网络质量
      • 8. 开启屏幕共享
      • 9. 共享电脑声音
      • 10. 设置视频质量
      • 11. 旋转视频
    • 客户端API
      • 产品概述
      • 错误码
  • Unity
    • 集成
      • 1. 接口示例
      • 2. 导入 SDK
    • 客户端API
      • 产品概述
      • 错误码
  • QT
    • 集成
      • 1. 导入 SDK
  • 产品概述
    • 产品概述
  • 概念
  • 产品特性
  • 性能统计
  • 价格中心
    • 免费时长
    • RTC-Engine 套餐
    • 订阅套餐时长计费说明
    • 现收现付
      • 音视频时长计费说明
      • 云端录制计费说明
      • 混流转码与旁路转推计费说明
  • 常见问题
    • 入门常见问题
    • 迁移指南
      • Twilio Video 到 TRTC 的迁移
      • 计费
      • 产品特性
      • UserSig
      • 防火墙限制
      • 如何缩减安装包
      • TRTCCalling Web 相关
      • 音视频质量
      • 其他
RTC Engine
当前内容仅提供英语版本,中文版我们将尽快补充,感谢您的理解。

检测能力

To ensure that users can have a good experience with the TRTC SDK, we recommend you test the user's media device and network quality the user enters a TRTC room.

Supported Platforms

Detect Browser Capabilities

Before entering room, we recommend you use the TRTC.isSupported API to check whether the SDK supports the current browser first, and if not, please guide the user to use a supported browser(Chrome 56+, Edge 80+, Firefox 56+, Safari 11+).
TRTC.isSupported().then(checkResult => {
// Not supported, guide the user to use a supported browser(Chrome 56+, Edge 80+, Firefox 56+, Safari 11+).
if (!checkResult.result) {}
// Not support to publish video
if (!checkResult.detail.isH264EncodeSupported) {}
// Not support to subscribe video
if (!checkResult.detail.isH264DecodeSupported) {}
});
If the check result returned from TRTC.isSupported is false, the reason may be:
1. The web page uses the http protocol. Browsers do not allow http protocol sites to capture cameras and microphones, you need to deploy your page using the https protocol.
2. Firefox browser needs to load H264 codec dynamically after installation, so the detection result will be false for a short period of time, please wait and try again or guide to use other browsers.

Test Media Device

Generally, the Media Device Testing looks like this.











Test Camera

1. Get camera list
Generally, you need to check the camera list first to confirm whether the user has a camera. Then, you can show a camera list to let user to select the camera they want.
const cameraList = await TRTC.getCameraList();
const hasCameraDevice = cameraList.length > 0;

if (!hasCameraDevice) {
// User has not any camera.
}
2. Capture and play camera
In this step, you need to capture and play camera, and does not need to publish stream.
If capturing camera successfully, you need guide user confirm whether user can see the camera view normally.
If capturing camera failed, it is usually caused by NotAllowedError or NotReadableError, refer to DEVICE_ERROR.
try {
// Capture and play camera, not need to publish stream
await trtc.startLocalVideo({ view: 'camera-video-view-id', publish: false });
} catch(error) {
// Common reasons: NotAllowedError or NotReadableError
}
3. Switch camera
The SDK will capture the first camera of camera list by default if you did not specify the cameraId when calling trtc.startLocalVideo.
The user may want to switch another camera before entering room if the user has a lot of cameras.
// You can get the cameraId from the camera list you got in fisrt step.
if (cameraList[1]) {
try {
await trtc.updateLocalVideo({ option: { cameraId: cameraList[1].deviceId } });
} catch(error) {
// Common reasons: NotAllowedError or NotReadableError, same with step 2.
}
}
4. Stop camera
You need to stop camera when the testing finished.
await trtc.stopLocalVideo();

Test Microphone

1. Get mircrophone list
Generally, you need to check the mircrophone list first to confirm whether the user has a mircrophone. Then, you can show a mircrophone list to let user select the mircrophone they want.
const microphoneList = await TRTC.getMicrophoneList();
const hasMicrophoneDevice = micList.length > 0;

if (!hasMicrophoneDevice) {
// User has not any microphone.
}
2. Capture microphone and get the volume
In this step, you need to capture the microphone, get the audio volume of microphone to show a volume bar, and do not need to publish stream.
If capturing successfully, you need to guide the user to confirm whether the volume bar has changed.
If capturing failed, it is usually caused by NotAllowedError or NotReadableError, refer to DEVICE_ERROR.
try {
// Capture microphone
await trtc.startLocalAudio({ publish: false });
trtc.on(TRTC.EVENT.AUDIO_VOLUME, event => {
event.result.forEach(({ userId, volume }) => {
// When userId is an empty string, it represents the volume of the local microphone.
const isMe = userId === '';
if (isMe) {
// show a volume bar based on the value of volume.
}
})
});
trtc.enableAudioVolumeEvaluation(500);
} catch(error) {
// Common reasons: NotAllowedError or NotReadableError
}
3. Switch microphone
The SDK will capture the first microphone of microphone list by default if you did not specify the microphoneId when calling trtc.startLocalAudio.
The user may want to switch to another microphone before entering room if the user has a lot of microphones.
// You can get the microphoneId from the microphone list you got in fisrt step.
if (microphoneList[1]) {
try {
await trtc.updateLocalAudio({ option: { microphoneId: microphoneList[1].deviceId } });
} catch(error) {
// Common reasons: NotAllowedError or NotReadableError, same with step 2.
}
}
4. Stop microphone
// You need to stop microphone when the testing finished.
await trtc.stopLocalAudio();
// disable audio-volume event
trtc.enableAudioVolumeEvaluation(-1);

Test Speaker

1. Get speaker list
const speakerList = await TRTC.getSpeakerList();
if (speakerList.length === 0) {
// User has not speaker.
}
2. Play a mp3 media file through the audio element.
You need to guide user to play the mp3 file and confirm whether they can hear the sound from the speaker.
<audio id="audio-player" src="xxxxx" controls></audio>
3. Switch speaker
You cannot use the TRTC.setCurrentSpeaker to switch speaker, because you play a mp3 by audio element but not TRTC SDK. There is a HTMLMediaElement.sinkId property which can be used to set speaker.
const audioElement = document.getElementById('audio-player');
if (speakerList[1]) {
audioElement.sinkId = speakerList[1].deviceId;
}

Detect Network Quality

Online TRTC Capability Detection

You can use the Online TRTC Capability Detection where you are currently using the TRTC SDK to detect the current environment. You can also click the "Generate Report" button to get a report of the current environment for environment detection or troubleshooting.