mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 19:06:15 -08:00
- Introduced `artplayer-plugin-pip` to enable Picture-in-Picture functionality. - Updated `artplayer.d.ts` to export new types related to the plugin. - Added example usage of the plugin in `pip.js`. - Created TypeScript definitions for the plugin in `artplayer-plugin-pip.d.ts`. - Implemented the plugin logic in `index.js` with necessary styles and event handling. - Updated documentation to include the new plugin and its usage. - Added README and package.json for the new plugin.
19 lines
425 B
JavaScript
19 lines
425 B
JavaScript
// npm i artplayer-plugin-pip
|
|
// import artplayerPluginPip from 'artplayer-plugin-pip';
|
|
|
|
let art = new Artplayer({
|
|
container: '.artplayer-app',
|
|
url: '/assets/sample/video.mp4',
|
|
plugins: [
|
|
artplayerPluginPip({
|
|
width: 480,
|
|
height: 270,
|
|
placeholder: `Playing in Document Picture-in-Picture`,
|
|
}),
|
|
],
|
|
})
|
|
|
|
art.on('document-pip', (state) => {
|
|
console.log('Document Picture-in-Picture', state)
|
|
})
|