forked from github/dataease
refactor(仪表板): 优化流媒体播放,解决编辑时初次设置直播地址没有及时播放问题
This commit is contained in:
parent
3ebcd4ccd6
commit
b6a3e3864d
@ -21,7 +21,7 @@
|
||||
<script lang="ts" setup>
|
||||
import flvjs from 'flv.js'
|
||||
import '@/style/custom-theme.css'
|
||||
import { onMounted, reactive, toRefs, getCurrentInstance } from 'vue'
|
||||
import { onMounted, reactive, toRefs, getCurrentInstance, watch, nextTick } from 'vue'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
const { t } = useI18n()
|
||||
@ -75,6 +75,17 @@ onMounted(() => {
|
||||
initOption()
|
||||
})
|
||||
|
||||
watch(
|
||||
() => element.value.streamMediaLinks,
|
||||
() => {
|
||||
destroyPlayer()
|
||||
nextTick(() => {
|
||||
state.pOption = element.value.streamMediaLinks[element.value.streamMediaLinks.videoType]
|
||||
initOption()
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
const initOption = () => {
|
||||
if (flvjs.isSupported() && state.pOption.url) {
|
||||
destroyPlayer()
|
||||
|
Loading…
Reference in New Issue
Block a user