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