Commit c15124ea authored by 张牧越's avatar 张牧越

bugfix

parent 3df8f0b7
......@@ -180,6 +180,7 @@ export default {
id: data.id,
};
this.$forceUpdate();
let ts = new Date().getTime();
getVideoLiveAddressUrl(data.id).then((res) => {
if (res.data.live_address_url) {
this.$nextTick(() => {
......@@ -187,11 +188,12 @@ export default {
`video-container-${nullIndex + 1}`
);
myVideoDiv.innerHTML = `<video
id="singleVideo${nullIndex + 1}"
id="singleVideo${ts}"
autoplay="autoplay"
class="video-js vjs-default-skin"
muted="muted"
></video>`;
const singlePlayer = videojs(`singleVideo${nullIndex + 1}`, {
const singlePlayer = videojs(`singleVideo${ts}`, {
autoplay: true, // 自动播放
controls: true, // 控件显示
preload: "auto", //定义视频加载模式
......@@ -227,6 +229,7 @@ export default {
id="singleVideo${this.cameraList.length}"
autoplay="autoplay"
class="video-js vjs-default-skin"
muted="muted"
></video>`;
const singlePlayer = videojs(
`singleVideo${this.cameraList.length}`,
......@@ -290,16 +293,19 @@ export default {
player: undefined,
id: id,
});
let ts = new Date().getTime();
setTimeout(() => {
this.$nextTick(() => {
const myVideoDiv = document.getElementById(
`video-container-${index + 1}`
);
myVideoDiv.innerHTML = `<video
id="singleVideo${index + 1}"
id="singleVideo${ts}"
autoplay="autoplay"
class="video-js vjs-default-skin"
muted="muted"
></video>`;
const singlePlayer = videojs(`singleVideo${index + 1}`, {
const singlePlayer = videojs(`singleVideo${ts}`, {
autoplay: true, // 自动播放
controls: true, // 控件显示
preload: "auto", //定义视频加载模式
......@@ -309,10 +315,14 @@ export default {
src: res.data.live_address_url,
type: "application/x-mpegURL",
});
this.$nextTick(() => {
singlePlayer.play();
});
this.cameraList[index].player = singlePlayer;
this.$forceUpdate();
});
}, 500);
}
});
});
......@@ -332,6 +342,9 @@ export default {
}
},
},
destroyed() {
this.closeAll();
},
};
</script>
<style lang="less" scoped>
......
......@@ -33,6 +33,10 @@ noLoadingrequest.interceptors.response.use(
return response.data
},
error => {
Message({
message: '服务器错误',
type: 'error'
})
console.log(error)
return Promise.reject(new Error(error).message)
}
......
......@@ -69,6 +69,10 @@ request.interceptors.response.use(
return response.data
},
error => {
Message({
message: '服务器错误',
type: 'error'
})
console.log(error)
closeLoading()
return Promise.reject(new Error(error).message)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment