mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 19:06:15 -08:00
feat: enhance document Picture-in-Picture functionality with sleep delay
- Added sleep utility to introduce a delay before emitting resize events after opening and closing the document Picture-in-Picture. - Updated the close function to be asynchronous for better handling of the sleep delay.
This commit is contained in:
1 parent
9e73b0aec9
commit
40b66b4b68
5 files changed
+10
-8
No files matched your search
@@ -5,4 +5,4 @@
|
||||
* (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||{},s="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function f(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(s&&"string"==typeof t)return s(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 f.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?{}:f(t)}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.require=s,this.exports={}},f.modules=e,f.cache=p,f.parent=a,f.distDir=void 0,f.publicUrl=void 0,f.devServer=void 0,f.i=u,f.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(f,"root",{get:function(){return c[r]}}),c[r]=f;for(var m=0;m<t.length;m++)f(t[m]);if(n){var h=f(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=h:"function"==typeof define&&define.amd&&define(function(){return h})}}({eo8f0:[function(e,t,n,r){var i=e("@parcel/transformer-js/src/esmodule-helpers.js");i.defineInteropFlag(n),i.export(n,"default",()=>d);var o=e("bundle-text:./style.less"),l=i.interopDefault(o);function d(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:{$player: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 s(){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-document-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=()=>f();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.events.bindGlobalEvents?.(),e.emit("resize"),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 f(){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.events.bindGlobalEvents?.(),e.emit("resize"),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 m(){p.win?f():s()}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",m),e.on("document-pip",e=>{c(t,o.get(e?"Exit PIP Mode":"PIP Mode"))})}}),e.on("destroy",f),{name:"artplayerPluginDocumentPip",get isSLine 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:{},a="function"==typeof c[r]&&c[r],u=a.i||{},p=a.cache||{},s="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function f(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(s&&"string"==typeof t)return s(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 f.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?{}:f(t)}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.require=s,this.exports={}},f.modules=e,f.cache=p,f.parent=a,f.distDir=void 0,f.publicUrl=void 0,f.devServer=void 0,f.i=u,f.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(f,"root",{get:function(){return c[r]}}),c[r]=f;for(var m=0;m<t.length;m++)f(t[m]);if(n){var h=f(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=h:"function"==typeof define&&define.amd&&define(function(){return h})}}({eo8f0:[function(e,t,n,r){var i=e("@parcel/transformer-js/src/esmodule-helpers.js");i.defineInteropFlag(n),i.export(n,"default",()=>d);var o=e("bundle-text:./style.less"),l=i.interopDefault(o);function d(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:{$player:l},constructor:{utils:{append:d,tooltip:c,addClass:a,removeClass:u,sleep:p}}}=e,s={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(!s.win)try{let n=await window.documentPictureInPicture.requestWindow({width:t.width,height:t.height});s.win=n,s.currentDoc=n.document,s.placeholder=document.createElement("div"),s.placeholder.className="artplayer-document-pip-placeholder",s.placeholder.style.cssText="display:flex;justify-content:center;align-items:center;width:100%;height:100%;",s.placeholder.textContent=t.placeholder,s.originalParent=l.parentNode,s.originalNext=l.nextSibling,s.originalParent.insertBefore(s.placeholder,s.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),s.currentDoc=n.document;let c=()=>e.resize?.(),u=()=>m();n.addEventListener("resize",c),n.addEventListener("pagehide",u),n.addEventListener("unload",u),s.cleanup=()=>{n.removeEventListener("resize",c),n.removeEventListener("pagehide",u),n.removeEventListener("unload",u)},a(l,"artplayer-document-pip"),e.events.bindGlobalEvents?.(),e.emit("document-pip",!0),await p(100),e.emit("resize")}catch(t){e.notice.show="Document Picture-in-Picture open failed",console.warn("[artplayer-plugin-document-pip] open failed:",t)}}async function m(){if(s.win)try{s.cleanup?.(),function(){if(!s.placeholder)return;let e=s.placeholder.ownerDocument||document,t=e.adoptNode(l);s.originalParent.insertBefore(t,s.placeholder),s.placeholder.remove(),s.placeholder=null,s.currentDoc=e}(),s.win.close(),s.win=null,u(l,"artplayer-document-pip"),e.events.bindGlobalEvents?.(),e.emit("document-pip",!1),await p(100),e.emit("resize")}catch(t){e.notice.show="Document Picture-in-Picture close failed",console.warn("[artplayer-plugin-document-pip] close failed:",t)}}function h(){s.win?m():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",m),{nLine 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 s});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"),u=e("bundle-text:./style.less"),l=o.interopDefault(u);function s(){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.$player,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,f,p;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=i=a.sent(),h.currentDoc=i.document,h.placeholder=document.createElement("div"),h.placeholder.className="artplayer-document-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),(c=i.document.createElement("div")).id="__art_dpip_root",i.document.body.appendChild(c);var y=i.document,_=y.createElement("style");if(_.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 ",y.head.appendChild(_),!y.querySelector('meta[name="viewport"]')){var v=y.createElement("meta");v.name="viewport",v.content="width=device-width,initial-scale=1",y.head.appendChild(v)}try{document.querySelectorAll('link[rel="stylesheet"]').forEach(function(e){var t=y.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),y.head.appendChild(t)})}catch(e){}try{document.querySelectorAll("style").forEach(function(e){var t=y.createElement("style");t.textContent=e.textContent,y.head.appendChild(t)})}catch(e){}return u=i.document.adoptNode(l),c.appendChild(u),h.currentDoc=i.document,s=function(){var t;return null==(t=e.resize)?void 0:t.call(e)},f=function(){return m()},i.addEventListener("resize",s),i.addEventListener("pagehide",f),i.addEventListener("unload",f),h.cleanup=function(){i.removeEventListener("resize",s),i.removeEventListener("pagehide",f),i.removeEventListener("unload",f)},d(l,"artplayer-document-pip"),null==(r=(o=e.events).bindGlobalEvents)||r.call(o),e.emit("resize"),e.emit("document-pip",!0),[3,4];case 3:return p=a.sent(),e.notice.show="Document Picture-in-Picture open failed",console.warn("[artplayer-plugin-document-pip] open failed:",p),[3,4];case 4:return[2]}})})()}function m(){if(h.win)try{var t,r,n;if(null==(t=h.cleanup)||t.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=nullLine 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 s});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"),u=e("bundle-text:./style.less"),l=o.interopDefault(u);function s(){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.$player,s=e.constructor.utils,f=s.append,p=s.tooltip,d=s.addClass,y=s.removeClass,h=s.sleep,_={win:null,originalParent:null,originalNext:null,currentDoc:null,placeholder:null};function m(){return(0,i._)(function(){var r,o,i,c,u,s,f,p;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(_.win)return[2];a.label=1;case 1:return a.trys.push([1,4,,5]),[4,window.documentPictureInPicture.requestWindow({width:t.width,height:t.height})];case 2:_.win=i=a.sent(),_.currentDoc=i.document,_.placeholder=document.createElement("div"),_.placeholder.className="artplayer-document-pip-placeholder",_.placeholder.style.cssText="display:flex;justify-content:center;align-items:center;width:100%;height:100%;",_.placeholder.textContent=t.placeholder,_.originalParent=l.parentNode,_.originalNext=l.nextSibling,_.originalParent.insertBefore(_.placeholder,_.originalNext),(c=i.document.createElement("div")).id="__art_dpip_root",i.document.body.appendChild(c);var y=i.document,m=y.createElement("style");if(m.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 ",y.head.appendChild(m),!y.querySelector('meta[name="viewport"]')){var b=y.createElement("meta");b.name="viewport",b.content="width=device-width,initial-scale=1",y.head.appendChild(b)}try{document.querySelectorAll('link[rel="stylesheet"]').forEach(function(e){var t=y.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),y.head.appendChild(t)})}catch(e){}try{document.querySelectorAll("style").forEach(function(e){var t=y.createElement("style");t.textContent=e.textContent,y.head.appendChild(t)})}catch(e){}return u=i.document.adoptNode(l),c.appendChild(u),_.currentDoc=i.document,s=function(){var t;return null==(t=e.resize)?void 0:t.call(e)},f=function(){return v()},i.addEventListener("resize",s),i.addEventListener("pagehide",f),i.addEventListener("unload",f),_.cleanup=function(){i.removeEventListener("resize",s),i.removeEventListener("pagehide",f),i.removeEventListener("unload",f)},d(l,"artplayer-document-pip"),null==(r=(o=e.events).bindGlobalEvents)||r.call(o),e.emit("document-pip",!0),[4,h(100)];case 3:return a.sent(),e.emit("resize"),[3,5];case 4:return p=a.sent(),e.notice.show="Document Picture-in-Picture open failed",console.warn("[artplayer-plugin-document-pip] open failed:",p),[3,5];case 5:return[2]}})})()}function v(){return(0,i._)(function(){var t,r,n,o;return(0,a._)(this,function(i){switch(i.label){case 0:if(!_.win)return[2];i.label=1;case 1:if(i.trys.push([1,3,,4]),null==(t=_.cleanup)||t.cLine 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||{},s="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function f(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(s&&"string"==typeof t)return s(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 f.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?{}:f(t)}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.require=s,this.exports={}},f.modules=e,f.cache=p,f.parent=a,f.distDir=void 0,f.publicUrl=void 0,f.devServer=void 0,f.i=u,f.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(f,"root",{get:function(){return c[r]}}),c[r]=f;for(var m=0;m<t.length;m++)f(t[m]);if(n){var h=f(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=h:"function"==typeof define&&define.amd&&define(function(){return h})}}({bKI9O:[function(e,t,n,r){var i=e("@parcel/transformer-js/src/esmodule-helpers.js");i.defineInteropFlag(n),i.export(n,"default",()=>d);var o=e("bundle-text:./style.less"),l=i.interopDefault(o);function d(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:{$player: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 s(){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-document-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=()=>f();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.events.bindGlobalEvents?.(),e.emit("resize"),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 f(){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.events.bindGlobalEvents?.(),e.emit("resize"),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 m(){p.win?f():s()}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",m),e.on("document-pip",e=>{c(t,o.get(e?"Exit PIP Mode":"PIP Mode"))})}}),e.on("destroy",f),{name:"artplayerPluginDocumentPip",get isSLine truncated
|
||||
!function(e,t,n,r,i,o,l,d){var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},c="function"==typeof a[r]&&a[r],u=c.i||{},p=c.cache||{},s="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function f(t,n){if(!p[t]){if(!e[t]){if(i[t])return i[t];var o="function"==typeof a[r]&&a[r];if(!n&&o)return o(t,!0);if(c)return c(t,!0);if(s&&"string"==typeof t)return s(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 f.Module(t);e[t][0].call(d.exports,u,d,d.exports,a)}return p[t].exports;function u(e){var t=u.resolve(e);return!1===t?{}:f(t)}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.require=s,this.exports={}},f.modules=e,f.cache=p,f.parent=c,f.distDir=void 0,f.publicUrl=void 0,f.devServer=void 0,f.i=u,f.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(f,"root",{get:function(){return a[r]}}),a[r]=f;for(var m=0;m<t.length;m++)f(t[m]);if(n){var h=f(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=h:"function"==typeof define&&define.amd&&define(function(){return h})}}({bKI9O:[function(e,t,n,r){var i=e("@parcel/transformer-js/src/esmodule-helpers.js");i.defineInteropFlag(n),i.export(n,"default",()=>d);var o=e("bundle-text:./style.less"),l=i.interopDefault(o);function d(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:{$player:l},constructor:{utils:{append:d,tooltip:a,addClass:c,removeClass:u,sleep:p}}}=e,s={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(!s.win)try{let n=await window.documentPictureInPicture.requestWindow({width:t.width,height:t.height});s.win=n,s.currentDoc=n.document,s.placeholder=document.createElement("div"),s.placeholder.className="artplayer-document-pip-placeholder",s.placeholder.style.cssText="display:flex;justify-content:center;align-items:center;width:100%;height:100%;",s.placeholder.textContent=t.placeholder,s.originalParent=l.parentNode,s.originalNext=l.nextSibling,s.originalParent.insertBefore(s.placeholder,s.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),s.currentDoc=n.document;let a=()=>e.resize?.(),u=()=>m();n.addEventListener("resize",a),n.addEventListener("pagehide",u),n.addEventListener("unload",u),s.cleanup=()=>{n.removeEventListener("resize",a),n.removeEventListener("pagehide",u),n.removeEventListener("unload",u)},c(l,"artplayer-document-pip"),e.events.bindGlobalEvents?.(),e.emit("document-pip",!0),await p(100),e.emit("resize")}catch(t){e.notice.show="Document Picture-in-Picture open failed",console.warn("[artplayer-plugin-document-pip] open failed:",t)}}async function m(){if(s.win)try{s.cleanup?.(),function(){if(!s.placeholder)return;let e=s.placeholder.ownerDocument||document,t=e.adoptNode(l);s.originalParent.insertBefore(t,s.placeholder),s.placeholder.remove(),s.placeholder=null,s.currentDoc=e}(),s.win.close(),s.win=null,u(l,"artplayer-document-pip"),e.events.bindGlobalEvents?.(),e.emit("document-pip",!1),await p(100),e.emit("resize")}catch(t){e.notice.show="Document Picture-in-Picture close failed",console.warn("[artplayer-plugin-document-pip] close failed:",t)}}function h(){s.win?m():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=>{a(t,o.get(e?"Exit PIP Mode":"PIP Mode"))})}}),e.on("destroy",m),{nLine truncated
|
||||
//# sourceMappingURL=artplayer-plugin-document-pip.mjs.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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AAS,UAAU,CACrB,SAAS,gBAAgB,CAAC,mBAAoB,KAC5C,SAAS,IAAI,CAAC,WAAW,CAAC,EAC5B,GAGC,AAAA,CAAA,SAAS,IAAI,EAAI,SAAS,eAAc,AAAd,EAAiB,WAAW,CAAC,IAG5D,EAAO,WAAW,CAAG,EAAA,OAAK,AAC5B,C,E,C,2B,Q,iD,O,E,C,M,C,S,C,C,C,C,C,C,C,ECvNA,EAAO,OAAO,CAAG,sF,E,C,E,C,Q,C,S,C,C,C,C,C,C,C,ECAjB,EAAQ,cAAc,CAAG,SAAU,CAAC,EAClC,OAAO,GAAK,EAAE,UAAU,CAAG,EAAI,CAAC,QAAS,CAAC,CAC5C,EAEA,EAAQ,iBAAiB,CAALine truncated
|
||||
@@ -13,7 +13,7 @@ export default function artplayerPluginDocumentPip(userOptions = {}) {
|
||||
const isSupported = 'documentPictureInPicture' in window
|
||||
&& typeof window.documentPictureInPicture?.requestWindow === 'function'
|
||||
|
||||
const { proxy, icons, i18n, template: { $player }, constructor: { utils: { append, tooltip, addClass, removeClass } } } = art
|
||||
const { proxy, icons, i18n, template: { $player }, constructor: { utils: { append, tooltip, addClass, removeClass, sleep } } } = art
|
||||
|
||||
const state = {
|
||||
win: null,
|
||||
@@ -116,8 +116,9 @@ export default function artplayerPluginDocumentPip(userOptions = {}) {
|
||||
|
||||
addClass($player, 'artplayer-document-pip')
|
||||
art.events.bindGlobalEvents?.()
|
||||
art.emit('resize')
|
||||
art.emit('document-pip', true)
|
||||
await sleep(100)
|
||||
art.emit('resize')
|
||||
}
|
||||
catch (err) {
|
||||
art.notice.show = 'Document Picture-in-Picture open failed'
|
||||
@@ -136,7 +137,7 @@ export default function artplayerPluginDocumentPip(userOptions = {}) {
|
||||
state.currentDoc = backDoc
|
||||
}
|
||||
|
||||
function close() {
|
||||
async function close() {
|
||||
if (!state.win)
|
||||
return
|
||||
try {
|
||||
@@ -146,8 +147,9 @@ export default function artplayerPluginDocumentPip(userOptions = {}) {
|
||||
state.win = null
|
||||
removeClass($player, 'artplayer-document-pip')
|
||||
art.events.bindGlobalEvents?.()
|
||||
art.emit('resize')
|
||||
art.emit('document-pip', false)
|
||||
await sleep(100)
|
||||
art.emit('resize')
|
||||
}
|
||||
catch (err) {
|
||||
art.notice.show = 'Document Picture-in-Picture close failed'
|
||||
|
||||
Reference in new issue
Block a user