Closed kun510 closed 3 months ago
Not related to the samples, as noted in the deleted template this repository is not a general support place for WebRTC
Have you found a solution for your issue? I ran into something similar, a video sent from machine A to machine B, I ca see track added and media Stream live, etc, but the video just not play on machine B.
my code: peerConnection.ontrack = function(event) { console.log('Set up ontrack handler successfully'); console.log('Received remote stream event:', event); console.log('Received remote stream:', event.streams[0]); console.log('MediaStream tracks:', event.streams[0].getTracks()); event.streams[0].getVideoTracks().forEach(track => { track.enabled = true; });
(index):125 Received remote stream event: RTCTrackEvent {isTrusted: true, receiver: RTCRtpReceiver, track: MediaStreamTrack, streams: Array(1), transceiver: RTCRtpTransceiver, …}isTrusted: truebubbles: falsecancelBubble: falsecancelable: falsecomposed: falsecurrentTarget: RTCPeerConnection {localDescription: RTCSessionDescription, currentLocalDescription: RTCSessionDescription, pendingLocalDescription: null, remoteDescription: RTCSessionDescription, onerror: ƒ, …}defaultPrevented: falseeventPhase: 0receiver: RTCRtpReceiver {track: MediaStreamTrack, transport: RTCDtlsTransport, rtcpTransport: null, playoutDelayHint: null, jitterBufferTarget: null}returnValue: truesrcElement: RTCPeerConnection {localDescription: RTCSessionDescription, currentLocalDescription: RTCSessionDescription, pendingLocalDescription: null, remoteDescription: RTCSessionDescription, onerror: ƒ, …}streams: [MediaStream]target: RTCPeerConnection {localDescription: RTCSessionDescription, currentLocalDescription: RTCSessionDescription, pendingLocalDescription: null, remoteDescription: RTCSessionDescription, onerror: ƒ, …}timeStamp: 9550track: MediaStreamTrack {kind: 'video', id: '63f076da-8d01-4338-a574-8fbacb71f748', label: '63f076da-8d01-4338-a574-8fbacb71f748', enabled: true, muted: true, …}transceiver: RTCRtpTransceiver {mid: '0', sender: RTCRtpSender, receiver: RTCRtpReceiver, stopped: false, direction: 'recvonly', …}type: "track"[[Prototype]]: RTCTrackEvent (index):126 Received remote stream: MediaStream {id: '1840e418-9a27-40d2-9c04-98db65d6b45e', active: true, onaddtrack: null, onremovetrack: null, onactive: null, …}active: trueid: "1840e418-9a27-40d2-9c04-98db65d6b45e"onactive: nullonaddtrack: nulloninactive: nullonremovetrack: null[[Prototype]]: MediaStream (index):127 MediaStream tracks: [MediaStreamTrack] (index):135 Video srcObject set to remote stream
It clearly has data but it doesn't display the video