1import{r as l,j as e}from"./client-698f59b0.js";import{P as j}from"./index-3e909dfe.js";import{u as g,b,A as m,O as y,S}from"./no-react-297d2630.js";import{s as v,e as k}from"./helpers-54c3f0d3.js";function p({videoUrl:s,jumpCuts:a,useKeyHack:o}){const r=g(),{fps:i}=b(),t=l.useMemo(()=>{let c=0,n=0;for(const u of a){const x=v(u.startFromSeconds,i),h=k(u.endAtSeconds,i),f=h-x;if(c+=f,c>r)return{trimBefore:h-c,sectionIndex:n};n++}return null},[r,a,i]);if(!t)return e.jsx(m,{style:{background:"red",color:"white",fontSize:30,display:"flex",alignItems:"center",justifyContent:"center"},children:"End of Sequence"});const d=o?`section-${t.sectionIndex}`:void 0;return e.jsxs(m,{style:{backgroundColor:"#000"},children:[e.jsx(y,{trimBefore:t.trimBefore,src:`${encodeURI(s)}#t=0,`,style:{width:"100%",height:"100%",objectFit:"contain"},pauseWhenBuffering:!0,toneMapped:!1,acceptableTimeShiftInSeconds:.25},d),e.jsxs("div",{style:{position:"absolute",top:20,left:20,background:"rgba(0,0,0,0.7)",color:"white",padding:10,fontFamily:"monospace"},children:[e.jsxs("div",{children:["Frame: ",r]}),e.jsxs("div",{children:["TrimBefore: ",t.trimBefore]}),e.jsxs("div",{children:["Section: ",t.sectionIndex]}),e.jsxs("div",{children:["Key: ",String(d)]})]})]})}function F(s){return e.jsx(m,{children:e.jsx(S,{from:0,durationInFrames:300,children:e.jsx(p,{...s})})})}function E(){const[s,a]=l.useState(!1),[o,r]=l.useState(!0),i=24,t=200,d=[{startFromSeconds:.479,endAtSeconds:2.95},{startFromSeconds:3.5,endAtSeconds:6.859}],c="https://avatar.rayloom.ai/video-shot-versions/2092.mp4";return e.jsxs("div",{className:"p-8 space-y-6",children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Jump Cuts Player Test"}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer bg-secondary p-3 rounded-md",children:[e.jsx("input",{type:"checkbox",checked:s,onChange:n=>a(n.target.checked),className:"w-5 h-5"}),e.jsx("span",{className:"font-semibold",children:'Enable "Key Hack" Fix'})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s?"Fix Enabled: Video should jump correctly.":"Fix Disabled: Testing clean implementation."})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer bg-secondary p-3 rounded-md",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:n=>r(n.target.checked),className:"w-5 h-5"}),e.jsx("span",{className:"font-semibold",children:"Wrap in Sequence"})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:o?"Mimics Real Editor (Sequence wrapper)":"Direct Component"})]})]}),e.jsx("div",{className:"border rounded-lg overflow-hidden w-[640px] h-[360px] bg-black",children:e.jsx(j,{component:o?F:p,inputProps:{videoUrl:c,jumpCuts:d,useKeyHack:s},durationInFrames:t,compositionWidth:1280,compositionHeight:720,fps:i,controls:!0,style:{width:"100%",height:"100%"}})}),e.jsxs("div",{className:"prose",children:[e.jsx("h3",{children:"Test Instructions"}),e.jsxs("ol",{children:[e.jsx("li",{children:"Testing with **REMOTE URL** (same as failing shot)."}),e.jsx("li",{children:'Uncheck "Enable Key Hack". Check "Wrap in Sequence".'}),e.jsx("li",{children:"Play. The jump should happen around **2.6 seconds** (3.08 - 0.479)."}),e.jsx("li",{children:"If it fails (no jump), then **Remote URL behavior is the culprit**."})]})]})]})}export{E 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.