Fix: dynamic expire id

This commit is contained in:
zijiren233 2024-05-10 10:07:54 +08:00
parent ef9c380edb
commit 54d2e7a9c8
2 changed files with 5 additions and 3 deletions

View File

@ -78,7 +78,7 @@ const newSyncControl = (art: Artplayer, publishStatus: (msg: ElementMessage) =>
export const newSyncPlugin = (
publishStatus: (msg: ElementMessage) => boolean,
dynamicStatus: MovieStatus,
expireId: number
dynamicExpireId: () => number
) => {
return (art: Artplayer): syncPlugin => {
const playingStatusDebounce = debounces(debounceTime);
@ -196,7 +196,7 @@ export const newSyncPlugin = (
seek: art.currentTime,
rate: art.playbackRate
},
expireId
expireId: dynamicExpireId()
}
})
);

View File

@ -195,7 +195,9 @@ const newLazyInitSyncPlugin = () => {
return async (art: Artplayer) => {
console.log("加载进度同步插件中...");
const sync = await syncP;
art.plugins.add(sync.newSyncPlugin(sendElement, room.currentStatus, room.currentExpireId));
art.plugins.add(
sync.newSyncPlugin(sendElement, room.currentStatus, () => room.currentExpireId)
);
};
};