mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-22 13:21:20 -08:00
refactor: update event handling in plugins and core
- Changed event handling from `art.proxy` to `art.on` for visibility change and pointer events in the ads and danmuku plugins to improve consistency and maintainability. - Bumped version of the danmuku plugin from 5.1.8 to 5.1.9. - Added pointer events to the global event initialization in the core to ensure proper event handling across the application.
This commit is contained in:
1 parent
e834246641
commit
fa0961a9f9
16 files changed
+22
-19
No files matched your search
@@ -260,7 +260,7 @@ export default function artplayerPluginAds(option) {
|
||||
setStyle($loading, 'display', 'none')
|
||||
}
|
||||
|
||||
art.proxy(document, 'visibilitychange', () => {
|
||||
art.on('document:visibilitychange', () => {
|
||||
if (document.hidden) {
|
||||
pause()
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "artplayer-plugin-danmuku",
|
||||
"version": "5.1.8",
|
||||
"version": "5.1.9",
|
||||
"description": "Danmuku plugin for ArtPlayer",
|
||||
"author": "Harvey Zack <laozhaochaguan@gmail.com>",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -565,13 +565,13 @@ export default class Setting {
|
||||
isDroging = event.button === 0
|
||||
})
|
||||
|
||||
this.art.proxy(document, 'pointermove', (event) => {
|
||||
this.art.on('document:pointermove', (event) => {
|
||||
if (isDroging) {
|
||||
updateLeft.call(this, event)
|
||||
}
|
||||
})
|
||||
|
||||
this.art.proxy(document, 'pointerup', (event) => {
|
||||
this.art.on('document:pointerup', (event) => {
|
||||
if (isDroging) {
|
||||
isDroging = false
|
||||
updateLeft.call(this, event)
|
||||
|
||||
@@ -6,7 +6,10 @@ export default function globalInit(art, events) {
|
||||
'touchend',
|
||||
'touchmove',
|
||||
'mousemove',
|
||||
'pointerup',
|
||||
'contextmenu',
|
||||
'pointermove',
|
||||
'visibilitychange',
|
||||
'webkitfullscreenchange',
|
||||
]
|
||||
|
||||
|
||||
Reference in new issue
Block a user