我尝试了下面的代码
localPeerConnection.addTrack(await localStream)
remotePeerConnection.ontrack = () => {
const remoteStreamVideoElement = document.querySelector("#remoteStreamVideoElement")
remoteStreamVideoElement.srcObject = localStream
remoteStreamVideoElement.onloadedmetadata = () => remoteStreamVideoElement.play()
}
但它返回了这个错误
TypeError: Argument 1 of RTCPeerConnection.addTrack does not implement interface MediaStreamTrack.