Update cwPlay.vue
This commit is contained in:
parent
bbeeda0333
commit
223a8b5e00
|
@ -4,13 +4,13 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import api from '@/axios'
|
import api from '@/axios'
|
||||||
import { Ref, ref, watch, onMounted, onBeforeMount, onBeforeUnmount, reactive } from 'vue'
|
import {ref, onMounted, onBeforeUnmount} from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import {useRouter} from 'vue-router'
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
let date = {
|
let date = {
|
||||||
pointId: router.currentRoute.value.query.pointId,
|
pointId: router.currentRoute.value.query.pointId
|
||||||
}
|
}
|
||||||
const player = ref<any>(null)
|
const player = ref<any>(null)
|
||||||
// console.log(player.value)
|
// console.log(player.value)
|
||||||
|
@ -21,6 +21,7 @@ onMounted(() => {
|
||||||
// console.log(Player)
|
// console.log(Player)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// @ts-ignore
|
||||||
player.value = new Player(document.getElementById('playerBox'))
|
player.value = new Player(document.getElementById('playerBox'))
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
|
@ -31,10 +32,10 @@ onMounted(() => {
|
||||||
// var playUrl = 'http://192.168.1.201:7000/stream/ZY7y3ZJJWJe_j_jXYjWQLkB3?app=out&token=BitKDx--E7E'
|
// var playUrl = 'http://192.168.1.201:7000/stream/ZY7y3ZJJWJe_j_jXYjWQLkB3?app=out&token=BitKDx--E7E'
|
||||||
// player.play(playUrl, true, '')
|
// player.play(playUrl, true, '')
|
||||||
|
|
||||||
api.post('/multialarm/video/preview', { ...date }).then((res) => {
|
api.post('/multialarm/video/preview', {...date}).then((res: any) => {
|
||||||
console.log('🚀 ~ /multialarm/video/preview:', res)
|
console.log('🚀 ~ /multialarm/video/preview:', res)
|
||||||
console.log(res.data.videoUrl)
|
console.log(res.data.videoUrl)
|
||||||
|
// @ts-ignore
|
||||||
player.play(res.data.videoUrl, true, '')
|
player.play(res.data.videoUrl, true, '')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue