类型:开发

描述:
This commit is contained in:
2026-01-28 18:42:42 +08:00
parent 970795110d
commit 01586539db
7 changed files with 88 additions and 26 deletions

View File

@@ -304,8 +304,12 @@ const createPlayer = (cameraIndexCode,videoElement) => {
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)