mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-22 21:31:20 -08:00
feat: 添加 Document Picture-in-Picture 插件样式支持
This commit is contained in:
1 parent
596269bf3f
commit
1f142ced9f
12 files changed
+52
-10
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import style from 'bundle-text:./style.less'
|
||||
|
||||
export default function artplayerPluginDocumentPip(userOptions = {}) {
|
||||
const options = {
|
||||
width: 480,
|
||||
@@ -188,3 +190,21 @@ export default function artplayerPluginDocumentPip(userOptions = {}) {
|
||||
if (typeof window !== 'undefined') {
|
||||
window.artplayerPluginDocumentPip = artplayerPluginDocumentPip
|
||||
}
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
const id = 'artplayer-plugin-document-pip'
|
||||
let $style = document.getElementById(id)
|
||||
if (!$style) {
|
||||
$style = document.createElement('style')
|
||||
$style.id = id
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
document.head.appendChild($style)
|
||||
})
|
||||
}
|
||||
else {
|
||||
(document.head || document.documentElement).appendChild($style)
|
||||
}
|
||||
}
|
||||
$style.textContent = style
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
.art-video-player{
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
Reference in new issue
Block a user