feat: Refactor global event handling in ArtPlayer

- Introduced a new globalInit function to manage document and window events.
- Replaced direct event proxies with a unified bindGlobalEvents method.
- Updated event handling in various modules to utilize the new global event system.
- Removed the deprecated documentInit module.
- Bumped version to 5.2.6 in package.json.
This commit is contained in:
Harvey Zack committed 2025-08-16 20:45:19 +08:00
1 parent abd64e11f2
commit 8af6f7c322
18 files changed
+142 -62

No files matched your search

@@ -256,6 +256,7 @@ function artplayerPluginDocumentPip(userOptions = {}) {
pipWin.removeEventListener('unload', onClose);
};
addClass($player, 'artplayer-document-pip');
art.events.bindGlobalEvents?.();
art.emit('document-pip', true);
} catch (err) {
art.notice.show = 'Document Picture-in-Picture open failed';
@@ -279,6 +280,7 @@ function artplayerPluginDocumentPip(userOptions = {}) {
state.win.close();
state.win = null;
removeClass($player, 'artplayer-document-pip');
art.events.bindGlobalEvents?.();
art.emit('document-pip', false);
} catch (err) {
art.notice.show = 'Document Picture-in-Picture close failed';