|
@@ -13,15 +13,16 @@
|
|
|
<el-col>
|
|
|
<!-- <img src="../../../assets/image-af/test1.png" alt="" class="videoBox"> -->
|
|
|
|
|
|
- <video id="myVideo" class="video-js videoBox" controls preload="auto" data-setup='{}' style='width: 100%;height: 100%'>
|
|
|
- <source id="source" src="http://172.16.120.243:10008/record/test/20210730/out.m3u8" type="application/x-mpegURL"/>
|
|
|
- </video>
|
|
|
+ <video id="myVideo" class="video-js videoBox" controls preload="auto" data-setup='{}' style='width: 100%;height: 100%' v-if="resList[0]">
|
|
|
+ <source id="source" :src="resList[0] && resList[0].url || ''" type="application/x-mpegURL"/>
|
|
|
+ </video>
|
|
|
+ <img src="../../../assets/image-af/red.png" alt="" class="redImage" v-else>
|
|
|
</el-col>
|
|
|
<el-col>
|
|
|
- <video id="myVideo2" class="video-js videoBox" controls preload="auto" data-setup='{}' style='width: 100%;height: 100%'>
|
|
|
- <source id="source" src="http://172.16.120.243:10008/record/test/20210730/out.m3u8" type="application/x-mpegURL"/>
|
|
|
+ <video id="myVideo2" class="video-js videoBox" controls preload="auto" data-setup='{}' style='width: 100%;height: 100%' v-if="resList[1]">
|
|
|
+ <source id="source" :src="resList[1] && resList[1].url || ''" type="application/x-mpegURL"/>
|
|
|
</video>
|
|
|
- <img src="../../../assets/image-af/red.png" alt="" class="redImage">
|
|
|
+ <img src="../../../assets/image-af/red.png" alt="" class="redImage" v-else>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</template>
|
|
@@ -35,30 +36,46 @@ export default {
|
|
|
data(){
|
|
|
return{
|
|
|
myVideo:null,
|
|
|
- myVideo2:null
|
|
|
+ myVideo2:null,
|
|
|
+ resList:[]
|
|
|
}
|
|
|
},
|
|
|
mounted(){
|
|
|
- this.videoPlay()
|
|
|
+ this.getData()
|
|
|
},
|
|
|
methods:{
|
|
|
videoPlay(){
|
|
|
// videojs 简单使用
|
|
|
- this.myVideo = videojs('myVideo', {
|
|
|
- bigPlayButton: false,
|
|
|
- textTrackDisplay: false,
|
|
|
- posterImage: false,
|
|
|
- errorDisplay: false,
|
|
|
- })
|
|
|
- this.myVideo.play()// 视频播放
|
|
|
- // videojs 简单使用
|
|
|
- this.myVideo2 = videojs('myVideo2', {
|
|
|
- bigPlayButton: false,
|
|
|
- textTrackDisplay: false,
|
|
|
- posterImage: false,
|
|
|
- errorDisplay: false,
|
|
|
- })
|
|
|
- this.myVideo2.play()// 视频播放
|
|
|
+ if(this.resList[0]){
|
|
|
+ this.myVideo = videojs('myVideo', {
|
|
|
+ bigPlayButton: false,
|
|
|
+ textTrackDisplay: false,
|
|
|
+ posterImage: false,
|
|
|
+ errorDisplay: false,
|
|
|
+ })
|
|
|
+ console.log(this.myVideo)
|
|
|
+ this.myVideo.play()// 视频播放
|
|
|
+ }
|
|
|
+ if(this.resList[1]){
|
|
|
+ this.myVideo2 = videojs('myVideo2', {
|
|
|
+ bigPlayButton: false,
|
|
|
+ textTrackDisplay: false,
|
|
|
+ posterImage: false,
|
|
|
+ errorDisplay: false,
|
|
|
+ })
|
|
|
+ this.myVideo2.play()// 视频播放
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async getData(){
|
|
|
+ let res = await this.$axios.get('/AFTop/querySystemUrl?'+this.$qs.stringify({
|
|
|
+ type: 1
|
|
|
+ }))
|
|
|
+ if(res.success){
|
|
|
+ this.resList = res.data.slice(0,2)
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.videoPlay()
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|