@byomakase/omakase-react-components 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +61 -61
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -56,9 +56,9 @@ ${i(m)}`)}),f.join(`
|
|
|
56
56
|
`)}function s(l){let f=0;return l.forEach(d=>{d.duration>f&&(f=d.duration)}),f}function u(l){const f=[];return l.forEach(d=>{f.push(c(d))}),f.join(`
|
|
57
57
|
|
|
58
58
|
`)}function c(l){const f=[];l.identifier&&f.push(l.identifier);const d=a(l.start),m=a(l.end),h=l.styles?`${l.styles}`:"";return f.push(`${d} --> ${m} ${h}`),f.push(l.text),f.join(`
|
|
59
|
-
`)}function a(l){const f=(l%1).toFixed(3);l=Math.round(l-f);const d=Math.floor(l/3600),m=Math.floor((l-d*3600)/60),h=l-d*3600-m*60;return`${`${r(d,2)}:`}${r(m,2)}:${r(h,2)}.${r(f*1e3,3)}`}return ht={hlsSegment:e,hlsSegmentPlaylist:n},ht}var pt,En;function Gi(){if(En)return pt;En=1;const t=pn().parse,e=Wi().compile,n=bn().segment,r=ji();return pt={parse:t,compile:e,segment:n,hls:r},pt}var Yi=Gi();async function zi(t){const e=await fetch(t);if(!e.ok)throw new Error(`Failed to fetch: ${t}`);const n=await e.arrayBuffer();return new TextDecoder("utf-8").decode(n)}function Sn(t){t<0&&(t=0);const e=Math.floor(t/3600).toString().padStart(2,"0"),n=Math.floor(t%3600/60).toString().padStart(2,"0"),r=(t%60).toFixed(3).padStart(6,"0");return`${e}:${n}:${r}`}async function Ji(t,e,n){if(!t.length)throw new Error("No URLs provided");function r(f,d,m){return Math.min(f-d,m)}function i(f,d,m){return f>=d&&f<=m+d}const o=await Promise.all(t.map(zi)),s=[];let u;for(const f of o){const d=Yi.parse(f,{strict:!1,meta:!0});u||(u=d.meta);let m=d.cues;e!==void 0&&n!==void 0&&(m=d.cues.filter(h=>i(h.end,e,n)));for(const h of m){let p=h.start,w=h.end;e!==void 0&&n!==void 0&&(p=r(h.start,e,n),w=r(h.end,e,n)),s.push({...h,start:p,end:w})}}const c=[];c.push("WEBVTT"),u["X-TIMESTAMP-MAP=LOCAL"]&&c.push(`X-TIMESTAMP-MAP=LOCAL${u["X-TIMESTAMP-MAP=LOCAL"]}`),c.push("");for(const f of s)c.push(`${Sn(f.start)} --> ${Sn(f.end)}`),c.push(f.text),c.push("");const a=c.join(`
|
|
59
|
+
`)}function a(l){const f=(l%1).toFixed(3);l=Math.round(l-f);const d=Math.floor(l/3600),m=Math.floor((l-d*3600)/60),h=l-d*3600-m*60;return`${`${r(d,2)}:`}${r(m,2)}:${r(h,2)}.${r(f*1e3,3)}`}return ht={hlsSegment:e,hlsSegmentPlaylist:n},ht}var pt,En;function Gi(){if(En)return pt;En=1;const t=pn().parse,e=Wi().compile,n=bn().segment,r=ji();return pt={parse:t,compile:e,segment:n,hls:r},pt}var Yi=Gi();async function zi(t){const e=await fetch(t);if(!e.ok)throw new Error(`Failed to fetch: ${t}`);const n=await e.arrayBuffer();return new TextDecoder("utf-8").decode(n)}function Sn(t){t<0&&(t=0);const e=Math.floor(t/3600).toString().padStart(2,"0"),n=Math.floor(t%3600/60).toString().padStart(2,"0"),r=(t%60).toFixed(3).padStart(6,"0");return`${e}:${n}:${r}`}async function Ji(t,e,n){if(!t.length)throw new Error("No URLs provided");function r(f,d,m){return Math.min(f-d,m)}function i(f,d,m){return f>=d&&f<=m+d}const o=await Promise.all(t.map(zi)),s=[];let u;for(const f of o){const d=Yi.parse(f,{strict:!1,meta:!0});u||(u=d.meta);let m=d.cues;e!==void 0&&n!==void 0&&(m=d.cues.filter(h=>i(h.end,e,n)));for(const h of m){let p=h.start,w=h.end;e!==void 0&&n!==void 0&&(p=r(h.start,e,n),w=r(h.end,e,n)),s.push({...h,start:p,end:w})}}const c=[];c.push("WEBVTT"),u&&u["X-TIMESTAMP-MAP=LOCAL"]&&c.push(`X-TIMESTAMP-MAP=LOCAL${u["X-TIMESTAMP-MAP=LOCAL"]}`),c.push("");for(const f of s)c.push(`${Sn(f.start)} --> ${Sn(f.end)}`),c.push(f.text),c.push("");const a=c.join(`
|
|
60
60
|
`).trim()+`
|
|
61
|
-
`,l=new Blob([a],{type:"text/vtt"});return URL.createObjectURL(l)}const Qi=v.memo(function({flow:e,childFlows:n,flowsSegments:r,onVideoLoadedCallback:i,config:o,timerange:s,videoLoadOptions:u,enableHotkey:c}){const a=v.useMemo(()=>Xi(e,n,r),[e,r,n,s]),l=xr([e,...n],r),f={protocol:"hls",ffom:l.ffom,frameRate:l.frameRate,dropFrame:l.dropFrame};let d;if(u){if(u.protocol)throw new Error("Tams player can't change media protocol.");d={...f,...u}}else d=f;const m=(h,p)=>{const w=n.filter(Or),E=w.map(()=>new pe);w.forEach(async(x,A)=>{const D=await Ji(r.get(x.id).map(_=>_.get_urls.at(-1).url),l.mediaStartTime,h.video.getDuration()),V=_r(x);h.subtitles.createVttTrack({src:D,label:V.label,language:V.language,default:V.default,embedded:V.embedded,id:V.id}).subscribe(()=>{V.default?h.subtitles.showTrack(V.id).subscribe(()=>{E.at(A).next(),E.at(A).complete()}):(E.at(A).next(),E.at(A).complete())})}),i&&wi(E).subscribe(()=>{i(h,p,l)})};return v.createElement(fn,{videoUrl:a,videoLoadOptions:d,onVideoLoadedCallback:m,config:o,enableHotkeys:c})});function Xe(t){const e=new Date(t*1e3),n=e.getUTCHours();let r=e.getUTCMinutes();return e.getUTCSeconds()>=30&&r++,`${n}h ${r}min`}const eo=`
|
|
61
|
+
`,l=new Blob([a],{type:"text/vtt"});return URL.createObjectURL(l)}const Qi=v.memo(function({flow:e,childFlows:n,flowsSegments:r,onVideoLoadedCallback:i,config:o,timerange:s,videoLoadOptions:u,enableHotkey:c}){const a=v.useMemo(()=>Xi(e,n,r),[e,r,n,s]),l=xr([e,...n],r),f={protocol:"hls",ffom:l.ffom,frameRate:l.frameRate,dropFrame:l.dropFrame};let d;if(u){if(u.protocol)throw new Error("Tams player can't change media protocol.");d={...f,...u}}else d=f;const m=(h,p)=>{const w=n.filter(Or),E=w.map(()=>new pe);w.forEach(async(x,A)=>{const D=await Ji(r.get(x.id).map(_=>_.get_urls.at(-1).url),l.mediaStartTime,h.video.getDuration()),V=_r(x);h.subtitles.createVttTrack({src:D,label:V.label,language:V.language,default:V.default,embedded:V.embedded,id:V.id}).subscribe(()=>{V.default?h.subtitles.showTrack(V.id).subscribe(()=>{E.at(A).next(),E.at(A).complete()}):(E.at(A).next(),E.at(A).complete())})}),i&&(E.length?wi(E).subscribe(()=>{i(h,p,l)}):i(h,p,l))};return v.createElement(fn,{videoUrl:a,videoLoadOptions:d,onVideoLoadedCallback:m,config:o,enableHotkeys:c})});function Xe(t){const e=new Date(t*1e3),n=e.getUTCHours();let r=e.getUTCMinutes();return e.getUTCSeconds()>=30&&r++,`${n}h ${r}min`}const eo=`
|
|
62
62
|
.omakase-time-range-selector-segments {
|
|
63
63
|
display: flex;
|
|
64
64
|
width: 700px;
|