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
@@ -5,5 +5,5 @@
* (c) 2017-2025 Harvey Zack
* Released under the MIT License.
*/
!function(e,t,n,r,i,o,l,d){var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},a="function"==typeof c[r]&&c[r],u=a.i||{},p=a.cache||{},f="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function s(t,n){if(!p[t]){if(!e[t]){if(i[t])return i[t];var o="function"==typeof c[r]&&c[r];if(!n&&o)return o(t,!0);if(a)return a(t,!0);if(f&&"string"==typeof t)return f(t);var l=Error("Cannot find module '"+t+"'");throw l.code="MODULE_NOT_FOUND",l}u.resolve=function(n){var r=e[t][1][n];return null!=r?r:n},u.cache={};var d=p[t]=new s.Module(t);e[t][0].call(d.exports,u,d,d.exports,c)}return p[t].exports;function u(e){var t=u.resolve(e);return!1===t?{}:s(t)}}s.isParcelRequire=!0,s.Module=function(e){this.id=e,this.bundle=s,this.require=f,this.exports={}},s.modules=e,s.cache=p,s.parent=a,s.distDir=void 0,s.publicUrl=void 0,s.devServer=void 0,s.i=u,s.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(s,"root",{get:function(){return c[r]}}),c[r]=s;for(var h=0;h<t.length;h++)s(t[h]);if(n){var m=s(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=m:"function"==typeof define&&define.amd&&define(function(){return m})}}({bKI9O:[function(e,t,n,r){var i=e("@parcel/transformer-js/src/esmodule-helpers.js");function o(e={}){let t={width:480,height:270,fallbackToVideoPiP:!0,placeholder:"Playing in Document Picture-in-Picture",...e};return e=>{let n="documentPictureInPicture"in window&&"function"==typeof window.documentPictureInPicture?.requestWindow,{proxy:r,icons:i,i18n:o,template:{$container:l},constructor:{utils:{append:d,tooltip:c,addClass:a,removeClass:u}}}=e,p={win:null,originalParent:null,originalNext:null,currentDoc:null,placeholder:null};async function f(){if(!n&&t.fallbackToVideoPiP){e.pip=!0,console.warn("[artplayer-plugin-document-pip] Document Picture-in-Picture is not supported, falling back to Video Picture-in-Picture");return}if(!p.win)try{let n=await window.documentPictureInPicture.requestWindow({width:t.width,height:t.height});p.win=n,p.currentDoc=n.document,p.placeholder=document.createElement("div"),p.placeholder.className="artplayer-pip-placeholder",p.placeholder.style.cssText="display:flex;justify-content:center;align-items:center;width:100%;height:100%;",p.placeholder.textContent=t.placeholder,p.originalParent=l.parentNode,p.originalNext=l.nextSibling,p.originalParent.insertBefore(p.placeholder,p.originalNext);let i=n.document.createElement("div");i.id="__art_dpip_root",n.document.body.appendChild(i);var r=n.document;let o=r.createElement("style");if(o.textContent=` html, body { margin:0; padding:0; width:100%; height:100%; background:#000; overflow:hidden; } #__art_dpip_root { position:absolute; inset:0; display:flex; } #__art_dpip_root > * { width:100% !important; height:100% !important; } `,r.head.appendChild(o),!r.querySelector('meta[name="viewport"]')){let e=r.createElement("meta");e.name="viewport",e.content="width=device-width,initial-scale=1",r.head.appendChild(e)}try{document.querySelectorAll('link[rel="stylesheet"]').forEach(e=>{let t=r.createElement("link");t.rel="stylesheet",t.href=e.href,e.media&&(t.media=e.media),e.crossOrigin&&(t.crossOrigin=e.crossOrigin),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),r.head.appendChild(t)})}catch{}try{document.querySelectorAll("style").forEach(e=>{let t=r.createElement("style");t.textContent=e.textContent,r.head.appendChild(t)})}catch{}let d=n.document.adoptNode(l);i.appendChild(d),p.currentDoc=n.document;let c=()=>e.resize?.(),u=()=>s();n.addEventListener("resize",c),n.addEventListener("pagehide",u),n.addEventListener("unload",u),p.cleanup=()=>{n.removeEventListener("resize",c),n.removeEventListener("pagehide",u),n.removeEventListener("unload",u)},a(l,"artplayer-document-pip"),e.emit("document-pip",!0)}catch(t){e.notice.show="Document Picture-in-Picture open failed",console.warn("[artplayer-plugin-document-pip] open failed:",t)}}function s(){if(!n&&t.fallbackToVideoPiP){e.pip=!1;return}if(p.win)try{p.cleanup?.(),function(){if(!p.placeholder)return;let e=p.placeholder.ownerDocument||document,t=e.adoptNode(l);p.originalParent.insertBefore(t,p.placeholder),p.placeholder.remove(),p.placeholder=null,p.currentDoc=e}(),p.win.close(),p.win=null,u(l,"artplayer-document-pip"),e.emit("document-pip",!1)}catch(t){e.notice.show="Document Picture-in-Picture close failed",console.warn("[artplayer-plugin-document-pip] close failed:",t)}}function h(){p.win?s():f()}return e.controls.add({name:"document-pip",position:"right",index:40,tooltip:e.i18n.get("PIP Mode"),mounted:t=>{d(t,i.pip),r(t,"click",h),e.on("document-pip",e=>{c(t,o.get(e?"Exit PIP Mode":"PIP Mode"))})}}),e.on("destroy",s),{name:"artplayerPluginDocumentPip",state:p,open:f,close:s,toggle:h}}}i.defineInteropFlag(n),i.export(n,"default",()=>o),"undefined"!=typeof window&&(window.artplayerPluginDocumentPip=o)},{"@parcel/transformLine truncated
!function(e,t,n,r,i,o,l,d){var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},u="function"==typeof c[r]&&c[r],a=u.i||{},p=u.cache||{},f="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function s(t,n){if(!p[t]){if(!e[t]){if(i[t])return i[t];var o="function"==typeof c[r]&&c[r];if(!n&&o)return o(t,!0);if(u)return u(t,!0);if(f&&"string"==typeof t)return f(t);var l=Error("Cannot find module '"+t+"'");throw l.code="MODULE_NOT_FOUND",l}a.resolve=function(n){var r=e[t][1][n];return null!=r?r:n},a.cache={};var d=p[t]=new s.Module(t);e[t][0].call(d.exports,a,d,d.exports,c)}return p[t].exports;function a(e){var t=a.resolve(e);return!1===t?{}:s(t)}}s.isParcelRequire=!0,s.Module=function(e){this.id=e,this.bundle=s,this.require=f,this.exports={}},s.modules=e,s.cache=p,s.parent=u,s.distDir=void 0,s.publicUrl=void 0,s.devServer=void 0,s.i=a,s.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(s,"root",{get:function(){return c[r]}}),c[r]=s;for(var h=0;h<t.length;h++)s(t[h]);if(n){var m=s(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=m:"function"==typeof define&&define.amd&&define(function(){return m})}}({bKI9O:[function(e,t,n,r){var i=e("@parcel/transformer-js/src/esmodule-helpers.js");function o(e={}){let t={width:480,height:270,fallbackToVideoPiP:!0,placeholder:"Playing in Document Picture-in-Picture",...e};return e=>{let n="documentPictureInPicture"in window&&"function"==typeof window.documentPictureInPicture?.requestWindow,{proxy:r,icons:i,i18n:o,template:{$container:l},constructor:{utils:{append:d,tooltip:c,addClass:u,removeClass:a}}}=e,p={win:null,originalParent:null,originalNext:null,currentDoc:null,placeholder:null};async function f(){if(!n&&t.fallbackToVideoPiP){e.pip=!0,console.warn("[artplayer-plugin-document-pip] Document Picture-in-Picture is not supported, falling back to Video Picture-in-Picture");return}if(!p.win)try{let n=await window.documentPictureInPicture.requestWindow({width:t.width,height:t.height});p.win=n,p.currentDoc=n.document,p.placeholder=document.createElement("div"),p.placeholder.className="artplayer-pip-placeholder",p.placeholder.style.cssText="display:flex;justify-content:center;align-items:center;width:100%;height:100%;",p.placeholder.textContent=t.placeholder,p.originalParent=l.parentNode,p.originalNext=l.nextSibling,p.originalParent.insertBefore(p.placeholder,p.originalNext);let i=n.document.createElement("div");i.id="__art_dpip_root",n.document.body.appendChild(i);var r=n.document;let o=r.createElement("style");if(o.textContent=` html, body { margin:0; padding:0; width:100%; height:100%; background:#000; overflow:hidden; } #__art_dpip_root { position:absolute; inset:0; display:flex; } #__art_dpip_root > * { width:100% !important; height:100% !important; } `,r.head.appendChild(o),!r.querySelector('meta[name="viewport"]')){let e=r.createElement("meta");e.name="viewport",e.content="width=device-width,initial-scale=1",r.head.appendChild(e)}try{document.querySelectorAll('link[rel="stylesheet"]').forEach(e=>{let t=r.createElement("link");t.rel="stylesheet",t.href=e.href,e.media&&(t.media=e.media),e.crossOrigin&&(t.crossOrigin=e.crossOrigin),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),r.head.appendChild(t)})}catch{}try{document.querySelectorAll("style").forEach(e=>{let t=r.createElement("style");t.textContent=e.textContent,r.head.appendChild(t)})}catch{}let d=n.document.adoptNode(l);i.appendChild(d),p.currentDoc=n.document;let c=()=>e.resize?.(),a=()=>s();n.addEventListener("resize",c),n.addEventListener("pagehide",a),n.addEventListener("unload",a),p.cleanup=()=>{n.removeEventListener("resize",c),n.removeEventListener("pagehide",a),n.removeEventListener("unload",a)},u(l,"artplayer-document-pip"),e.emit("document-pip",!0)}catch(t){e.notice.show="Document Picture-in-Picture open failed",console.warn("[artplayer-plugin-document-pip] open failed:",t)}}function s(){if(p.win)try{p.cleanup?.(),function(){if(!p.placeholder)return;let e=p.placeholder.ownerDocument||document,t=e.adoptNode(l);p.originalParent.insertBefore(t,p.placeholder),p.placeholder.remove(),p.placeholder=null,p.currentDoc=e}(),p.win.close(),p.win=null,a(l,"artplayer-document-pip"),e.emit("document-pip",!1)}catch(t){e.notice.show="Document Picture-in-Picture close failed",console.warn("[artplayer-plugin-document-pip] close failed:",t)}}function h(){p.win?s():f()}return e.controls.add({name:"document-pip",position:"right",index:40,tooltip:e.i18n.get("PIP Mode"),mounted:t=>{d(t,i.pip),r(t,"click",h),e.on("document-pip",e=>{c(t,o.get(e?"Exit PIP Mode":"PIP Mode"))})}}),e.on("destroy",s),{name:"artplayerPluginDocumentPip",get isSupported(){return n},get isActive(){return!!p.win},open:f,close:s,toggle:h}}}i.defineInteropFlag(n),i.export(n,"default",()=>o),"undefined"!=typeof window&&(window.artplayerPluginDocumentPip=o)},{"@parcel/tranLine truncated
//# sourceMappingURL=artplayer-plugin-document-pip.esm.js.map
@@ -1 +1 @@
{"mappings":"C,A,S,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,E,I,E,A,a,O,W,W,A,a,O,K,K,A,a,O,O,O,A,a,O,O,O,C,E,E,A,Y,O,C,C,E,E,C,C,E,C,E,E,C,E,C,E,E,E,K,E,C,E,E,A,a,O,Q,A,Y,O,O,O,E,O,O,C,I,C,Q,S,E,C,C,C,E,G,C,C,C,E,C,C,G,C,C,C,E,C,C,G,C,C,E,C,O,C,C,E,C,I,E,A,Y,O,C,C,E,E,C,C,E,C,G,C,G,E,O,E,E,C,G,G,E,O,E,E,C,G,G,G,A,U,O,E,O,E,G,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,O,C,S,C,E,I,E,C,C,E,C,E,C,E,C,O,A,M,E,E,C,E,E,K,C,C,E,I,E,C,C,E,C,I,E,M,C,G,C,C,E,C,E,C,I,C,E,O,C,E,E,E,O,C,E,C,O,C,C,E,C,O,C,S,E,C,E,I,E,E,O,C,G,M,A,C,I,E,C,E,E,E,C,C,E,e,C,C,E,E,M,C,S,C,E,I,C,E,C,E,I,C,M,C,E,I,C,O,C,E,I,C,O,C,C,C,E,E,O,C,E,E,K,C,E,E,M,C,E,E,O,C,K,E,E,S,C,K,E,E,S,C,K,E,E,C,C,E,E,Q,C,S,C,C,C,E,C,C,E,C,C,S,C,C,C,E,E,O,C,C,E,C,E,A,E,O,c,C,E,O,C,I,W,O,C,C,E,A,C,G,C,C,E,C,E,I,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C,IAAI,UAAW,CAAE,MAAO,CAAC,CAAC,EAAM,GAAG,AAAC,EACpC,KAAA,EACA,MAAA,EACA,OAAA,CACF,CACF,CACF,C,E,iB,C,GAzLwB,EAAA,MAAA,CAAA,EAAA,UAAA,IAAA,GA2LpB,AAAkB,aAAlB,OAAO,QACT,CAAA,OAAO,0BAA0B,CAAG,CADtC,C,E,C,iD,O,E,C,Q,C,S,C,C,C,C,C,C,C,EC3LA,EAAQ,cAAc,CAAG,SAAU,CAAC,EAClC,OAAO,GAAK,EAAE,UAAU,CAAG,EAAI,CAAC,QAAS,CAAC,CAC5C,EAEA,EAAQ,iBAAiB,CAAG,SAAU,CAAC,EACrC,OAAO,cAAc,CAAC,EAAG,aAAc,CAAC,MAAO,CAAA,CAAI,EACrD,EAEA,EAAQ,SAAS,CAAG,SAAU,CAAM,CAAE,CAAI,EAkBxC,OAjBA,OAAO,IAAI,CAAC,GAAQ,OAAO,CAAC,SAAU,CAAG,EAE7B,YAAR,GACA,AAAQ,eAAR,GACA,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAM,IAK7C,OAAO,cAAc,CAAC,EAAM,EAAK,CAC/B,WAAY,CAAA,EACZ,IAAK,WACH,OAAO,CAAM,CAAC,EAAI,AACpB,CACF,EACF,GAEO,CACT,EAEA,EAAQ,MAAM,CAAG,SAAU,CAAI,CAAE,CAAQ,CAAE,CAAG,EAC5C,OAAO,cAAc,CAAC,EAAM,EAAU,CACpC,WAAY,CAAA,EACZ,IAAK,CACP,EACF,C,E,C,E,E,C,Q,C,Q,oB,C,G,G,C,Q,C,C,C,kB,gB,K,O","sources":["<anon>","packages/artplayer-plugin-docLine truncated
@@ -5,4 +5,4 @@
* (c) 2017-2025 Harvey Zack
* Released under the MIT License.
*/
!function(e,t,n,r,i,o,l,c){var d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},a="function"==typeof d[r]&&d[r],u=a.i||{},p=a.cache||{},f="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function s(t,n){if(!p[t]){if(!e[t]){if(i[t])return i[t];var o="function"==typeof d[r]&&d[r];if(!n&&o)return o(t,!0);if(a)return a(t,!0);if(f&&"string"==typeof t)return f(t);var l=Error("Cannot find module '"+t+"'");throw l.code="MODULE_NOT_FOUND",l}u.resolve=function(n){var r=e[t][1][n];return null!=r?r:n},u.cache={};var c=p[t]=new s.Module(t);e[t][0].call(c.exports,u,c,c.exports,d)}return p[t].exports;function u(e){var t=u.resolve(e);return!1===t?{}:s(t)}}s.isParcelRequire=!0,s.Module=function(e){this.id=e,this.bundle=s,this.require=f,this.exports={}},s.modules=e,s.cache=p,s.parent=a,s.distDir=void 0,s.publicUrl=void 0,s.devServer=void 0,s.i=u,s.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(s,"root",{get:function(){return d[r]}}),d[r]=s;for(var h=0;h<t.length;h++)s(t[h]);if(n){var m=s(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=m:"function"==typeof define&&define.amd&&define(function(){return m})}}({eo8f0:[function(e,t,n,r){var i=e("@parcel/transformer-js/src/esmodule-helpers.js");function o(e={}){let t={width:480,height:270,fallbackToVideoPiP:!0,placeholder:"Playing in Document Picture-in-Picture",...e};return e=>{let n="documentPictureInPicture"in window&&"function"==typeof window.documentPictureInPicture?.requestWindow,{proxy:r,icons:i,i18n:o,template:{$container:l},constructor:{utils:{append:c,tooltip:d,addClass:a,removeClass:u}}}=e,p={win:null,originalParent:null,originalNext:null,currentDoc:null,placeholder:null};async function f(){if(!n&&t.fallbackToVideoPiP){e.pip=!0,console.warn("[artplayer-plugin-document-pip] Document Picture-in-Picture is not supported, falling back to Video Picture-in-Picture");return}if(!p.win)try{let n=await window.documentPictureInPicture.requestWindow({width:t.width,height:t.height});p.win=n,p.currentDoc=n.document,p.placeholder=document.createElement("div"),p.placeholder.className="artplayer-pip-placeholder",p.placeholder.style.cssText="display:flex;justify-content:center;align-items:center;width:100%;height:100%;",p.placeholder.textContent=t.placeholder,p.originalParent=l.parentNode,p.originalNext=l.nextSibling,p.originalParent.insertBefore(p.placeholder,p.originalNext);let i=n.document.createElement("div");i.id="__art_dpip_root",n.document.body.appendChild(i);var r=n.document;let o=r.createElement("style");if(o.textContent=` html, body { margin:0; padding:0; width:100%; height:100%; background:#000; overflow:hidden; } #__art_dpip_root { position:absolute; inset:0; display:flex; } #__art_dpip_root > * { width:100% !important; height:100% !important; } `,r.head.appendChild(o),!r.querySelector('meta[name="viewport"]')){let e=r.createElement("meta");e.name="viewport",e.content="width=device-width,initial-scale=1",r.head.appendChild(e)}try{document.querySelectorAll('link[rel="stylesheet"]').forEach(e=>{let t=r.createElement("link");t.rel="stylesheet",t.href=e.href,e.media&&(t.media=e.media),e.crossOrigin&&(t.crossOrigin=e.crossOrigin),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),r.head.appendChild(t)})}catch{}try{document.querySelectorAll("style").forEach(e=>{let t=r.createElement("style");t.textContent=e.textContent,r.head.appendChild(t)})}catch{}let c=n.document.adoptNode(l);i.appendChild(c),p.currentDoc=n.document;let d=()=>e.resize?.(),u=()=>s();n.addEventListener("resize",d),n.addEventListener("pagehide",u),n.addEventListener("unload",u),p.cleanup=()=>{n.removeEventListener("resize",d),n.removeEventListener("pagehide",u),n.removeEventListener("unload",u)},a(l,"artplayer-document-pip"),e.emit("document-pip",!0)}catch(t){e.notice.show="Document Picture-in-Picture open failed",console.warn("[artplayer-plugin-document-pip] open failed:",t)}}function s(){if(!n&&t.fallbackToVideoPiP){e.pip=!1;return}if(p.win)try{p.cleanup?.(),function(){if(!p.placeholder)return;let e=p.placeholder.ownerDocument||document,t=e.adoptNode(l);p.originalParent.insertBefore(t,p.placeholder),p.placeholder.remove(),p.placeholder=null,p.currentDoc=e}(),p.win.close(),p.win=null,u(l,"artplayer-document-pip"),e.emit("document-pip",!1)}catch(t){e.notice.show="Document Picture-in-Picture close failed",console.warn("[artplayer-plugin-document-pip] close failed:",t)}}function h(){p.win?s():f()}return e.controls.add({name:"document-pip",position:"right",index:40,tooltip:e.i18n.get("PIP Mode"),mounted:t=>{c(t,i.pip),r(t,"click",h),e.on("document-pip",e=>{d(t,o.get(e?"Exit PIP Mode":"PIP Mode"))})}}),e.on("destroy",s),{name:"artplayerPluginDocumentPip",state:p,open:f,close:s,toggle:h}}}i.defineInteropFlag(n),i.export(n,"default",()=>o),"undefined"!=typeof window&&(window.artplayerPluginDocumentPip=o)},{"@parcel/transformLine truncated
!function(e,t,n,r,i,o,l,c){var d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},u="function"==typeof d[r]&&d[r],a=u.i||{},p=u.cache||{},f="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function s(t,n){if(!p[t]){if(!e[t]){if(i[t])return i[t];var o="function"==typeof d[r]&&d[r];if(!n&&o)return o(t,!0);if(u)return u(t,!0);if(f&&"string"==typeof t)return f(t);var l=Error("Cannot find module '"+t+"'");throw l.code="MODULE_NOT_FOUND",l}a.resolve=function(n){var r=e[t][1][n];return null!=r?r:n},a.cache={};var c=p[t]=new s.Module(t);e[t][0].call(c.exports,a,c,c.exports,d)}return p[t].exports;function a(e){var t=a.resolve(e);return!1===t?{}:s(t)}}s.isParcelRequire=!0,s.Module=function(e){this.id=e,this.bundle=s,this.require=f,this.exports={}},s.modules=e,s.cache=p,s.parent=u,s.distDir=void 0,s.publicUrl=void 0,s.devServer=void 0,s.i=a,s.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(s,"root",{get:function(){return d[r]}}),d[r]=s;for(var h=0;h<t.length;h++)s(t[h]);if(n){var m=s(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=m:"function"==typeof define&&define.amd&&define(function(){return m})}}({eo8f0:[function(e,t,n,r){var i=e("@parcel/transformer-js/src/esmodule-helpers.js");function o(e={}){let t={width:480,height:270,fallbackToVideoPiP:!0,placeholder:"Playing in Document Picture-in-Picture",...e};return e=>{let n="documentPictureInPicture"in window&&"function"==typeof window.documentPictureInPicture?.requestWindow,{proxy:r,icons:i,i18n:o,template:{$container:l},constructor:{utils:{append:c,tooltip:d,addClass:u,removeClass:a}}}=e,p={win:null,originalParent:null,originalNext:null,currentDoc:null,placeholder:null};async function f(){if(!n&&t.fallbackToVideoPiP){e.pip=!0,console.warn("[artplayer-plugin-document-pip] Document Picture-in-Picture is not supported, falling back to Video Picture-in-Picture");return}if(!p.win)try{let n=await window.documentPictureInPicture.requestWindow({width:t.width,height:t.height});p.win=n,p.currentDoc=n.document,p.placeholder=document.createElement("div"),p.placeholder.className="artplayer-pip-placeholder",p.placeholder.style.cssText="display:flex;justify-content:center;align-items:center;width:100%;height:100%;",p.placeholder.textContent=t.placeholder,p.originalParent=l.parentNode,p.originalNext=l.nextSibling,p.originalParent.insertBefore(p.placeholder,p.originalNext);let i=n.document.createElement("div");i.id="__art_dpip_root",n.document.body.appendChild(i);var r=n.document;let o=r.createElement("style");if(o.textContent=` html, body { margin:0; padding:0; width:100%; height:100%; background:#000; overflow:hidden; } #__art_dpip_root { position:absolute; inset:0; display:flex; } #__art_dpip_root > * { width:100% !important; height:100% !important; } `,r.head.appendChild(o),!r.querySelector('meta[name="viewport"]')){let e=r.createElement("meta");e.name="viewport",e.content="width=device-width,initial-scale=1",r.head.appendChild(e)}try{document.querySelectorAll('link[rel="stylesheet"]').forEach(e=>{let t=r.createElement("link");t.rel="stylesheet",t.href=e.href,e.media&&(t.media=e.media),e.crossOrigin&&(t.crossOrigin=e.crossOrigin),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),r.head.appendChild(t)})}catch{}try{document.querySelectorAll("style").forEach(e=>{let t=r.createElement("style");t.textContent=e.textContent,r.head.appendChild(t)})}catch{}let c=n.document.adoptNode(l);i.appendChild(c),p.currentDoc=n.document;let d=()=>e.resize?.(),a=()=>s();n.addEventListener("resize",d),n.addEventListener("pagehide",a),n.addEventListener("unload",a),p.cleanup=()=>{n.removeEventListener("resize",d),n.removeEventListener("pagehide",a),n.removeEventListener("unload",a)},u(l,"artplayer-document-pip"),e.emit("document-pip",!0)}catch(t){e.notice.show="Document Picture-in-Picture open failed",console.warn("[artplayer-plugin-document-pip] open failed:",t)}}function s(){if(p.win)try{p.cleanup?.(),function(){if(!p.placeholder)return;let e=p.placeholder.ownerDocument||document,t=e.adoptNode(l);p.originalParent.insertBefore(t,p.placeholder),p.placeholder.remove(),p.placeholder=null,p.currentDoc=e}(),p.win.close(),p.win=null,a(l,"artplayer-document-pip"),e.emit("document-pip",!1)}catch(t){e.notice.show="Document Picture-in-Picture close failed",console.warn("[artplayer-plugin-document-pip] close failed:",t)}}function h(){p.win?s():f()}return e.controls.add({name:"document-pip",position:"right",index:40,tooltip:e.i18n.get("PIP Mode"),mounted:t=>{c(t,i.pip),r(t,"click",h),e.on("document-pip",e=>{d(t,o.get(e?"Exit PIP Mode":"PIP Mode"))})}}),e.on("destroy",s),{name:"artplayerPluginDocumentPip",get isSupported(){return n},get isActive(){return!!p.win},open:f,close:s,toggle:h}}}i.defineInteropFlag(n),i.export(n,"default",()=>o),"undefined"!=typeof window&&(window.artplayerPluginDocumentPip=o)},{"@parcel/tranLine truncated
@@ -5,4 +5,4 @@
* (c) 2017-2025 Harvey Zack
* Released under the MIT License.
*/
!function(e,t,r,n,o,i,c,a){var u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},l="function"==typeof u[n]&&u[n],s=l.i||{},f=l.cache||{},p="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function d(t,r){if(!f[t]){if(!e[t]){if(o[t])return o[t];var i="function"==typeof u[n]&&u[n];if(!r&&i)return i(t,!0);if(l)return l(t,!0);if(p&&"string"==typeof t)return p(t);var c=Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}s.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},s.cache={};var a=f[t]=new d.Module(t);e[t][0].call(a.exports,s,a,a.exports,u)}return f[t].exports;function s(e){var t=s.resolve(e);return!1===t?{}:d(t)}}d.isParcelRequire=!0,d.Module=function(e){this.id=e,this.bundle=d,this.require=p,this.exports={}},d.modules=e,d.cache=f,d.parent=l,d.distDir=void 0,d.publicUrl=void 0,d.devServer=void 0,d.i=s,d.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(d,"root",{get:function(){return u[n]}}),u[n]=d;for(var y=0;y<t.length;y++)d(t[y]);if(r){var h=d(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=h:"function"==typeof define&&define.amd&&define(function(){return h})}}({"5Wzsp":[function(e,t,r,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r),o.export(r,"default",function(){return u});var i=e("@swc/helpers/cjs/_async_to_generator.cjs"),c=e("@swc/helpers/cjs/_object_spread.cjs"),a=e("@swc/helpers/cjs/_ts_generator.cjs");function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,c._)({width:480,height:270,fallbackToVideoPiP:!0,placeholder:"Playing in Document Picture-in-Picture"},e);return function(e){var r,n="documentPictureInPicture"in window&&"function"==typeof(null==(r=window.documentPictureInPicture)?void 0:r.requestWindow),o=e.proxy,c=e.icons,u=e.i18n,l=e.template.$container,s=e.constructor.utils,f=s.append,p=s.tooltip,d=s.addClass,y=s.removeClass,h={win:null,originalParent:null,originalNext:null,currentDoc:null,placeholder:null};function _(){return(0,i._)(function(){var r,o,i,c,u,s;return(0,a._)(this,function(a){switch(a.label){case 0:if(!n&&t.fallbackToVideoPiP)return e.pip=!0,console.warn("[artplayer-plugin-document-pip] Document Picture-in-Picture is not supported, falling back to Video Picture-in-Picture"),[2];if(h.win)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,window.documentPictureInPicture.requestWindow({width:t.width,height:t.height})];case 2:h.win=r=a.sent(),h.currentDoc=r.document,h.placeholder=document.createElement("div"),h.placeholder.className="artplayer-pip-placeholder",h.placeholder.style.cssText="display:flex;justify-content:center;align-items:center;width:100%;height:100%;",h.placeholder.textContent=t.placeholder,h.originalParent=l.parentNode,h.originalNext=l.nextSibling,h.originalParent.insertBefore(h.placeholder,h.originalNext),(o=r.document.createElement("div")).id="__art_dpip_root",r.document.body.appendChild(o);var f=r.document,p=f.createElement("style");if(p.textContent="\n html, body { margin:0; padding:0; width:100%; height:100%; background:#000; overflow:hidden; }\n #__art_dpip_root { position:absolute; inset:0; display:flex; }\n #__art_dpip_root > * { width:100% !important; height:100% !important; }\n ",f.head.appendChild(p),!f.querySelector('meta[name="viewport"]')){var y=f.createElement("meta");y.name="viewport",y.content="width=device-width,initial-scale=1",f.head.appendChild(y)}try{document.querySelectorAll('link[rel="stylesheet"]').forEach(function(e){var t=f.createElement("link");t.rel="stylesheet",t.href=e.href,e.media&&(t.media=e.media),e.crossOrigin&&(t.crossOrigin=e.crossOrigin),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),f.head.appendChild(t)})}catch(e){}try{document.querySelectorAll("style").forEach(function(e){var t=f.createElement("style");t.textContent=e.textContent,f.head.appendChild(t)})}catch(e){}return i=r.document.adoptNode(l),o.appendChild(i),h.currentDoc=r.document,c=function(){var t;return null==(t=e.resize)?void 0:t.call(e)},u=function(){return v()},r.addEventListener("resize",c),r.addEventListener("pagehide",u),r.addEventListener("unload",u),h.cleanup=function(){r.removeEventListener("resize",c),r.removeEventListener("pagehide",u),r.removeEventListener("unload",u)},d(l,"artplayer-document-pip"),e.emit("document-pip",!0),[3,4];case 3:return s=a.sent(),e.notice.show="Document Picture-in-Picture open failed",console.warn("[artplayer-plugin-document-pip] open failed:",s),[3,4];case 4:return[2]}})})()}function v(){if(!n&&t.fallbackToVideoPiP){e.pip=!1;return}if(h.win)try{var r;if(null==(r=h.cleanup)||r.call(h),h.placeholder){var o=h.placeholder.ownerDocument||document,i=o.adoptNode(l);h.originalParent.insertBefore(i,h.placeholder),h.placeholder.remove(),h.placeholder=null,h.currentDoc=o}h.win.close(),h.win=null,y(l,"artplayer-document-pip"),e.emit("document-pipLine truncated
!function(e,t,r,n,o,i,c,a){var u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},l="function"==typeof u[n]&&u[n],s=l.i||{},f=l.cache||{},p="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function d(t,r){if(!f[t]){if(!e[t]){if(o[t])return o[t];var i="function"==typeof u[n]&&u[n];if(!r&&i)return i(t,!0);if(l)return l(t,!0);if(p&&"string"==typeof t)return p(t);var c=Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}s.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},s.cache={};var a=f[t]=new d.Module(t);e[t][0].call(a.exports,s,a,a.exports,u)}return f[t].exports;function s(e){var t=s.resolve(e);return!1===t?{}:d(t)}}d.isParcelRequire=!0,d.Module=function(e){this.id=e,this.bundle=d,this.require=p,this.exports={}},d.modules=e,d.cache=f,d.parent=l,d.distDir=void 0,d.publicUrl=void 0,d.devServer=void 0,d.i=s,d.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(d,"root",{get:function(){return u[n]}}),u[n]=d;for(var y=0;y<t.length;y++)d(t[y]);if(r){var h=d(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=h:"function"==typeof define&&define.amd&&define(function(){return h})}}({"5Wzsp":[function(e,t,r,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r),o.export(r,"default",function(){return u});var i=e("@swc/helpers/cjs/_async_to_generator.cjs"),c=e("@swc/helpers/cjs/_object_spread.cjs"),a=e("@swc/helpers/cjs/_ts_generator.cjs");function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,c._)({width:480,height:270,fallbackToVideoPiP:!0,placeholder:"Playing in Document Picture-in-Picture"},e);return function(e){var r,n="documentPictureInPicture"in window&&"function"==typeof(null==(r=window.documentPictureInPicture)?void 0:r.requestWindow),o=e.proxy,c=e.icons,u=e.i18n,l=e.template.$container,s=e.constructor.utils,f=s.append,p=s.tooltip,d=s.addClass,y=s.removeClass,h={win:null,originalParent:null,originalNext:null,currentDoc:null,placeholder:null};function _(){return(0,i._)(function(){var r,o,i,c,u,s;return(0,a._)(this,function(a){switch(a.label){case 0:if(!n&&t.fallbackToVideoPiP)return e.pip=!0,console.warn("[artplayer-plugin-document-pip] Document Picture-in-Picture is not supported, falling back to Video Picture-in-Picture"),[2];if(h.win)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,window.documentPictureInPicture.requestWindow({width:t.width,height:t.height})];case 2:h.win=r=a.sent(),h.currentDoc=r.document,h.placeholder=document.createElement("div"),h.placeholder.className="artplayer-pip-placeholder",h.placeholder.style.cssText="display:flex;justify-content:center;align-items:center;width:100%;height:100%;",h.placeholder.textContent=t.placeholder,h.originalParent=l.parentNode,h.originalNext=l.nextSibling,h.originalParent.insertBefore(h.placeholder,h.originalNext),(o=r.document.createElement("div")).id="__art_dpip_root",r.document.body.appendChild(o);var f=r.document,p=f.createElement("style");if(p.textContent="\n html, body { margin:0; padding:0; width:100%; height:100%; background:#000; overflow:hidden; }\n #__art_dpip_root { position:absolute; inset:0; display:flex; }\n #__art_dpip_root > * { width:100% !important; height:100% !important; }\n ",f.head.appendChild(p),!f.querySelector('meta[name="viewport"]')){var y=f.createElement("meta");y.name="viewport",y.content="width=device-width,initial-scale=1",f.head.appendChild(y)}try{document.querySelectorAll('link[rel="stylesheet"]').forEach(function(e){var t=f.createElement("link");t.rel="stylesheet",t.href=e.href,e.media&&(t.media=e.media),e.crossOrigin&&(t.crossOrigin=e.crossOrigin),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),f.head.appendChild(t)})}catch(e){}try{document.querySelectorAll("style").forEach(function(e){var t=f.createElement("style");t.textContent=e.textContent,f.head.appendChild(t)})}catch(e){}return i=r.document.adoptNode(l),o.appendChild(i),h.currentDoc=r.document,c=function(){var t;return null==(t=e.resize)?void 0:t.call(e)},u=function(){return v()},r.addEventListener("resize",c),r.addEventListener("pagehide",u),r.addEventListener("unload",u),h.cleanup=function(){r.removeEventListener("resize",c),r.removeEventListener("pagehide",u),r.removeEventListener("unload",u)},d(l,"artplayer-document-pip"),e.emit("document-pip",!0),[3,4];case 3:return s=a.sent(),e.notice.show="Document Picture-in-Picture open failed",console.warn("[artplayer-plugin-document-pip] open failed:",s),[3,4];case 4:return[2]}})})()}function v(){if(h.win)try{var t;if(null==(t=h.cleanup)||t.call(h),h.placeholder){var r=h.placeholder.ownerDocument||document,n=r.adoptNode(l);h.originalParent.insertBefore(n,h.placeholder),h.placeholder.remove(),h.placeholder=null,h.currentDoc=r}h.win.close(),h.win=null,y(l,"artplayer-document-pip"),e.emit("document-pip",!1)}catch(t){e.notice.show="Document PicturLine truncated
@@ -173,7 +173,7 @@ function artplayerPluginDocumentPip(userOptions = {}) {
...userOptions
};
return (art)=>{
const dpipOK = 'documentPictureInPicture' in window && typeof window.documentPictureInPicture?.requestWindow === 'function';
const isSupported = 'documentPictureInPicture' in window && typeof window.documentPictureInPicture?.requestWindow === 'function';
const { proxy, icons, i18n, template: { $container }, constructor: { utils: { append, tooltip, addClass, removeClass } } } = art;
const state = {
win: null,
@@ -216,7 +216,7 @@ function artplayerPluginDocumentPip(userOptions = {}) {
} catch {}
}
async function open() {
if (!dpipOK && options.fallbackToVideoPiP) {
if (!isSupported && options.fallbackToVideoPiP) {
art.pip = true;
console.warn('[artplayer-plugin-document-pip] Document Picture-in-Picture is not supported, falling back to Video Picture-in-Picture');
return;
@@ -270,10 +270,6 @@ function artplayerPluginDocumentPip(userOptions = {}) {
state.currentDoc = backDoc;
}
function close() {
if (!dpipOK && options.fallbackToVideoPiP) {
art.pip = false;
return;
}
if (!state.win) return;
try {
state.cleanup?.();
@@ -307,7 +303,12 @@ function artplayerPluginDocumentPip(userOptions = {}) {
art.on('destroy', close);
return {
name: 'artplayerPluginDocumentPip',
state,
get isSupported () {
return isSupported;
},
get isActive () {
return !!state.win;
},
open,
close,
toggle
@@ -1 +1 @@
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CAAwB;AAAT,SAAS,2BAA2B,cAAc,CAAC,CAAC;IACjE,MAAM,UAAU;QACd,OAAO;QACP,QAAQ;QACR,oBAAoB;QACpB,aAAa,CAAC,sCAAsC,CAAC;QACrD,GAAG,WAAW;IAChB;IAEA,OAAO,CAAC;QACN,MAAM,SAAS,8BAA8B,UACxC,OAAO,OAAO,wBAAwB,EAAE,kBAAkB;QAE/D,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,GAAG;QAE7H,MAAM,QAAQ;YACZ,KAAK;YACL,gBAAgB;YAChB,cAAc;YACd,YAAY;YACZ,aAAa;QACf;QAEA,SAAS,aAAa,SAAS;YAC7B,MAAM,OAAO,UAAU,aAAa,CAAC;YACrC,KAAK,WAAW,GAAG,CAAC;;;;MAIpB,CAAC;YACD,UAAU,IAAI,CAAC,WAAW,CAAC;YAC3B,IAAI,CAAC,UAAU,aAAa,CAAC,0BAA0B;gBACrD,MAAM,OAAO,UAAU,aAAa,CAAC;gBACrC,KAAK,IAAI,GAAG;gBACZ,KAAK,OAAO,GAAG;gBACf,UAAU,IAAI,CAAC,WAAW,CAAC;YAC7B;YAEA,IAAI;gBACF,SAAS,gBAAgB,CAAC,0BAA0B,OAAO,CAAC,CAAC;oBAC3D,MAAM,QAAQ,UAAU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AAc,CAAC,MAAM,UAAU;QACpC,YAAY;QACZ,KAAK;IACP;AACF","sources":["packages/artplayer-plugin-document-pip/src/index.js","node_modules/@parcel/transformer-js/src/esmodule-helpers.js"],"sourcesContent":["export default function artplayerPluginDocumentPip(userOptions = {}) {\n const options = {\n width: 480,\n height: 270,\n fallbackToVideoPiP: true,\n placeholder: `Playing in Document Picture-in-Picture`,\n ...userOptions,\n }\n\n return (art) => {\n const dpipOK = 'documentPictureInPicture' in window\n && typeof window.documentPictureInPicture?.requestWindow === 'function'\n\n const { proxy, icons, i18n, template: { $container }, constructor: { utils: { append, tooltip, addClass, removeClass } } } = art\n\n const state = {\n win: null,\n originalParent: null,\n originalNext: null,\n currentDoc: null,\n placeholder: null,\n }\n\n Line truncated
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CAAwB;AAAT,SAAS,2BAA2B,cAAc,CAAC,CAAC;IACjE,MAAM,UAAU;QACd,OAAO;QACP,QAAQ;QACR,oBAAoB;QACpB,aAAa,CAAC,sCAAsC,CAAC;QACrD,GAAG,WAAW;IAChB;IAEA,OAAO,CAAC;QACN,MAAM,cAAc,8BAA8B,UAC7C,OAAO,OAAO,wBAAwB,EAAE,kBAAkB;QAE/D,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,GAAG;QAE7H,MAAM,QAAQ;YACZ,KAAK;YACL,gBAAgB;YAChB,cAAc;YACd,YAAY;YACZ,aAAa;QACf;QAEA,SAAS,aAAa,SAAS;YAC7B,MAAM,OAAO,UAAU,a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AG,SAAU,MAAM,EAAE,IAAI;IACxC,OAAO,IAAI,CAAC,QAAQ,OAAO,CAAC,SAAU,GAAG;QACvC,IACE,QAAQ,aACR,QAAQ,gBACR,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,MAE3C;QAGF,OAAO,cAAc,CAAC,MAAM,KAAK;YAC/B,YAAY;YACZ,KAAK;gBACH,OAAO,MAAM,CAAC,IAAI;YACpB;QACF;IACF;IAEA,OAAO;AACT;AAEA,QAAQ,MAAM,GAAG,SAAU,IAAI,EAAE,QAAQ,EAAE,GAAG;IAC5C,OAAO,cAAc,CAAC,MAAM,UAAU;QACpC,YAAY;QACZ,KAAK;IACP;AACF","sources":["packages/artplayer-plugin-document-pip/src/index.js","node_modules/@parcel/transformer-js/src/esmodule-helpers.js"],"sourcesContent":["export default function artplayerPluginDocumentPip(userOptions = {}) {\n const options = {\n width: 480,\n height: 270,\n fallbackToVideoPiP: true,\n placeholder: `Playing in Document Picture-in-Picture`,\n ...userOptions,\n }\n\n return (art) => {\n const isSupported = 'documentPictureInPicture' in window\n && typeof window.documentPictureInPicture?.requestWindow === 'function'\n\n const { proxy, icons, i18n, template: { $container }, constructor: { utils: { append, tooltip, addClass, removeClass } } } = art\n\n const state = {\n win: null,\n originalParent: null,\n originalNext: null,\n currentDoc: null,\n placeholder: null,Line truncated
@@ -5,5 +5,5 @@
* (c) 2017-2025 Harvey Zack
* Released under the MIT License.
*/
!function(e,t,n,r,i,o,l,d){var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},a="function"==typeof c[r]&&c[r],u=a.i||{},p=a.cache||{},f="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function s(t,n){if(!p[t]){if(!e[t]){if(i[t])return i[t];var o="function"==typeof c[r]&&c[r];if(!n&&o)return o(t,!0);if(a)return a(t,!0);if(f&&"string"==typeof t)return f(t);var l=Error("Cannot find module '"+t+"'");throw l.code="MODULE_NOT_FOUND",l}u.resolve=function(n){var r=e[t][1][n];return null!=r?r:n},u.cache={};var d=p[t]=new s.Module(t);e[t][0].call(d.exports,u,d,d.exports,c)}return p[t].exports;function u(e){var t=u.resolve(e);return!1===t?{}:s(t)}}s.isParcelRequire=!0,s.Module=function(e){this.id=e,this.bundle=s,this.require=f,this.exports={}},s.modules=e,s.cache=p,s.parent=a,s.distDir=void 0,s.publicUrl=void 0,s.devServer=void 0,s.i=u,s.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(s,"root",{get:function(){return c[r]}}),c[r]=s;for(var h=0;h<t.length;h++)s(t[h]);if(n){var m=s(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=m:"function"==typeof define&&define.amd&&define(function(){return m})}}({bKI9O:[function(e,t,n,r){var i=e("@parcel/transformer-js/src/esmodule-helpers.js");function o(e={}){let t={width:480,height:270,fallbackToVideoPiP:!0,placeholder:"Playing in Document Picture-in-Picture",...e};return e=>{let n="documentPictureInPicture"in window&&"function"==typeof window.documentPictureInPicture?.requestWindow,{proxy:r,icons:i,i18n:o,template:{$container:l},constructor:{utils:{append:d,tooltip:c,addClass:a,removeClass:u}}}=e,p={win:null,originalParent:null,originalNext:null,currentDoc:null,placeholder:null};async function f(){if(!n&&t.fallbackToVideoPiP){e.pip=!0,console.warn("[artplayer-plugin-document-pip] Document Picture-in-Picture is not supported, falling back to Video Picture-in-Picture");return}if(!p.win)try{let n=await window.documentPictureInPicture.requestWindow({width:t.width,height:t.height});p.win=n,p.currentDoc=n.document,p.placeholder=document.createElement("div"),p.placeholder.className="artplayer-pip-placeholder",p.placeholder.style.cssText="display:flex;justify-content:center;align-items:center;width:100%;height:100%;",p.placeholder.textContent=t.placeholder,p.originalParent=l.parentNode,p.originalNext=l.nextSibling,p.originalParent.insertBefore(p.placeholder,p.originalNext);let i=n.document.createElement("div");i.id="__art_dpip_root",n.document.body.appendChild(i);var r=n.document;let o=r.createElement("style");if(o.textContent=` html, body { margin:0; padding:0; width:100%; height:100%; background:#000; overflow:hidden; } #__art_dpip_root { position:absolute; inset:0; display:flex; } #__art_dpip_root > * { width:100% !important; height:100% !important; } `,r.head.appendChild(o),!r.querySelector('meta[name="viewport"]')){let e=r.createElement("meta");e.name="viewport",e.content="width=device-width,initial-scale=1",r.head.appendChild(e)}try{document.querySelectorAll('link[rel="stylesheet"]').forEach(e=>{let t=r.createElement("link");t.rel="stylesheet",t.href=e.href,e.media&&(t.media=e.media),e.crossOrigin&&(t.crossOrigin=e.crossOrigin),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),r.head.appendChild(t)})}catch{}try{document.querySelectorAll("style").forEach(e=>{let t=r.createElement("style");t.textContent=e.textContent,r.head.appendChild(t)})}catch{}let d=n.document.adoptNode(l);i.appendChild(d),p.currentDoc=n.document;let c=()=>e.resize?.(),u=()=>s();n.addEventListener("resize",c),n.addEventListener("pagehide",u),n.addEventListener("unload",u),p.cleanup=()=>{n.removeEventListener("resize",c),n.removeEventListener("pagehide",u),n.removeEventListener("unload",u)},a(l,"artplayer-document-pip"),e.emit("document-pip",!0)}catch(t){e.notice.show="Document Picture-in-Picture open failed",console.warn("[artplayer-plugin-document-pip] open failed:",t)}}function s(){if(!n&&t.fallbackToVideoPiP){e.pip=!1;return}if(p.win)try{p.cleanup?.(),function(){if(!p.placeholder)return;let e=p.placeholder.ownerDocument||document,t=e.adoptNode(l);p.originalParent.insertBefore(t,p.placeholder),p.placeholder.remove(),p.placeholder=null,p.currentDoc=e}(),p.win.close(),p.win=null,u(l,"artplayer-document-pip"),e.emit("document-pip",!1)}catch(t){e.notice.show="Document Picture-in-Picture close failed",console.warn("[artplayer-plugin-document-pip] close failed:",t)}}function h(){p.win?s():f()}return e.controls.add({name:"document-pip",position:"right",index:40,tooltip:e.i18n.get("PIP Mode"),mounted:t=>{d(t,i.pip),r(t,"click",h),e.on("document-pip",e=>{c(t,o.get(e?"Exit PIP Mode":"PIP Mode"))})}}),e.on("destroy",s),{name:"artplayerPluginDocumentPip",state:p,open:f,close:s,toggle:h}}}i.defineInteropFlag(n),i.export(n,"default",()=>o),"undefined"!=typeof window&&(window.artplayerPluginDocumentPip=o)},{"@parcel/transformLine truncated
!function(e,t,n,r,i,o,l,d){var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},u="function"==typeof c[r]&&c[r],a=u.i||{},p=u.cache||{},f="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function s(t,n){if(!p[t]){if(!e[t]){if(i[t])return i[t];var o="function"==typeof c[r]&&c[r];if(!n&&o)return o(t,!0);if(u)return u(t,!0);if(f&&"string"==typeof t)return f(t);var l=Error("Cannot find module '"+t+"'");throw l.code="MODULE_NOT_FOUND",l}a.resolve=function(n){var r=e[t][1][n];return null!=r?r:n},a.cache={};var d=p[t]=new s.Module(t);e[t][0].call(d.exports,a,d,d.exports,c)}return p[t].exports;function a(e){var t=a.resolve(e);return!1===t?{}:s(t)}}s.isParcelRequire=!0,s.Module=function(e){this.id=e,this.bundle=s,this.require=f,this.exports={}},s.modules=e,s.cache=p,s.parent=u,s.distDir=void 0,s.publicUrl=void 0,s.devServer=void 0,s.i=a,s.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(s,"root",{get:function(){return c[r]}}),c[r]=s;for(var h=0;h<t.length;h++)s(t[h]);if(n){var m=s(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=m:"function"==typeof define&&define.amd&&define(function(){return m})}}({bKI9O:[function(e,t,n,r){var i=e("@parcel/transformer-js/src/esmodule-helpers.js");function o(e={}){let t={width:480,height:270,fallbackToVideoPiP:!0,placeholder:"Playing in Document Picture-in-Picture",...e};return e=>{let n="documentPictureInPicture"in window&&"function"==typeof window.documentPictureInPicture?.requestWindow,{proxy:r,icons:i,i18n:o,template:{$container:l},constructor:{utils:{append:d,tooltip:c,addClass:u,removeClass:a}}}=e,p={win:null,originalParent:null,originalNext:null,currentDoc:null,placeholder:null};async function f(){if(!n&&t.fallbackToVideoPiP){e.pip=!0,console.warn("[artplayer-plugin-document-pip] Document Picture-in-Picture is not supported, falling back to Video Picture-in-Picture");return}if(!p.win)try{let n=await window.documentPictureInPicture.requestWindow({width:t.width,height:t.height});p.win=n,p.currentDoc=n.document,p.placeholder=document.createElement("div"),p.placeholder.className="artplayer-pip-placeholder",p.placeholder.style.cssText="display:flex;justify-content:center;align-items:center;width:100%;height:100%;",p.placeholder.textContent=t.placeholder,p.originalParent=l.parentNode,p.originalNext=l.nextSibling,p.originalParent.insertBefore(p.placeholder,p.originalNext);let i=n.document.createElement("div");i.id="__art_dpip_root",n.document.body.appendChild(i);var r=n.document;let o=r.createElement("style");if(o.textContent=` html, body { margin:0; padding:0; width:100%; height:100%; background:#000; overflow:hidden; } #__art_dpip_root { position:absolute; inset:0; display:flex; } #__art_dpip_root > * { width:100% !important; height:100% !important; } `,r.head.appendChild(o),!r.querySelector('meta[name="viewport"]')){let e=r.createElement("meta");e.name="viewport",e.content="width=device-width,initial-scale=1",r.head.appendChild(e)}try{document.querySelectorAll('link[rel="stylesheet"]').forEach(e=>{let t=r.createElement("link");t.rel="stylesheet",t.href=e.href,e.media&&(t.media=e.media),e.crossOrigin&&(t.crossOrigin=e.crossOrigin),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),r.head.appendChild(t)})}catch{}try{document.querySelectorAll("style").forEach(e=>{let t=r.createElement("style");t.textContent=e.textContent,r.head.appendChild(t)})}catch{}let d=n.document.adoptNode(l);i.appendChild(d),p.currentDoc=n.document;let c=()=>e.resize?.(),a=()=>s();n.addEventListener("resize",c),n.addEventListener("pagehide",a),n.addEventListener("unload",a),p.cleanup=()=>{n.removeEventListener("resize",c),n.removeEventListener("pagehide",a),n.removeEventListener("unload",a)},u(l,"artplayer-document-pip"),e.emit("document-pip",!0)}catch(t){e.notice.show="Document Picture-in-Picture open failed",console.warn("[artplayer-plugin-document-pip] open failed:",t)}}function s(){if(p.win)try{p.cleanup?.(),function(){if(!p.placeholder)return;let e=p.placeholder.ownerDocument||document,t=e.adoptNode(l);p.originalParent.insertBefore(t,p.placeholder),p.placeholder.remove(),p.placeholder=null,p.currentDoc=e}(),p.win.close(),p.win=null,a(l,"artplayer-document-pip"),e.emit("document-pip",!1)}catch(t){e.notice.show="Document Picture-in-Picture close failed",console.warn("[artplayer-plugin-document-pip] close failed:",t)}}function h(){p.win?s():f()}return e.controls.add({name:"document-pip",position:"right",index:40,tooltip:e.i18n.get("PIP Mode"),mounted:t=>{d(t,i.pip),r(t,"click",h),e.on("document-pip",e=>{c(t,o.get(e?"Exit PIP Mode":"PIP Mode"))})}}),e.on("destroy",s),{name:"artplayerPluginDocumentPip",get isSupported(){return n},get isActive(){return!!p.win},open:f,close:s,toggle:h}}}i.defineInteropFlag(n),i.export(n,"default",()=>o),"undefined"!=typeof window&&(window.artplayerPluginDocumentPip=o)},{"@parcel/tranLine truncated
//# sourceMappingURL=artplayer-plugin-document-pip.esm.js.map
@@ -1 +1 @@
{"mappings":"C,A,S,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,E,I,E,A,a,O,W,W,A,a,O,K,K,A,a,O,O,O,A,a,O,O,O,C,E,E,A,Y,O,C,C,E,E,C,C,E,C,E,E,C,E,C,E,E,E,K,E,C,E,E,A,a,O,Q,A,Y,O,O,O,E,O,O,C,I,C,Q,S,E,C,C,C,E,G,C,C,C,E,C,C,G,C,C,C,E,C,C,G,C,C,E,C,O,C,C,E,C,I,E,A,Y,O,C,C,E,E,C,C,E,C,G,C,G,E,O,E,E,C,G,G,E,O,E,E,C,G,G,G,A,U,O,E,O,E,G,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,O,C,S,C,E,I,E,C,C,E,C,E,C,E,C,O,A,M,E,E,C,E,E,K,C,C,E,I,E,C,C,E,C,I,E,M,C,G,C,C,E,C,E,C,I,C,E,O,C,E,E,E,O,C,E,C,O,C,C,E,C,O,C,S,E,C,E,I,E,E,O,C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K,CACP,EACF,C,E,C,E,E,C,Q,C,Q,oB,C,G,G,C,Q,C,C,C,kB,gB,K,O","sources":["<anon>","packages/artplayer-plugin-docLine truncated
@@ -5,4 +5,4 @@
* (c) 2017-2025 Harvey Zack
* Released under the MIT License.
*/
!function(e,t,n,r,i,o,l,c){var d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},a="function"==typeof d[r]&&d[r],u=a.i||{},p=a.cache||{},f="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function s(t,n){if(!p[t]){if(!e[t]){if(i[t])return i[t];var o="function"==typeof d[r]&&d[r];if(!n&&o)return o(t,!0);if(a)return a(t,!0);if(f&&"string"==typeof t)return f(t);var l=Error("Cannot find module '"+t+"'");throw l.code="MODULE_NOT_FOUND",l}u.resolve=function(n){var r=e[t][1][n];return null!=r?r:n},u.cache={};var c=p[t]=new s.Module(t);e[t][0].call(c.exports,u,c,c.exports,d)}return p[t].exports;function u(e){var t=u.resolve(e);return!1===t?{}:s(t)}}s.isParcelRequire=!0,s.Module=function(e){this.id=e,this.bundle=s,this.require=f,this.exports={}},s.modules=e,s.cache=p,s.parent=a,s.distDir=void 0,s.publicUrl=void 0,s.devServer=void 0,s.i=u,s.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(s,"root",{get:function(){return d[r]}}),d[r]=s;for(var h=0;h<t.length;h++)s(t[h]);if(n){var m=s(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=m:"function"==typeof define&&define.amd&&define(function(){return m})}}({eo8f0:[function(e,t,n,r){var i=e("@parcel/transformer-js/src/esmodule-helpers.js");function o(e={}){let t={width:480,height:270,fallbackToVideoPiP:!0,placeholder:"Playing in Document Picture-in-Picture",...e};return e=>{let n="documentPictureInPicture"in window&&"function"==typeof window.documentPictureInPicture?.requestWindow,{proxy:r,icons:i,i18n:o,template:{$container:l},constructor:{utils:{append:c,tooltip:d,addClass:a,removeClass:u}}}=e,p={win:null,originalParent:null,originalNext:null,currentDoc:null,placeholder:null};async function f(){if(!n&&t.fallbackToVideoPiP){e.pip=!0,console.warn("[artplayer-plugin-document-pip] Document Picture-in-Picture is not supported, falling back to Video Picture-in-Picture");return}if(!p.win)try{let n=await window.documentPictureInPicture.requestWindow({width:t.width,height:t.height});p.win=n,p.currentDoc=n.document,p.placeholder=document.createElement("div"),p.placeholder.className="artplayer-pip-placeholder",p.placeholder.style.cssText="display:flex;justify-content:center;align-items:center;width:100%;height:100%;",p.placeholder.textContent=t.placeholder,p.originalParent=l.parentNode,p.originalNext=l.nextSibling,p.originalParent.insertBefore(p.placeholder,p.originalNext);let i=n.document.createElement("div");i.id="__art_dpip_root",n.document.body.appendChild(i);var r=n.document;let o=r.createElement("style");if(o.textContent=` html, body { margin:0; padding:0; width:100%; height:100%; background:#000; overflow:hidden; } #__art_dpip_root { position:absolute; inset:0; display:flex; } #__art_dpip_root > * { width:100% !important; height:100% !important; } `,r.head.appendChild(o),!r.querySelector('meta[name="viewport"]')){let e=r.createElement("meta");e.name="viewport",e.content="width=device-width,initial-scale=1",r.head.appendChild(e)}try{document.querySelectorAll('link[rel="stylesheet"]').forEach(e=>{let t=r.createElement("link");t.rel="stylesheet",t.href=e.href,e.media&&(t.media=e.media),e.crossOrigin&&(t.crossOrigin=e.crossOrigin),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),r.head.appendChild(t)})}catch{}try{document.querySelectorAll("style").forEach(e=>{let t=r.createElement("style");t.textContent=e.textContent,r.head.appendChild(t)})}catch{}let c=n.document.adoptNode(l);i.appendChild(c),p.currentDoc=n.document;let d=()=>e.resize?.(),u=()=>s();n.addEventListener("resize",d),n.addEventListener("pagehide",u),n.addEventListener("unload",u),p.cleanup=()=>{n.removeEventListener("resize",d),n.removeEventListener("pagehide",u),n.removeEventListener("unload",u)},a(l,"artplayer-document-pip"),e.emit("document-pip",!0)}catch(t){e.notice.show="Document Picture-in-Picture open failed",console.warn("[artplayer-plugin-document-pip] open failed:",t)}}function s(){if(!n&&t.fallbackToVideoPiP){e.pip=!1;return}if(p.win)try{p.cleanup?.(),function(){if(!p.placeholder)return;let e=p.placeholder.ownerDocument||document,t=e.adoptNode(l);p.originalParent.insertBefore(t,p.placeholder),p.placeholder.remove(),p.placeholder=null,p.currentDoc=e}(),p.win.close(),p.win=null,u(l,"artplayer-document-pip"),e.emit("document-pip",!1)}catch(t){e.notice.show="Document Picture-in-Picture close failed",console.warn("[artplayer-plugin-document-pip] close failed:",t)}}function h(){p.win?s():f()}return e.controls.add({name:"document-pip",position:"right",index:40,tooltip:e.i18n.get("PIP Mode"),mounted:t=>{c(t,i.pip),r(t,"click",h),e.on("document-pip",e=>{d(t,o.get(e?"Exit PIP Mode":"PIP Mode"))})}}),e.on("destroy",s),{name:"artplayerPluginDocumentPip",state:p,open:f,close:s,toggle:h}}}i.defineInteropFlag(n),i.export(n,"default",()=>o),"undefined"!=typeof window&&(window.artplayerPluginDocumentPip=o)},{"@parcel/transformLine truncated
!function(e,t,n,r,i,o,l,c){var d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},u="function"==typeof d[r]&&d[r],a=u.i||{},p=u.cache||{},f="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function s(t,n){if(!p[t]){if(!e[t]){if(i[t])return i[t];var o="function"==typeof d[r]&&d[r];if(!n&&o)return o(t,!0);if(u)return u(t,!0);if(f&&"string"==typeof t)return f(t);var l=Error("Cannot find module '"+t+"'");throw l.code="MODULE_NOT_FOUND",l}a.resolve=function(n){var r=e[t][1][n];return null!=r?r:n},a.cache={};var c=p[t]=new s.Module(t);e[t][0].call(c.exports,a,c,c.exports,d)}return p[t].exports;function a(e){var t=a.resolve(e);return!1===t?{}:s(t)}}s.isParcelRequire=!0,s.Module=function(e){this.id=e,this.bundle=s,this.require=f,this.exports={}},s.modules=e,s.cache=p,s.parent=u,s.distDir=void 0,s.publicUrl=void 0,s.devServer=void 0,s.i=a,s.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(s,"root",{get:function(){return d[r]}}),d[r]=s;for(var h=0;h<t.length;h++)s(t[h]);if(n){var m=s(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=m:"function"==typeof define&&define.amd&&define(function(){return m})}}({eo8f0:[function(e,t,n,r){var i=e("@parcel/transformer-js/src/esmodule-helpers.js");function o(e={}){let t={width:480,height:270,fallbackToVideoPiP:!0,placeholder:"Playing in Document Picture-in-Picture",...e};return e=>{let n="documentPictureInPicture"in window&&"function"==typeof window.documentPictureInPicture?.requestWindow,{proxy:r,icons:i,i18n:o,template:{$container:l},constructor:{utils:{append:c,tooltip:d,addClass:u,removeClass:a}}}=e,p={win:null,originalParent:null,originalNext:null,currentDoc:null,placeholder:null};async function f(){if(!n&&t.fallbackToVideoPiP){e.pip=!0,console.warn("[artplayer-plugin-document-pip] Document Picture-in-Picture is not supported, falling back to Video Picture-in-Picture");return}if(!p.win)try{let n=await window.documentPictureInPicture.requestWindow({width:t.width,height:t.height});p.win=n,p.currentDoc=n.document,p.placeholder=document.createElement("div"),p.placeholder.className="artplayer-pip-placeholder",p.placeholder.style.cssText="display:flex;justify-content:center;align-items:center;width:100%;height:100%;",p.placeholder.textContent=t.placeholder,p.originalParent=l.parentNode,p.originalNext=l.nextSibling,p.originalParent.insertBefore(p.placeholder,p.originalNext);let i=n.document.createElement("div");i.id="__art_dpip_root",n.document.body.appendChild(i);var r=n.document;let o=r.createElement("style");if(o.textContent=` html, body { margin:0; padding:0; width:100%; height:100%; background:#000; overflow:hidden; } #__art_dpip_root { position:absolute; inset:0; display:flex; } #__art_dpip_root > * { width:100% !important; height:100% !important; } `,r.head.appendChild(o),!r.querySelector('meta[name="viewport"]')){let e=r.createElement("meta");e.name="viewport",e.content="width=device-width,initial-scale=1",r.head.appendChild(e)}try{document.querySelectorAll('link[rel="stylesheet"]').forEach(e=>{let t=r.createElement("link");t.rel="stylesheet",t.href=e.href,e.media&&(t.media=e.media),e.crossOrigin&&(t.crossOrigin=e.crossOrigin),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),r.head.appendChild(t)})}catch{}try{document.querySelectorAll("style").forEach(e=>{let t=r.createElement("style");t.textContent=e.textContent,r.head.appendChild(t)})}catch{}let c=n.document.adoptNode(l);i.appendChild(c),p.currentDoc=n.document;let d=()=>e.resize?.(),a=()=>s();n.addEventListener("resize",d),n.addEventListener("pagehide",a),n.addEventListener("unload",a),p.cleanup=()=>{n.removeEventListener("resize",d),n.removeEventListener("pagehide",a),n.removeEventListener("unload",a)},u(l,"artplayer-document-pip"),e.emit("document-pip",!0)}catch(t){e.notice.show="Document Picture-in-Picture open failed",console.warn("[artplayer-plugin-document-pip] open failed:",t)}}function s(){if(p.win)try{p.cleanup?.(),function(){if(!p.placeholder)return;let e=p.placeholder.ownerDocument||document,t=e.adoptNode(l);p.originalParent.insertBefore(t,p.placeholder),p.placeholder.remove(),p.placeholder=null,p.currentDoc=e}(),p.win.close(),p.win=null,a(l,"artplayer-document-pip"),e.emit("document-pip",!1)}catch(t){e.notice.show="Document Picture-in-Picture close failed",console.warn("[artplayer-plugin-document-pip] close failed:",t)}}function h(){p.win?s():f()}return e.controls.add({name:"document-pip",position:"right",index:40,tooltip:e.i18n.get("PIP Mode"),mounted:t=>{c(t,i.pip),r(t,"click",h),e.on("document-pip",e=>{d(t,o.get(e?"Exit PIP Mode":"PIP Mode"))})}}),e.on("destroy",s),{name:"artplayerPluginDocumentPip",get isSupported(){return n},get isActive(){return!!p.win},open:f,close:s,toggle:h}}}i.defineInteropFlag(n),i.export(n,"default",()=>o),"undefined"!=typeof window&&(window.artplayerPluginDocumentPip=o)},{"@parcel/tranLine truncated
@@ -5,4 +5,4 @@
* (c) 2017-2025 Harvey Zack
* Released under the MIT License.
*/
!function(e,t,r,n,o,i,c,a){var u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},l="function"==typeof u[n]&&u[n],s=l.i||{},f=l.cache||{},p="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function d(t,r){if(!f[t]){if(!e[t]){if(o[t])return o[t];var i="function"==typeof u[n]&&u[n];if(!r&&i)return i(t,!0);if(l)return l(t,!0);if(p&&"string"==typeof t)return p(t);var c=Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}s.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},s.cache={};var a=f[t]=new d.Module(t);e[t][0].call(a.exports,s,a,a.exports,u)}return f[t].exports;function s(e){var t=s.resolve(e);return!1===t?{}:d(t)}}d.isParcelRequire=!0,d.Module=function(e){this.id=e,this.bundle=d,this.require=p,this.exports={}},d.modules=e,d.cache=f,d.parent=l,d.distDir=void 0,d.publicUrl=void 0,d.devServer=void 0,d.i=s,d.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(d,"root",{get:function(){return u[n]}}),u[n]=d;for(var y=0;y<t.length;y++)d(t[y]);if(r){var h=d(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=h:"function"==typeof define&&define.amd&&define(function(){return h})}}({"5Wzsp":[function(e,t,r,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r),o.export(r,"default",function(){return u});var i=e("@swc/helpers/cjs/_async_to_generator.cjs"),c=e("@swc/helpers/cjs/_object_spread.cjs"),a=e("@swc/helpers/cjs/_ts_generator.cjs");function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,c._)({width:480,height:270,fallbackToVideoPiP:!0,placeholder:"Playing in Document Picture-in-Picture"},e);return function(e){var r,n="documentPictureInPicture"in window&&"function"==typeof(null==(r=window.documentPictureInPicture)?void 0:r.requestWindow),o=e.proxy,c=e.icons,u=e.i18n,l=e.template.$container,s=e.constructor.utils,f=s.append,p=s.tooltip,d=s.addClass,y=s.removeClass,h={win:null,originalParent:null,originalNext:null,currentDoc:null,placeholder:null};function _(){return(0,i._)(function(){var r,o,i,c,u,s;return(0,a._)(this,function(a){switch(a.label){case 0:if(!n&&t.fallbackToVideoPiP)return e.pip=!0,console.warn("[artplayer-plugin-document-pip] Document Picture-in-Picture is not supported, falling back to Video Picture-in-Picture"),[2];if(h.win)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,window.documentPictureInPicture.requestWindow({width:t.width,height:t.height})];case 2:h.win=r=a.sent(),h.currentDoc=r.document,h.placeholder=document.createElement("div"),h.placeholder.className="artplayer-pip-placeholder",h.placeholder.style.cssText="display:flex;justify-content:center;align-items:center;width:100%;height:100%;",h.placeholder.textContent=t.placeholder,h.originalParent=l.parentNode,h.originalNext=l.nextSibling,h.originalParent.insertBefore(h.placeholder,h.originalNext),(o=r.document.createElement("div")).id="__art_dpip_root",r.document.body.appendChild(o);var f=r.document,p=f.createElement("style");if(p.textContent="\n html, body { margin:0; padding:0; width:100%; height:100%; background:#000; overflow:hidden; }\n #__art_dpip_root { position:absolute; inset:0; display:flex; }\n #__art_dpip_root > * { width:100% !important; height:100% !important; }\n ",f.head.appendChild(p),!f.querySelector('meta[name="viewport"]')){var y=f.createElement("meta");y.name="viewport",y.content="width=device-width,initial-scale=1",f.head.appendChild(y)}try{document.querySelectorAll('link[rel="stylesheet"]').forEach(function(e){var t=f.createElement("link");t.rel="stylesheet",t.href=e.href,e.media&&(t.media=e.media),e.crossOrigin&&(t.crossOrigin=e.crossOrigin),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),f.head.appendChild(t)})}catch(e){}try{document.querySelectorAll("style").forEach(function(e){var t=f.createElement("style");t.textContent=e.textContent,f.head.appendChild(t)})}catch(e){}return i=r.document.adoptNode(l),o.appendChild(i),h.currentDoc=r.document,c=function(){var t;return null==(t=e.resize)?void 0:t.call(e)},u=function(){return v()},r.addEventListener("resize",c),r.addEventListener("pagehide",u),r.addEventListener("unload",u),h.cleanup=function(){r.removeEventListener("resize",c),r.removeEventListener("pagehide",u),r.removeEventListener("unload",u)},d(l,"artplayer-document-pip"),e.emit("document-pip",!0),[3,4];case 3:return s=a.sent(),e.notice.show="Document Picture-in-Picture open failed",console.warn("[artplayer-plugin-document-pip] open failed:",s),[3,4];case 4:return[2]}})})()}function v(){if(!n&&t.fallbackToVideoPiP){e.pip=!1;return}if(h.win)try{var r;if(null==(r=h.cleanup)||r.call(h),h.placeholder){var o=h.placeholder.ownerDocument||document,i=o.adoptNode(l);h.originalParent.insertBefore(i,h.placeholder),h.placeholder.remove(),h.placeholder=null,h.currentDoc=o}h.win.close(),h.win=null,y(l,"artplayer-document-pip"),e.emit("document-pipLine truncated
!function(e,t,r,n,o,i,c,a){var u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},l="function"==typeof u[n]&&u[n],s=l.i||{},f=l.cache||{},p="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function d(t,r){if(!f[t]){if(!e[t]){if(o[t])return o[t];var i="function"==typeof u[n]&&u[n];if(!r&&i)return i(t,!0);if(l)return l(t,!0);if(p&&"string"==typeof t)return p(t);var c=Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}s.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},s.cache={};var a=f[t]=new d.Module(t);e[t][0].call(a.exports,s,a,a.exports,u)}return f[t].exports;function s(e){var t=s.resolve(e);return!1===t?{}:d(t)}}d.isParcelRequire=!0,d.Module=function(e){this.id=e,this.bundle=d,this.require=p,this.exports={}},d.modules=e,d.cache=f,d.parent=l,d.distDir=void 0,d.publicUrl=void 0,d.devServer=void 0,d.i=s,d.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(d,"root",{get:function(){return u[n]}}),u[n]=d;for(var y=0;y<t.length;y++)d(t[y]);if(r){var h=d(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=h:"function"==typeof define&&define.amd&&define(function(){return h})}}({"5Wzsp":[function(e,t,r,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r),o.export(r,"default",function(){return u});var i=e("@swc/helpers/cjs/_async_to_generator.cjs"),c=e("@swc/helpers/cjs/_object_spread.cjs"),a=e("@swc/helpers/cjs/_ts_generator.cjs");function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,c._)({width:480,height:270,fallbackToVideoPiP:!0,placeholder:"Playing in Document Picture-in-Picture"},e);return function(e){var r,n="documentPictureInPicture"in window&&"function"==typeof(null==(r=window.documentPictureInPicture)?void 0:r.requestWindow),o=e.proxy,c=e.icons,u=e.i18n,l=e.template.$container,s=e.constructor.utils,f=s.append,p=s.tooltip,d=s.addClass,y=s.removeClass,h={win:null,originalParent:null,originalNext:null,currentDoc:null,placeholder:null};function _(){return(0,i._)(function(){var r,o,i,c,u,s;return(0,a._)(this,function(a){switch(a.label){case 0:if(!n&&t.fallbackToVideoPiP)return e.pip=!0,console.warn("[artplayer-plugin-document-pip] Document Picture-in-Picture is not supported, falling back to Video Picture-in-Picture"),[2];if(h.win)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,window.documentPictureInPicture.requestWindow({width:t.width,height:t.height})];case 2:h.win=r=a.sent(),h.currentDoc=r.document,h.placeholder=document.createElement("div"),h.placeholder.className="artplayer-pip-placeholder",h.placeholder.style.cssText="display:flex;justify-content:center;align-items:center;width:100%;height:100%;",h.placeholder.textContent=t.placeholder,h.originalParent=l.parentNode,h.originalNext=l.nextSibling,h.originalParent.insertBefore(h.placeholder,h.originalNext),(o=r.document.createElement("div")).id="__art_dpip_root",r.document.body.appendChild(o);var f=r.document,p=f.createElement("style");if(p.textContent="\n html, body { margin:0; padding:0; width:100%; height:100%; background:#000; overflow:hidden; }\n #__art_dpip_root { position:absolute; inset:0; display:flex; }\n #__art_dpip_root > * { width:100% !important; height:100% !important; }\n ",f.head.appendChild(p),!f.querySelector('meta[name="viewport"]')){var y=f.createElement("meta");y.name="viewport",y.content="width=device-width,initial-scale=1",f.head.appendChild(y)}try{document.querySelectorAll('link[rel="stylesheet"]').forEach(function(e){var t=f.createElement("link");t.rel="stylesheet",t.href=e.href,e.media&&(t.media=e.media),e.crossOrigin&&(t.crossOrigin=e.crossOrigin),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),f.head.appendChild(t)})}catch(e){}try{document.querySelectorAll("style").forEach(function(e){var t=f.createElement("style");t.textContent=e.textContent,f.head.appendChild(t)})}catch(e){}return i=r.document.adoptNode(l),o.appendChild(i),h.currentDoc=r.document,c=function(){var t;return null==(t=e.resize)?void 0:t.call(e)},u=function(){return v()},r.addEventListener("resize",c),r.addEventListener("pagehide",u),r.addEventListener("unload",u),h.cleanup=function(){r.removeEventListener("resize",c),r.removeEventListener("pagehide",u),r.removeEventListener("unload",u)},d(l,"artplayer-document-pip"),e.emit("document-pip",!0),[3,4];case 3:return s=a.sent(),e.notice.show="Document Picture-in-Picture open failed",console.warn("[artplayer-plugin-document-pip] open failed:",s),[3,4];case 4:return[2]}})})()}function v(){if(h.win)try{var t;if(null==(t=h.cleanup)||t.call(h),h.placeholder){var r=h.placeholder.ownerDocument||document,n=r.adoptNode(l);h.originalParent.insertBefore(n,h.placeholder),h.placeholder.remove(),h.placeholder=null,h.currentDoc=r}h.win.close(),h.win=null,y(l,"artplayer-document-pip"),e.emit("document-pip",!1)}catch(t){e.notice.show="Document PicturLine truncated
@@ -8,7 +8,7 @@ export default function artplayerPluginDocumentPip(userOptions = {}) {
}
return (art) => {
const dpipOK = 'documentPictureInPicture' in window
const isSupported = 'documentPictureInPicture' in window
&& typeof window.documentPictureInPicture?.requestWindow === 'function'
const { proxy, icons, i18n, template: { $container }, constructor: { utils: { append, tooltip, addClass, removeClass } } } = art
@@ -63,7 +63,7 @@ export default function artplayerPluginDocumentPip(userOptions = {}) {
}
async function open() {
if (!dpipOK && options.fallbackToVideoPiP) {
if (!isSupported && options.fallbackToVideoPiP) {
art.pip = true
console.warn('[artplayer-plugin-document-pip] Document Picture-in-Picture is not supported, falling back to Video Picture-in-Picture')
return
@@ -133,11 +133,6 @@ export default function artplayerPluginDocumentPip(userOptions = {}) {
}
function close() {
if (!dpipOK && options.fallbackToVideoPiP) {
art.pip = false
return
}
if (!state.win)
return
try {
@@ -181,7 +176,8 @@ export default function artplayerPluginDocumentPip(userOptions = {}) {
return {
name: 'artplayerPluginDocumentPip',
state,
get isSupported() { return isSupported },
get isActive() { return !!state.win },
open,
close,
toggle,
@@ -9,16 +9,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