Why is WebRTC remote video source generated by URL.createObjectURL

前端 未结 2 1491
悲哀的现实
悲哀的现实 2020-12-19 23:11

In this document, it uses URL.createObjectURL to set the video source. (This is the code to answer a call).

var offer = getOfferFromFriend();
na         


        
2条回答
  •  旧时难觅i
    2020-12-19 23:15

    Because a WebRTC connection involves several steps and what you get from such a connection is a stream. But the src property of the video tag does not accept a stream, but a URL. And this is the way to "convert" a stream to a URL.

提交回复
热议问题