TRTC Web APIs include the feature APIs for active calling and the event notification APIs with trigger setting, wherein the feature APIs include basic feature APIs and advanced feature APIs, and the event notifications include basic event notifications and advanced event notifications. Junior developers can complete basic development access through basic feature APIs and basic event notifications, and can experience the main features of TRTC. Senior developers can complete the development through advanced feature APIs and advanced event notifications, and can experience the advanced features of TRTC.
API | Description |
---|---|
WebRTCAPI.fn.detectRTC | Detects whether it supports WebRTC |
WebRTCAPI | Initialization |
WebRTCAPI.enterRoom( WebRTCAPI.createRoom ) | Creates or enters an audio/video room |
WebRTCAPI.quit | Exits an audio/video room |
Event | Description |
---|---|
onLocalStreamAdd | Addition/update of local video stream |
onRemoteStreamUpdate | Addition/update of remote video stream |
onRemoteStreamRemove | Disconnection of remote video stream |
onWebSocketClose | Disconnection of websocket |
onRelayTimeout | Disconnection of video stream server after timeout |
onKickout | Forced logout (The same user logged in repeatedly) |
API | Description |
---|---|
WebRTCAPI.startRTC | Only used for active push |
WebRTCAPI.stopRtc | Stops the push |
WebRTCAPI.getLocalStream | Gets local audio/video stream |
WebRTCAPI.updateStream | Updates video stream |
WebRTCAPI.openVideo | Turns on video collection again during the push process |
WebRTCAPI.closeVideo | Temporarily turns off video collection during the push process |
WebRTCAPI.openAudio | Turns on audio collection again during the push process |
WebRTCAPI.closeAudio | Temporarily turns off audio collection during the push process |
WebRTCAPI.changeSpearRole | Switches audio and video parameter settings |
WebRTCAPI.getVideoDevices | Enumerates video collection devices |
WebRTCAPI.getAudioDevices | Enumerates audio collection devices |
WebRTCAPI.chooseVideoDevice | Chooses the video collection device |
WebRTCAPI.chooseAudioDevice | Chooses the audio collection device |
WebRTCAPI.SoundMeter | Sound input detection |
Event | Description |
---|---|
onPeerConnectionAdd | Notification of PeerConnection addition. Please make sure you understand the role and significance of peer connection notification |
2.6.1
## WebRTCAPI.getSpeakerDevices This API is used to enumerate audio output devices ## WebRTCAPI.chooseSpeakerDevice This API is used to enumerate audio output devices
Was this page helpful?