Bilibili-Evolved/min/live-pip.min.js
2020-03-28 21:12:20 +08:00

1 line
571 B
JavaScript

(()=>{return(t,e)=>{return{widget:{content:`\n<button class="gui-settings-flat-button" id="live-pip" style="transform: scale(0.9);">\n<i class="mdi mdi-24px mdi-picture-in-picture-bottom-right"></i>\n<span>画中画</span>\n</button>\n`,condition:()=>{return document.URL.match(/https:\/\/live.bilibili.com\/([\d]+)/)&&"requestPictureInPicture"in HTMLVideoElement.prototype},success:()=>{dq("#live-pip").addEventListener("click",()=>{if(document.pictureInPictureElement===dq("video")){document.exitPictureInPicture()}else{dq("video").requestPictureInPicture()}})}}}}})();