视频完成
This commit is contained in:
parent
be129457d6
commit
15d188886a
@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="video">
|
<div class="video">
|
||||||
<video :id=" 'a' + time" style="width:100%;height:100%"></video>
|
<video v-if="isvideo" :id=" 'a' + time" style="width:100%;height:100%"></video>
|
||||||
|
<img v-else :src="info.img" style="width:100%;height:100%" alt="">
|
||||||
<div class="liveinfo">
|
<div class="liveinfo">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<div>
|
<div>
|
||||||
@ -90,7 +91,7 @@
|
|||||||
import { livestart } from '@/api';
|
import { livestart } from '@/api';
|
||||||
import router from '@/router';
|
import router from '@/router';
|
||||||
import { useI18n } from '@/utils/i18n';
|
import { useI18n } from '@/utils/i18n';
|
||||||
import { defineComponent, onUpdated, ref } from "vue";
|
import { defineComponent, onUpdated, ref, watch } from "vue";
|
||||||
import { onBeforeRouteLeave } from 'vue-router';
|
import { onBeforeRouteLeave } from 'vue-router';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
@ -116,19 +117,28 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
const time = ref(new Date().getTime())
|
const time = ref(new Date().getTime())
|
||||||
let play: any;
|
let play: any;
|
||||||
onUpdated(()=>{
|
const isvideo = ref(true);
|
||||||
// console.log(props.url)
|
|
||||||
if(props.info){
|
watch(()=> props.info,()=>{
|
||||||
play = window.TCPlayer('a' + time.value, {
|
if(props.info){
|
||||||
fileID: (props.info.livestatus == 0 ? props.info.fileid : props.info.vodid),
|
console.log(props.info)
|
||||||
appID: '1303872925'
|
|
||||||
});
|
if(props.info.fileid != '0' || props.info.vodid != ''){
|
||||||
|
play = window.TCPlayer('a' + time.value, {
|
||||||
|
fileID: (props.info.livestatus == 0 ? props.info.fileid : props.info.vodid),
|
||||||
|
appID: '1303872925'
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
isvideo.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
onBeforeRouteLeave((to, from, next) => {
|
onBeforeRouteLeave((to, from, next) => {
|
||||||
console.log(121)
|
console.log(121)
|
||||||
play.dispose()
|
if(play){
|
||||||
|
play.dispose()
|
||||||
|
}
|
||||||
next()
|
next()
|
||||||
})
|
})
|
||||||
// const liveinfo = ref(props.liveinfo)
|
// const liveinfo = ref(props.liveinfo)
|
||||||
@ -136,7 +146,8 @@ export default defineComponent({
|
|||||||
bianji,
|
bianji,
|
||||||
kaishi,
|
kaishi,
|
||||||
lan,
|
lan,
|
||||||
time
|
time,
|
||||||
|
isvideo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user