mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-16 09:36:16 -08:00
- Implemented the core functionality of the Document Picture-in-Picture plugin. - Created main plugin file `artplayer-plugin-document-pip.js` with support for opening and closing the PIP window. - Added legacy support in `artplayer-plugin-document-pip.legacy.js`. - Defined plugin options in `package.json` and included necessary metadata. - Developed the main logic in `src/index.js`, including style copying and event handling. - Created TypeScript definitions in `types/artplayer-plugin-document-pip.d.ts` for better type safety.
27 lines
617 B
TypeScript
27 lines
617 B
TypeScript
interface Option {
|
|
width?: number
|
|
height?: number
|
|
placeholder?: string
|
|
fallbackToVideoPiP?: boolean
|
|
}
|
|
|
|
interface Result {
|
|
name: 'artplayerPluginDocumentPip'
|
|
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
|
|
|
|
export default artplayerPluginDocumentPip
|
|
|
|
export = artplayerPluginDocumentPip;
|
|
export as namespace artplayerPluginDocumentPip; |