refactor: improve document Picture-in-Picture support checks and update type definitions

- Renamed variable `dpipOK` to `isSupported` for clarity in checking Document Picture-in-Picture support.
- Updated the `open` function to use the new `isSupported` variable.
- Removed redundant checks in the `close` function related to Document Picture-in-Picture support.
- Added `isSupported` and `isActive` properties to the plugin's result interface in TypeScript definitions.
- Cleaned up the code for better readability and maintainability.
This commit is contained in:
Harvey Zack committed 2025-08-16 17:00:01 +08:00
1 parent a7d77f4f70
commit 657dd7e77c
13 files changed
+25 -38

No files matched your search

+2 -7
View File
@@ -7,16 +7,11 @@ interface Option {
interface Result {
name: 'artplayerPluginDocumentPip'
isSupported: boolean
isActive: boolean
open: () => void
close: () => void
toggle: () => void
state: {
win: Window | null
originalParent: Element | null
originalNext: Element | null
currentDoc: Document | null
placeholder: Element | null
}
}
declare const artplayerPluginDocumentPip: (option: Option) => (art: Artplayer) => Result