fix(iframe): [PKG-IFRAME-05] checkpoint player and editor integration

This commit is contained in:
Harvey Zhao committed 2026-09-13 02:17:44 +08:00
1 parent 047e2df945
commit b35183c7af
15 files changed
+2547 -14

No files matched your search

+8
View File
@@ -15,6 +15,11 @@ const iframe = new ArtplayerToolIframe({
url: '/iframe.html',
})
window.addEventListener('artplayer:example:cleanup', () => {
iframe.destroy()
$iframe.remove()
}, { once: true })
iframe.message(({ type, data }) => {
switch (type) {
case 'fullscreenWeb':
@@ -44,4 +49,7 @@ iframe.commit(() => {
data: state,
})
})
}).catch((error) => {
if (!iframe.destroyed)
console.error(error)
})