编辑文件
PixelStreaming\WebServers\SignallingWebServer\Public\player.html
body 后面增加下面 js
<body onload="load()">
...
</body>
<script>
let times = setInterval(() => {
if (document.querySelector('#playButton')) {
let video_btn = document.querySelector('#videoPlayOverlay')
video_btn.click()
video_btn.style.display = 'none'
clearInterval(times)
}
}, 2000)
</script>
</html>
谷歌自动播放问题(默认屏蔽)
方法1
修改浏览器站点配置,把 声音 改为允许
方法2
修改文件:PixelStreaming\WebServers\SignallingWebServer\scripts\webRtcPlayer.js
搜索 streamingVideo 增加 video.autoplay = true; 修改 video.muted = true;
this.createWebRtcVideo = function() {
var video = document.createElement('video');
video.id = "streamingVideo";
video.playsInline = true;
video.disablePictureInPicture = true;
video.autoplay = true;
video.muted = true;;
...
}