mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
1 line
963 B
JavaScript
1 line
963 B
JavaScript
(()=>{return(e,i)=>{const n=[{name:"常规"},{name:"宽屏",action:()=>{$(".bilibili-player-video-btn-widescreen").click()}},{name:"网页全屏",action:()=>{$(".bilibili-player-video-web-fullscreen").click()}},{name:"全屏",action:()=>{$(".bilibili-player-video-btn-fullscreen").click()}}];SpinQuery.any(()=>$(".gui-settings-dropdown:has(input[key=defaultPlayerMode])"),e=>{const i=e.find("ul");const l=e.find("input");Object.values(n).forEach(e=>{$(`<li>${e.name}</li>`).appendTo(i).on("click",()=>{l.val(e.name).trigger("input").change()})})});new SpinQuery(()=>$(".bilibili-player-video"),e=>e.length>0&&$("video").length>0&&$("video").prop("duration"),()=>{const i=document.querySelector("video");const l=n.find(i=>i.name===e.defaultPlayerMode);if(l.name==="常规"){return}if(l.name!=="全屏"){const e=()=>{if(l&&$("#bilibiliPlayer[class*=mode-]").length===0){l.action()}i.removeEventListener("play",e)};i.addEventListener("play",e)}else{}}).start()}})(); |