PageSourceSearch

https://shared.sx/assets/VideoPlayer-DzJ9PfRL.js

js shared.sx collected 2026-10-03 22:07:03 UTC 9,444 bytes, 1 lines download raw bytes

1import{k as ce,r,f as R,L as I,A as ve,H as de,l as u,o as i,q as a,D as M,p as fe,N as A,Q as me,F as pe,n as he,S as ye,t as C,O as ke}from"./vendor-D0Q8KstH.js";import{H as v}from"./hls-Bm3F2dIq.js";const ge=["id"],be={key:0,class:"processing-overlay"},Ee={class:"controls-top"},Te={key:0,class:"quality-selector"},_e=["value"],Le={class:"controls-bottom"},we={class:"progress-container"},Se={class:"controls-row"},Re={key:0,class:"icon"},Me={key:1,class:"icon"},Fe={class:"time-display"},Ce={class:"volume-control"},Pe={key:0,class:"icon"},Ue={key:1,class:"icon"},$e={key:2,class:"icon"},Ne={key:0,class:"icon"},Oe={key:1,class:"icon"},Ve={key:2,class:"locked-overlay"},He={key:3,class:"playback-error-overlay"},Ie={class:"playback-error-content"},Ae={class:"error-text"},D=3,De={__name:"VideoPlayer",props:{manifestUrl:{type:String,required:!0},mediaId:{type:String,required:!0},isLocked:{type:Boolean,default:!1},processingStatus:{type:String,default:"COMPLETED"},availableResolutions:{type:Array,default:()=>[]},shareToken:{type:String,default:""}},emits:["ready","error"],setup(b,{emit:x}){const s=b,E=x,o=r(null),P=R(()=>ae(s.processingStatus,s.manifestUrl,s.availableResolutions)),U=r([...s.availableResolutions]),T=r("auto"),_=r(""),t=r(null),L=r(!0),k=r(null),f=r(!1),$=r(0),w=r(0),m=r(1),S=r(!1),p=r(!1),d=r(""),g=r(0);I(()=>s.availableResolutions,l=>{U.value=[...l]});const q=R(()=>w.value===0?0:$.value/w.value*100),B=R(()=>O($.value)),Q=R(()=>O(w.value));function O(l){if(!l||isNaN(l))return"0:00";const e=Math.floor(l/60),n=Math.floor(l%60);return`${e}:${n.toString().padStart(2,"0")}`}function F(){L.value=!0,k.value&&clearTimeout(k.value),f.value&&(k.value=setTimeout(()=>{L.value=!1},3e3))}function z(){f.value&&(L.value=!1)}function W(){F()}function X(){z()}function G(){F()}function K(){f.value&&(k.value=setTimeout(()=>{L.value=!1},3e3))}function V(){o.value&&(f.value?o.value.pause():o.value.play())}function j(){f.value=!0,F()}function Y(){f.value=!1,F()}function J(){o.value&&($.value=o.value.currentTime,w.value=o.value.duration||0)}function Z(){o.value&&(m.value=o.value.volume,S.value=o.value.muted)}function ee(){o.value&&(o.value.volume=m.value,o.value.muted=!1,S.value=!1)}function le(){o.value&&(o.value.muted=!o.value.muted,S.value=o.value.muted)}function oe(l){if(!o.value)return;const e=l.currentTarget.getBoundingClientRect(),n=l.clientX-e.left,c=e.width,y=n/c;o.value.currentTime=y*w.value}function te(){const l=o.value?.parentElement,e=o.value;if(!l||!e)return;document.fullscreenElement||document.webkitFullscreenElement?document.exitFullscreen?document.exitFullscreen().then(()=>{p.value=!1}).catch(c=>{console.error("Error exiting fullscreen:",c)}):document.webkitExitFullscreen&&(document.webkitExitFullscreen(),p.value=!1):l.requestFullscreen?l.requestFullscreen().then(()=>{p.value=!0}).catch(c=>{console.error("Error entering fullscreen:",c)}):l.webkitRequestFullscreen?(l.webkitRequestFullscreen(),p.value=!0):e.webkitEnterFullscreen?(e.webkitEnterFullscreen(),p.value=!0):console.warn("Fullscreen is not supported on this device")}function H(){p.value=!!(document.fullscreenElement||document.webkitFullscreenElement)}const h=R(()=>s.manifestUrl||"");I(()=>s.manifestUrl,l=>{if(!l){t.value&&(t.value.destroy(),t.value=null),o.value&&(o.value.removeAttribute("src"),o.value.load());return}N()});function N(){if(o.value){if(d.value="",g.value=0,t.value&&(t.value.destroy(),t.value=null),!h.value){console.warn("No manifest URL provided for HLS initialization");return}if(!h.value.includes(".m3u8")&&!h.value.includes("/hls/")&&(console.warn("Manifest URL does not appear to be an HLS manifest:",h.value),console.warn("Expected URL format: /api/media/{id}/manifest.m3u8 or /api/media/{id}/hls/manifest/")),v.isSupported())console.log("Using hls.js for playback:",h.value),t.value=new v({startLevel:-1,manifestLoadingTimeOut:3e4,manifestLoadingMaxRetry:3,levelLoadingTimeOut:3e4,fragLoadingTimeOut:3e4,xhrSetup:function(l,e){l.withCredentials=!0},pLoader:s.shareToken?class{constructor(e){const n=v.DefaultConfig.loader;this.loader=new n(e)}abort(){return this.loader.abort()}destroy(){return this.loader.destroy()}load(e,n,c){if(s.shareToken&&!e.url.includes("share_token=")){const y=e.url.includes("?")?"&":"?";e.url=`${e.url}${y}share_token=${s.shareToken}`}return this.loader.load(e,n,c)}}:void 0,fLoader:s.shareToken?class{constructor(e){const n=v.DefaultConfig.loader;this.loader=new n(e)}abort(){return this.loader.abort()}destroy(){return this.loader.destroy()}load(e,n,c){if(s.shareToken&&!e.url.includes("share_token=")){const y=e.url.includes("?")?"&":"?";e.url=`${e.url}${y}share_token=${s.shareToken}`}return this.loader.load(e,n,c)}}:void 0}),t.value.loadSource(h.value),t.value.attachMedia(o.value),t.value.on(v.Events.LEVEL_SWITCHED,(l,e)=>{const n=t.value.levels[e.level];n&&(_.value=`${n.height}p`,console.log(`Switched to ${_.value}`))}),t.value.on(v.Events.MANIFEST_PARSED,(l,e)=>{g.value=0,console.log("Manifest loaded successfully",e.levels.length,"levels")}),t.value.on(v.Events.ERROR,(l,e)=>{if(!(e.details==="bufferSeekOverHole"&&!e.fatal)&&(console.error("HLS error:",e),e.fatal))switch(e.type){case v.ErrorTypes.NETWORK_E
1RROR:if(g.value>=D){console.error("Network error retry limit reached, giving up"),t.value&&(t.value.destroy(),t.value=null),d.value="Unable to load this video (network error).",E("error",e);break}g.value++,console.warn(`Network error, attempting recovery (${g.value}/${D})...`),t.value&&t.value.startLoad();break;case v.ErrorTypes.MEDIA_ERROR:console.warn("Media error, attempting recovery..."),t.value.recoverMediaError();break;default:console.error("Fatal HLS error, destroying player:",e),t.value.destroy(),t.value=null,d.value="This video failed to play.",E("error",e);break}});else if(o.value.canPlayType("application/vnd.apple.mpegurl")){let l=h.value;s.shareToken&&!l.includes("share_token=")&&(l+=(l.includes("?")?"&":"?")+`share_token=${s.shareToken}`),console.log("Using native HLS playback:",l),o.value.src=l}else console.error("HLS not supported in this browser"),d.value="Your browser cannot play this video.",E("error",new Error("HLS not supported"))}}function ne(){if(t.value)if(T.value==="auto")t.value.currentLevel=-1,_.value="Auto";else{const l=parseInt(T.value.replace("p","")),e=t.value.levels.findIndex(n=>n.height===l);e!==-1&&(t.value.currentLevel=e,_.value=T.value)}}function ae(l,e,n){if(!l||l==="COMPLETED")return!1;const c=!!e,y=Array.isArray(n)&&n.length>0;return c||y?!1:["PENDING","PROCESSING"].includes(l)}function se(){E("ready")}function re(){if(console.log("Video can play"),t.value){const l=t.value.levels[t.value.currentLevel];l&&(_.value=`${l.height}p`)}}function ue(l){console.error("Video error:",l),!t.value&&o.value?.error&&(d.value="This video failed to play."),E("error",l)}function ie(){d.value="",g.value=0,N()}return ve(()=>{N(),o.value&&(m.value=o.value.volume,S.value=o.value.muted),document.addEventListener("fullscreenchange",H)}),de(()=>{t.value&&(t.value.destroy(),t.value=null),k.value&&clearTimeout(k.value),document.removeEventListener("fullscreenchange",H)}),(l,e)=>(i(),u("div",{class:"hls-player-container",onMousemove:W,onMouseleave:X,onTouchstart:G,onTouchend:K},[a("video",{ref_key:"videoElement",ref:o,id:`hls-player-${b.mediaId}`,autoplay:"",class:"hls-video",onLoadedmetadata:se,onCanplay:re,onError:ue,onPlay:j,onPause:Y,onTimeupdate:J,onVolumechange:Z,onClick:V},null,40,ge),P.value?(i(),u("div",be,[...e[2]||(e[2]=[a("div",{class:"processing-content"},[a("div",{class:"processing-spinner"}),a("div",{class:"processing-text"},"Processing video..."),a("div",{class:"processing-subtext"},"This may take a few minutes")],-1)])])):M("",!0),!P.value&&!b.isLocked?(i(),u("div",{key:1,class:fe(["custom-controls",{"controls-visible":L.value}])},[a("div",Ee,[U.value.length>1?(i(),u("div",Te,[A(a("select",{"onUpdate:modelValue":e[0]||(e[0]=n=>T.value=n),onChange:ne,class:"quality-dropdown"},[e[3]||(e[3]=a("option",{value:"auto"}
1,"Auto",-1)),(i(!0),u(pe,null,he(U.value,n=>(i(),u("option",{key:n,value:n},C(n),9,_e))),128))],544),[[me,T.value]])])):M("",!0)]),a("div",Le,[a("div",we,[a("div",{class:"progress-bar",onClick:oe},[a("div",{class:"progress-filled",style:ye({width:q.value+"%"})},null,4)])]),a("div",Se,[a("button",{onClick:V,class:"control-button play-pause-btn"},[f.value?(i(),u("span",Re,"⏸️")):(i(),u("span",Me,"▶️"))]),a("div",Fe,C(B.value)+" / "+C(Q.value),1),a("div",Ce,[a("button",{onClick:le,class:"control-button volume-btn"},[S.value||m.value===0?(i(),u("span",Pe,"🔇")):m.value<.5?(i(),u("span",Ue,"🔉")):(i(),u("span",$e,"🔊"))]),A(a("input",{type:"range",min:"0",max:"1",step:"0.1","onUpdate:modelValue":e[1]||(e[1]=n=>m.value=n),onInput:ee,class:"volume-slider"},null,544),[[ke,m.value]])]),e[4]||(e[4]=a("div",{class:"spacer"},null,-1)),a("button",{onClick:te,class:"control-button fullscreen-btn"},[p.value?(i(),u("span",Ne,"🪟")):(i(),u("span",Oe,"⛶"))])])])],2)):M("",!0),b.isLocked?(i(),u("div",Ve,[...e[5]||(e[5]=[a("div",{class:"locked-content"},[a("div",{class:"lock-icon"},"🔒"),a("div",{class:"lock-message"},"This content is locked")],-1)])])):M("",!0),d.value&&!P.value&&!b.isLocked?(i(),u("div",He,[a("div",Ie,[e[6]||(e[6]=a("div",{class:"error-icon"},"⚠️",-1)),a("div",Ae,C(d.value),1),a("button",{class:"retry-button",onClick:ie},"Retry")])])):M("",!0)],32))}},ze=ce(De,[["__scopeId","data-v-6aef7711"]]);export{ze as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.