有人可以解释这个更长的路吗?我真的不了解代码的一部分,它是如何工作的。有人可以写得很像: 如果thing =“x” 如果事情= ...
thing = "x" if thing.lower() == "o" else "o"
答案 0 :(得分:2)
相当于
var localMediaContainer = document.getElementById('local-video');
var videoElement;
const localParticipant = room.localParticipant;
room.localParticipant.tracks.forEach(track => {
videoElement = track.attach();
localMediaContainer.appendChild(videoElement);
});
console.log('Connected to the Room as LocalParticipant: ', localParticipant.identity);