媒体流播放视频
this.localStream = new MediaStream();
this.video.srcObject = this.localStream;
无法播放视频
刷新了页面,在不进行任何操作的情况下报错
Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.
解决方法
//给video标签添加 muted静音属性
<video muted id="player"></video>
//这种方式竟然不生效
this.video.setAttribute("muted","muted ")