webrtc - video get blob, but it remain black

后端 未结 2 1051
一生所求
一生所求 2021-02-08 12:53

I run my webrtc code with chrome 21.

If I open two tabs in the same chrome, and then open page with webrtc code inside. One tab is for sending video stream; one tab is f

2条回答
  •  清酒与你
    2021-02-08 13:42

    I had the same issue, and I just resolved it by calling VideoElement.play() right after attaching the stream as the VideoElement.src

    document.querySelector( "#video" ).src = window.URL.createObjectURL( remoteStream );
    document.querySelector( "#video" ).play();
    

    Don't wait for the loadedmetadata event because it doesn't seem to be triggered but the WebRTC stream.

提交回复
热议问题