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

styleFix

parent 45f6f343
...@@ -105,47 +105,8 @@ export default { ...@@ -105,47 +105,8 @@ export default {
getVideoTreeData().then((res) => { getVideoTreeData().then((res) => {
this.treeData = this.handleData(res.data); this.treeData = this.handleData(res.data);
this.videoURLArray = this.treeData
.map((item) => {
return item.children.map((items) => {
return items.id;
});
})
.flat();
if (this.videoURLArray.length > 9) {
this.videoURLArray = this.videoURLArray.slice(0, 9);
}
this.videoURLArray.map((id, index) => {
this.cameraList.push({
player: undefined,
id: id,
});
getVideoLiveAddressUrl(id).then((res) => {
this.$nextTick(() => { this.$nextTick(() => {
const myVideoDiv = document.getElementById( this.viewAll();
`video-container-${index + 1}`
);
myVideoDiv.innerHTML = `<video
id="singleVideo${index + 1}"
autoplay="autoplay"
class="video-js vjs-default-skin"
></video>`;
const singlePlayer = videojs(`singleVideo${index + 1}`, {
autoplay: true, // 自动播放
controls: true, // 控件显示
preload: "auto", //定义视频加载模式
loop: true, //是否循环播放
});
singlePlayer.src({
src: res.data.live_address_url,
type: "application/x-mpegURL",
});
singlePlayer.play();
this.cameraList[index].player = singlePlayer;
});
});
}); });
}); });
}, },
...@@ -300,21 +261,21 @@ export default { ...@@ -300,21 +261,21 @@ export default {
}, },
viewAll() { viewAll() {
this.cameraList.map((item) => { this.cameraList.map((item) => {
item.player.dispose(); item.player && item.player.dispose();
item.player = null; item.player = null;
item.id = ""; item.id = "";
item.live_address_url = ""; item.live_address_url = "";
}); });
this.cameraList = []; this.cameraList = [];
const allVideoIdArray = this.treeData let allVideoIdArray = this.treeData
.map((item) => { .map((item) => {
return item.children.map((child) => { return item.children.map((child) => {
return child.id; return child.id;
}); });
}) })
.flat(); .flat();
allVideoIdArray = allVideoIdArray.slice(0, this.activeSplice);
allVideoIdArray.map((id, index) => { allVideoIdArray.map((id, index) => {
this.cameraList.push({ this.cameraList.push({
player: undefined, player: undefined,
...@@ -523,4 +484,10 @@ export default { ...@@ -523,4 +484,10 @@ export default {
.tree-shadow-container { .tree-shadow-container {
height: calc(97% - 52px); height: calc(97% - 52px);
} }
::v-deep .vjs-big-play-button {
left: 50% !important;
top: 50% !important;
transform: translateX(-50%) translateY(-50%) !important;
}
</style> </style>
\ No newline at end of file
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