点击显示录像信息:
效果图:
代码实现:
<template>
<el-button type="text" @click="lookExamVideo(scope.row)" >查看考试录像</el-button>
<el-dialog title="查看考试录像"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="videoDialog"
width="550px" style="text-align:center;margin-top:70px;"
>
<video width="500" v-if="videoDialog" :id="tcPlayerId" height="270" class="tc-video-container" playsinline webkit-playinline x5-playinline></video>
</el-dialog>
</template>
<script>
export default{
name:'Detail'
}
data(){
return{
tcPlayerId: 'tcPlayer' + Date.now(),
player: null,
videoFileid: '',
videoAppid: '',
videoDialog:false,
}
},
methods:{
getVideoLang (fileID, appID) {
const playerParam = {
fileID: fileID,
appID: appID
}
this.player = window.TCPlayer(this.tcPlayerId, playerParam)
},
lookExamVideo(row){
this.videoDialog=true
let self = this
setTimeout(() => {
self.videoFileid = 'xxx'
self.videoAppid = 'xxx'
self.$nextTick(() => {
self.getVideoLang(self.videoFileid, self.videoAppid)
})
},100)
},
}
</script>