fix(intersection,default-mode): fix entry blocking ComponentsLoaded

This commit is contained in:
ChsBuffer 2022-08-27 11:12:43 +08:00
parent f3fee6f534
commit da04b99553
2 changed files with 140 additions and 136 deletions

View File

@ -22,6 +22,7 @@ const entry: ComponentEntry = async ({ settings: { options } }) => {
} = playerAgent
await playerReady()
Promise.resolve().then(async () => {
const actions: Map<PlayerModes, () => void | Promise<void>> = new Map([
[PlayerModes.Normal, none],
[PlayerModes.Wide, async () => {
@ -64,6 +65,7 @@ const entry: ComponentEntry = async ({ settings: { options } }) => {
} else {
action()
}
})
}
export const component: ComponentMetadata = {
name: 'defaultPlayerMode',

View File

@ -25,6 +25,7 @@ export const component: ComponentMetadata = {
pause: boolean
light: boolean
}
Promise.resolve().then(async () => {
const { query: { video } } = playerAgent
const videoEl = await video.element() as HTMLVideoElement
@ -128,6 +129,7 @@ export const component: ComponentMetadata = {
observer = createObserver()
mountPlayListener()
})
},
displayName: '播放器位置动作',
description: {