类型:开发
描述:
This commit is contained in:
@@ -422,15 +422,11 @@
|
|||||||
cameraIndexCode.value = code
|
cameraIndexCode.value = code
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (url.startsWith('http://192.168.77.200:8050/')) {
|
if (url.startsWith('http://192.168.77.200:8050/')) {
|
||||||
if(hlsRef){
|
|
||||||
hlsRef.updateUrl(url);
|
|
||||||
}else{
|
|
||||||
hlsRef = new WebRTCWhep({
|
hlsRef = new WebRTCWhep({
|
||||||
url: url, // WHEP 服务器地址
|
url: url, // WHEP 服务器地址
|
||||||
container: videoRef.value, // 视频播放容器
|
container: videoRef.value, // 视频播放容器
|
||||||
iceServers: [{ urls: 'turn:192.168.77.200:3478',username: 'ZLMediaKit',credential: 'ZLMediaKit'}]
|
iceServers: [{ urls: 'turn:192.168.77.200:3478',username: 'ZLMediaKit',credential: 'ZLMediaKit'}]
|
||||||
})
|
})
|
||||||
}
|
|
||||||
hlsRef.on('error', (error) => {
|
hlsRef.on('error', (error) => {
|
||||||
console.error('错误:', error.message, error.type)
|
console.error('错误:', error.message, error.type)
|
||||||
if(error.type ==='REQUEST_ERROR' || error.type ==='NOT_FOUND_ERROR'){
|
if(error.type ==='REQUEST_ERROR' || error.type ==='NOT_FOUND_ERROR'){
|
||||||
|
|||||||
@@ -375,16 +375,11 @@ const handleItemVideo = async (url, type, code, item) => {
|
|||||||
cameraIndexCode.value = code
|
cameraIndexCode.value = code
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (url.startsWith('http://192.168.77.200:8050/')) {
|
if (url.startsWith('http://192.168.77.200:8050/')) {
|
||||||
if(hlsRef){
|
|
||||||
hlsRef.updateUrl(url);
|
|
||||||
}else{
|
|
||||||
hlsRef = new WebRTCWhep({
|
hlsRef = new WebRTCWhep({
|
||||||
url: url, // WHEP 服务器地址
|
url: url, // WHEP 服务器地址
|
||||||
container: videoRef.value, // 视频播放容器
|
container: videoRef.value, // 视频播放容器
|
||||||
iceServers: [{ urls: 'turn:192.168.77.200:3478',username: 'ZLMediaKit',credential: 'ZLMediaKit'}]
|
iceServers: [{ urls: 'turn:192.168.77.200:3478',username: 'ZLMediaKit',credential: 'ZLMediaKit'}]
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
|
||||||
hlsRef.on('error', (error) => {
|
hlsRef.on('error', (error) => {
|
||||||
console.error('错误:', error.message, error.type)
|
console.error('错误:', error.message, error.type)
|
||||||
if(error.type ==='REQUEST_ERROR' || error.type ==='NOT_FOUND_ERROR'){
|
if(error.type ==='REQUEST_ERROR' || error.type ==='NOT_FOUND_ERROR'){
|
||||||
|
|||||||
Reference in New Issue
Block a user