我发现这可以使用:
//禁用远程音轨的播放 remoteAudioTrack.enablePlayback(false);
但是如何使用它,我的意思是我将如何访问remoteAudioTrack类
答案 0 :(得分:0)
const toggleVoice = () => { // Voice toggle event handler
if (voiceStatus === "Mute") {
room.localParticipant.audioTracks.forEach(audioTrack => {
audioTrack.track.disable();
});
setVoiceStatus("Unmute");
} else {
room.localParticipant.audioTracks.forEach(audioTrack => {
audioTrack.track.enable();
});
setVoiceStatus("Mute");
}
}
const toggleVideo = () => { // Video toggle event handler
if (videoStatus === "Stop Video") {
room.localParticipant.videoTracks.forEach(videoTrack => {
videoTrack.track.disable();
});
setVideoStatus("Start Video");
} else {
room.localParticipant.videoTracks.forEach(videoTrack => {
videoTrack.track.enable();
});
setVideoStatus("Stop Video");
}
}