|
@@ -25,48 +25,45 @@
|
|
|
</el-select>
|
|
|
</el-form-item> -->
|
|
|
<el-form-item label="宫格数量" prop="航段">
|
|
|
- <el-select v-model="form.type" placeholder="请选择">
|
|
|
+ <el-select v-model="form.type" placeholder="请选择" @change="changeVideoData">
|
|
|
<el-option v-for="item in typeList" :key="item" :label="item" :value="item">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
- <div style="width: 100%;" v-if="form.type == '单视频'">
|
|
|
- <liveqing videoElementId="videoId1" style="width: 80vw;height: 80vh;"></liveqing>
|
|
|
+ <div style="width: 100%;padding-left: 3vw;" v-if="form.type == '单视频'">
|
|
|
+ <!-- <liveqing videoElementId="videoId1" style="width: 80vw;height: 80vh;"></liveqing> -->
|
|
|
+ <!-- <aliplayer ref="videoObj" style="width: 80vw;height: 80vh;"></aliplayer> -->
|
|
|
<!-- </div> -->
|
|
|
+ <div style="width: 75vw;height: 80vh;margin-left: 0.5vw;margin-top: 0.5vh;position: relative;">
|
|
|
+ <!-- <LivePlayer v-if="displayList[0]" :videoUrl="videoList[0]" fluent autoplay live stretch :timeout=3
|
|
|
+ style="width:100%;height:100%;">
|
|
|
+ </LivePlayer> -->
|
|
|
+ <aliplayer ref="videoObj" style="width: 75vw;height: 80vh;"></aliplayer>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div style="width: 100%;display: flex;flex-direction: row;flex-wrap: wrap;" v-if="form.type == '四宫格'">
|
|
|
+ <div style="width: 100%;display: flex;flex-direction: row;flex-wrap: wrap;padding-left: 2vw;" v-if="form.type == '四宫格'">
|
|
|
<!-- <div v-for="item in 9"> -->
|
|
|
<!-- <video v-for="item in 4" style="width: 49%;margin-left:0.5%" :src="videoList[item - 1]" controls="controls"
|
|
|
:autoplay="false" muted="muted" :ref="`videoref${item}`"></video> -->
|
|
|
<!-- </div> -->
|
|
|
- <div v-for="item in 4"
|
|
|
- style="width: 40vw;height: 40vh;margin-left: 0.5vw;margin-top: 0.5vh;position: relative;">
|
|
|
- <div
|
|
|
- style="cursor: pointer;color: #ffffff;font-size: 1.5rem;top:10px;right: 10px; position: absolute;z-index: 999;"
|
|
|
- @click="deleteVideo(item)">
|
|
|
- <i class="el-icon-close"></i>
|
|
|
- </div>
|
|
|
- <LivePlayer v-if="displayList[item - 1]" :videoUrl="videoList[item - 1]" fluent autoplay live stretch
|
|
|
- style="width:100%;height:100%;">
|
|
|
- </LivePlayer>
|
|
|
+ <div v-for="item in 4"style="width: 37vw;margin-left: 1vw;margin-top: 2vh;position: relative;">
|
|
|
+ <aliplayer :ref="'videoObj'+item" style="width: 37vw;height: 40vh;"></aliplayer>
|
|
|
+ <!-- <LivePlayer v-if="displayList[item - 1]" :videoUrl="videoList[item - 1]" fluent autoplay live stretch :timeout=3
|
|
|
+ style="width: 37vw;">
|
|
|
+ </LivePlayer> -->
|
|
|
</div>
|
|
|
<!-- <div style="width: 35vw;margin-left:1vw" class='video_content' v-for="(item, index) in 4">
|
|
|
<liveqing :videoElementId="videoId+index" style="width:40vw;height: 40vh;"></liveqing>
|
|
|
</div> -->
|
|
|
</div>
|
|
|
<div style="width: 100%;display: flex;flex-direction: row;flex-wrap: wrap;" v-if="form.type == '九宫格'">
|
|
|
- <div v-for="item in 9"
|
|
|
- style="width: 26vw;height: 26vh;margin-left: 0.5vw;margin-top: 0.5vh;position: relative;">
|
|
|
- <div
|
|
|
- style="cursor: pointer;color: #ffffff;font-size: 1.5rem;top:10px;right: 10px; position: absolute;z-index: 999;"
|
|
|
- @click="deleteVideo(item)">
|
|
|
- <i class="el-icon-close"></i>
|
|
|
- </div>
|
|
|
- <LivePlayer v-if="displayList[item - 1]" :videoUrl="videoList[item - 1]" fluent autoplay live stretch
|
|
|
- style="width:100%;height:100%;">
|
|
|
- </LivePlayer>
|
|
|
+ <div v-for="item in 9"style="width: 26vw;margin-left: 1vw;margin-top: 2vh;position: relative;">
|
|
|
+ <aliplayer :ref="'videoObj'+item" style="width: 26vw;height: 26vh;"></aliplayer>
|
|
|
+ <!-- <LivePlayer v-if="displayList[item - 1]" :videoUrl="videoList[item - 1]" fluent autoplay live stretch :timeout=3
|
|
|
+ style="width: 37vw;">
|
|
|
+ </LivePlayer> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -86,6 +83,8 @@ import LivePlayer from '@liveqing/liveplayer' // vue2
|
|
|
|
|
|
import liveqing from "@/components/livePlayer.vue";
|
|
|
|
|
|
+import aliplayer from "../../../components/AliVideo/index.vue";
|
|
|
+
|
|
|
let player;
|
|
|
export default {
|
|
|
data() {
|
|
@@ -95,7 +94,7 @@ export default {
|
|
|
videoList: [
|
|
|
|
|
|
],
|
|
|
- form: { type: '四宫格' },
|
|
|
+ form: { type: '单视频' },
|
|
|
timer: null,
|
|
|
itemName: "视频监测",
|
|
|
videoMap: new Map(),
|
|
@@ -120,9 +119,9 @@ export default {
|
|
|
videoData: [],
|
|
|
videoCodeList: [],
|
|
|
isvideo: true,
|
|
|
+ videoIndex:1,
|
|
|
// videoMap:new Map(),
|
|
|
expandedKeys: [],
|
|
|
- videoIndex: 1,
|
|
|
currentindexNew: 2,
|
|
|
remarkName: false,
|
|
|
data: [
|
|
@@ -203,7 +202,8 @@ export default {
|
|
|
videodiv,
|
|
|
headerdiv,
|
|
|
liveqing,
|
|
|
- LivePlayer
|
|
|
+ LivePlayer,
|
|
|
+ aliplayer
|
|
|
},
|
|
|
watch: {
|
|
|
filterText(val) {
|
|
@@ -219,9 +219,9 @@ export default {
|
|
|
created() {
|
|
|
this.getvideo();
|
|
|
var that = this
|
|
|
- this.timer = setInterval(() => {
|
|
|
- that.initVideoList();
|
|
|
- }, 60000);
|
|
|
+ // this.timer = setInterval(() => {
|
|
|
+ // that.initVideoList();
|
|
|
+ // }, 10000);
|
|
|
},
|
|
|
|
|
|
mounted() {
|
|
@@ -239,6 +239,10 @@ export default {
|
|
|
// closevideo();
|
|
|
},
|
|
|
methods: {
|
|
|
+ changeVideoData(){
|
|
|
+ this.videoIndex = 1;
|
|
|
+ console.log(this.videoIndex)
|
|
|
+ },
|
|
|
selectVideo(item) {
|
|
|
},
|
|
|
addVideo() {
|
|
@@ -375,7 +379,7 @@ export default {
|
|
|
return data.label.indexOf(value) !== -1;
|
|
|
},
|
|
|
deleteVideo(item) {
|
|
|
- this.videoCodeList.splice(item - 1,1);
|
|
|
+ this.videoCodeList.splice(item - 1, 1);
|
|
|
this.videoList.splice(item - 1, 1);
|
|
|
},
|
|
|
initVideoList() {
|
|
@@ -391,47 +395,35 @@ export default {
|
|
|
var url = videoData.data.url
|
|
|
url = url.replace('http://2.90.220.252:83', 'https://qd.liaochengde.com:9001');
|
|
|
console.log(url)
|
|
|
+ // url = 'https://yunqivedio.alicdn.com/2017yq/v2/0x0/96d79d3f5400514a6883869399708e11/96d79d3f5400514a6883869399708e11.m3u8'
|
|
|
// console.log(window.location.host+window.location.port)
|
|
|
- this.videoList.push(url);
|
|
|
+ // url = url.replace('http://2.90.220.252:83', 'https://qd.liaochengde.com:9001');
|
|
|
+ this.$refs.videoObj.setVideoData(url);
|
|
|
+ // this.videoList.push(url);
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
treeChange(data, node) {
|
|
|
var arry = this.$refs.tree.getCheckedNodes();
|
|
|
if (data.cameraIndexCode != null) {
|
|
|
- this.hlsParams.params =
|
|
|
- '{"httpMethod":"POST","path":"/api/video/v1/cameras/previewURLs","headers":{},"query":{},"parameter":{},"body":{"streamType":0,"protocol":"hls","transmode":0,"expand":"transcode=0","cameraIndexCode": "' +
|
|
|
- data.cameraIndexCode +
|
|
|
- '"},"contentType":"application/json;charset=UTF-8","mock":false,"appKey":"27794545","appSecret":"5Xi27Gl7JrbHHF1MpdaB"}';
|
|
|
- httpRequest(this.hlsParams).then((res) => {
|
|
|
- var videoData = JSON.parse(res.data);
|
|
|
- var dataList = [];
|
|
|
+ if (this.form.type == '单视频') {
|
|
|
+ this.$refs.videoObj.getHlsUrl(data)
|
|
|
+ }
|
|
|
if (this.form.type == '四宫格') {
|
|
|
- if (this.videoList.length < 4) {
|
|
|
- var url = 'https://yunqivedio.alicdn.com/2017yq/v2/0x0/96d79d3f5400514a6883869399708e11/96d79d3f5400514a6883869399708e11.m3u8'
|
|
|
- // var url = videoData.data.url
|
|
|
- // this.videoCodeList.push(data.cameraIndexCode);
|
|
|
- // console.log(this.videoCodeList)
|
|
|
- // url = url.replace('http://2.90.220.252:83', 'https://qd.liaochengde.com:9001');
|
|
|
- // // console.log(window.location.host+window.location.port)
|
|
|
- // console.log(url)
|
|
|
- this.videoList.push(url);
|
|
|
- } else {
|
|
|
- this.$message('摄像机已满');
|
|
|
- }
|
|
|
+ this.$refs[`videoObj${this.videoIndex}`][0].getHlsUrl(data)
|
|
|
+ if(this.videoIndex < 4){
|
|
|
+ this.videoIndex++;
|
|
|
+ }else{
|
|
|
+ this.videoIndex = 1;
|
|
|
+ }
|
|
|
} else if (this.form.type == '九宫格') {
|
|
|
- if (this.videoList.length < 9) {
|
|
|
- // var url = 'https://yunqivedio.alicdn.com/2017yq/v2/0x0/96d79d3f5400514a6883869399708e11/96d79d3f5400514a6883869399708e11.m3u8'
|
|
|
- var url = videoData.data.url
|
|
|
- this.videoCodeList.push(data.cameraIndexCode);
|
|
|
- url = url.replace('http://2.90.220.252:83', 'https://qd.liaochengde.com:9001');
|
|
|
- // console.log(window.location.host+window.location.port)
|
|
|
- this.videoList.push(url);
|
|
|
- } else {
|
|
|
- this.$message('摄像机已满');
|
|
|
- }
|
|
|
+ this.$refs[`videoObj${this.videoIndex}`][0].getHlsUrl(data)
|
|
|
+ if(this.videoIndex < 8){
|
|
|
+ this.videoIndex++;
|
|
|
+ }else{
|
|
|
+ this.videoIndex = 1;
|
|
|
+ }
|
|
|
}
|
|
|
- })
|
|
|
}
|
|
|
|
|
|
// if (data.cameraIndexCode != null) {
|