|
|
@ -8,6 +8,11 @@ import { |
|
|
|
getNearCameraNew, |
|
|
|
} from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js"; |
|
|
|
|
|
|
|
const ErrorTypesCn = { |
|
|
|
NetworkError: "网络错误", |
|
|
|
MediaError: "媒体错误", |
|
|
|
OtherError: "其他错误", |
|
|
|
}; |
|
|
|
/** |
|
|
|
* flv 视频测试 |
|
|
|
* https://bilibili.github.io/flv.js/demo/
|
|
|
@ -96,7 +101,10 @@ async function getUrl({ camId, url, pileNum, rangeIndex } = {}) { |
|
|
|
url = data.liveUrl; |
|
|
|
} |
|
|
|
|
|
|
|
if (!url) return Promise.reject("获取 url 失败!"); |
|
|
|
if (!url) { |
|
|
|
Message.warning("未获取到当前相机的播放地址"); |
|
|
|
return Promise.reject("获取 url 失败!"); |
|
|
|
} |
|
|
|
|
|
|
|
return url; |
|
|
|
} |
|
|
@ -187,7 +195,9 @@ export class HttpLivePlayer { |
|
|
|
console.log("errorType", errorType); |
|
|
|
console.log("errorDetail", errorDetail); |
|
|
|
console.log("errorInfo", errorInfo); |
|
|
|
|
|
|
|
Message.warning( |
|
|
|
`视频流加载失败, ${ErrorTypesCn[errorType] || "其他错误"}` |
|
|
|
); |
|
|
|
this.initLiveVideo(); |
|
|
|
}); |
|
|
|
|
|
|
|