!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports["video/player/show-cover"]=o():e["video/player/show-cover"]=o()}(self,(function(){return function(){var e,o,t={754:function(e,o,t){var n=t(355)((function(e){return e[1]}));n.push([e.id,'.bpx-player-video-wrap::after,\n.bilibili-player-video::after {\n position: absolute;\n content: "";\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: none;\n background: black var(--cover-url) center no-repeat;\n background-size: contain;\n pointer-events: none;\n z-index: 10;\n}\n\n.bpx-player-container.bpx-state-paused .bpx-player-video-wrap::after {\n display: block;\n}\n\n.bilibili-player-area.video-state-pause .bilibili-player-video::after {\n display: block;\n}',""]),e.exports=n},355:function(e){"use strict"; // eslint-disable-next-line func-names e.exports=function(e){var o=[];return o.toString=function(){return this.map((function(o){var t=e(o);return o[2]?"@media ".concat(o[2]," {").concat(t,"}"):t})).join("")}, // eslint-disable-next-line func-names o.i=function(e,t,n){"string"==typeof e&&( // eslint-disable-next-line no-param-reassign e=[[null,e,""]]);var r={};if(n)for(var i=0;i{let e;const n=()=>document.body.style.removeProperty("--cover-url"),i=await(0,t.isBwpVideo)()?BwpElement.prototype:HTMLVideoElement.prototype,a=dq(".bpx-player-video-wrap"),c=Boolean(a);(0,t.createHook)(i,"play",(()=>(n(),!0))),c&&(0,o.videoChange)((()=>{console.debug("isBpxPlayer");const e=dq(".bpx-player-video-wrap video");e?(0,t.createHook)(e,"play",(()=>(n(),!0))):console.warn("bpx player not found")}));(0,o.videoChange)((async o=>{let{aid:t}=o;if(!t)return void console.warn("[播放前显示封面] 未找到av号");if(t===e)return;e=t;const{VideoInfo:n}=await Promise.resolve().then(r.t.bind(r,77,23)),i=new n(t);await i.fetchInfo(),document.body.style.setProperty("--cover-url",`url('${i.coverUrl}')`)}))},instantStyles:[{name:"showCoverBeforePlay",style:()=>Promise.resolve().then(r.t.bind(r,179,23))}],description:{"zh-CN":"在视频开始播放前, 在播放器中显示封面."},tags:[componentsTags.video],commitHash:"59c04ba07816fc5ab6aa55f6c54bd53c07136c35",coreVersion:"2.5.0"})}(),i=i.component}()}));