类型:开发

描述:
This commit is contained in:
2026-01-28 18:22:36 +08:00
parent f09d8c972b
commit aa75cd9cb9
8 changed files with 94 additions and 28 deletions

View File

@@ -102,8 +102,12 @@ let isCollect = ref(0)
const player = new WebRTCWhep({
url:url, // WHEP 服务器地址
container: videoElement, // 视频播放容器
onError: (error) => {
console.error('播放错误:', error)
iceservers: [{ urls: 'turn:192.168.77.200:3478',username: 'ZLMediaKit',credential: 'ZLMediaKit'}]
})
player.on('error', (error) => {
console.error('错误:', error.message, error.type)
if(error.type ==='REQUEST_ERROR' || error.type ==='NOT_FOUND_ERROR'){
createPlayer(cameraIndexCode,videoElement);
}
})
webrtcRefs.push(player)