自动播放视频
This commit is contained in:
@@ -2,12 +2,14 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import router from '@/routers'
|
||||
import type { DetectionLockHolder } from '@/stores/modules/detectionLock'
|
||||
import mittBus, { STOP_DETECTION_TIMER_EVENT } from '@/utils/mittBus'
|
||||
import { requestResourceManageAutoplayFirst } from '@/utils/resourceManageAutoplay'
|
||||
|
||||
const stopDetectionTimer = () => {
|
||||
mittBus.emit(STOP_DETECTION_TIMER_EVENT)
|
||||
}
|
||||
|
||||
const goResourceManage = async () => {
|
||||
requestResourceManageAutoplayFirst()
|
||||
if (router.hasRoute('resourceManage')) {
|
||||
await router.push({ name: 'resourceManage' })
|
||||
return
|
||||
|
||||
11
frontend/src/utils/resourceManageAutoplay.ts
Normal file
11
frontend/src/utils/resourceManageAutoplay.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
let shouldAutoplayFirstVideo = false
|
||||
|
||||
export const requestResourceManageAutoplayFirst = () => {
|
||||
shouldAutoplayFirstVideo = true
|
||||
}
|
||||
|
||||
export const consumeResourceManageAutoplayFirst = () => {
|
||||
if (!shouldAutoplayFirstVideo) return false
|
||||
shouldAutoplayFirstVideo = false
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user