@codingfactory/mediables-vue 2.0.5 → 2.1.0

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.
Files changed (35) hide show
  1. package/dist/PixiFrameExporter-CaDjKfAG.cjs +2 -0
  2. package/dist/{PixiFrameExporter-BTXhmL54.cjs.map → PixiFrameExporter-CaDjKfAG.cjs.map} +1 -1
  3. package/dist/{PixiFrameExporter-B5tJ62bD.js → PixiFrameExporter-CvKLKOXx.js} +60 -60
  4. package/dist/{PixiFrameExporter-B5tJ62bD.js.map → PixiFrameExporter-CvKLKOXx.js.map} +1 -1
  5. package/dist/composables/useFloatingPills.d.ts +2 -0
  6. package/dist/composables/useVideoEditor.d.ts +3 -2
  7. package/dist/filters/index.d.ts +3 -3
  8. package/dist/filters/registry.d.ts +15 -0
  9. package/dist/index-CXQ4ykVw.cjs +39 -0
  10. package/dist/index-CXQ4ykVw.cjs.map +1 -0
  11. package/dist/{index-BsOWbGbb.js → index-DBM_ViWA.js} +1629 -1562
  12. package/dist/index-DBM_ViWA.js.map +1 -0
  13. package/dist/{index-CWcyKIOz.js → index-DRQBqLZX.js} +8593 -8668
  14. package/dist/index-DRQBqLZX.js.map +1 -0
  15. package/dist/index-HREFg1jF.cjs +42 -0
  16. package/dist/index-HREFg1jF.cjs.map +1 -0
  17. package/dist/mediables-vanilla.cjs +1 -1
  18. package/dist/mediables-vanilla.mjs +1 -1
  19. package/dist/mediables-vue.cjs +1 -1
  20. package/dist/mediables-vue.mjs +2 -2
  21. package/dist/render-page/assets/{index-hBfvGPpt.js → index-SU1f_egA.js} +45095 -22643
  22. package/dist/render-page/index.html +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/types/video.d.ts +1 -0
  25. package/dist/video-engine/adapters/MediablesCompositionAdapter.d.ts +2 -1
  26. package/dist/video-engine/index.d.ts +0 -2
  27. package/package.json +17 -18
  28. package/dist/PixiFrameExporter-BTXhmL54.cjs +0 -2
  29. package/dist/index-BsOWbGbb.js.map +0 -1
  30. package/dist/index-CWcyKIOz.js.map +0 -1
  31. package/dist/index-C_X9_ptj.cjs +0 -42
  32. package/dist/index-C_X9_ptj.cjs.map +0 -1
  33. package/dist/index-DVJg3EKN.cjs +0 -76
  34. package/dist/index-DVJg3EKN.cjs.map +0 -1
  35. package/dist/video-engine/adapters/CSSFilterAdapter.d.ts +0 -106
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("./index-DVJg3EKN.cjs");function V(){return typeof VideoEncoder<"u"&&typeof VideoFrame<"u"}function L(){return typeof AudioEncoder<"u"&&typeof AudioData<"u"}async function N(i,d){try{const o=await fetch(i,{signal:d});if(!o.ok)return null;const t=await o.arrayBuffer(),r=new AudioContext;try{return await r.decodeAudioData(t)}catch{return null}finally{await r.close()}}catch{return null}}function q(i,d,o){const t=i.sampleRate,r=Math.max(0,Math.floor(d*t)),u=Math.min(i.length,Math.ceil(o*t)),x=Math.max(0,u-r),n=[];for(let s=0;s<i.numberOfChannels;s++){const l=i.getChannelData(s);n.push(l.slice(r,r+x))}return{channels:n,sampleRate:t,numberOfChannels:i.numberOfChannels}}async function P(i,d,o,t,r){const u={codec:"mp4a.40.2",numberOfChannels:t,sampleRate:o,bitrate:r};if(!(await AudioEncoder.isConfigSupported(u)).supported)return;const n=new AudioEncoder({output:(e,c)=>{i.addAudioChunk(e,c)},error:e=>{}});n.configure(u);const s=1024,l=d[0].length;for(let e=0;e<l;e+=s){const c=Math.min(s,l-e),h=new Float32Array(t*c);for(let f=0;f<t;f++)h.set(d[f].subarray(e,e+c),f*c);const p=new AudioData({format:"f32-planar",sampleRate:o,numberOfFrames:c,numberOfChannels:t,timestamp:Math.floor(e/o*1e6),data:h});n.encode(p),p.close(),n.encodeQueueSize>10&&await new Promise(f=>{n.addEventListener("dequeue",()=>f(),{once:!0})})}await n.flush(),n.close()}async function X(i,d){const{width:o,height:t,fps:r,bitrate:u=5e6,audioBitrate:x=128e3,trimStart:n=0,trimEnd:s,sourceUrl:l,onProgress:e,signal:c}=d;if(!V())throw new Error("WebCodecs API is not supported in this browser");const h=i.duration.value,p=3600,f=p*60;if(!Number.isFinite(h)||h<=0)throw new Error(`Invalid video duration: ${h}. The video metadata may not have loaded. Please ensure the video is fully loaded before exporting.`);const A=s??h,w=Math.max(0,A-n);if(!Number.isFinite(w)||w<=0)throw new Error(`Invalid export duration: ${w} (trimStart=${n}, trimEnd=${A}). Check that the trim points are valid.`);if(w>p)throw new Error(`Export duration (${Math.round(w)}s) exceeds maximum allowed (${p}s).`);const g=Math.min(Math.max(1,Math.ceil(w*r)),f);let F=Promise.resolve(null);l&&L()&&(F=N(l,c));const E=await F,D=!!E&&E.numberOfChannels>0&&E.length>0,O={target:new R.ArrayBufferTarget,video:{codec:"avc",width:o,height:t,frameRate:r},fastStart:"in-memory"};D&&(O.audio={codec:"aac",numberOfChannels:E.numberOfChannels,sampleRate:E.sampleRate});const C=new R.Muxer(O),$=[{codec:"avc1.640028",hw:"prefer-hardware"},{codec:"avc1.4d0028",hw:"prefer-hardware"},{codec:"avc1.420028",hw:"prefer-hardware"},{codec:"avc1.640028",hw:"prefer-software"},{codec:"avc1.4d0028",hw:"prefer-software"},{codec:"avc1.420028",hw:"prefer-software"}];let y=null;for(const a of $){const v={codec:a.codec,width:o,height:t,bitrate:u,framerate:r,hardwareAcceleration:a.hw};if((await VideoEncoder.isConfigSupported(v)).supported){y=v;break}}if(!y)throw new Error(`No supported VideoEncoder codec found for ${o}×${t}. Try a lower export resolution or use a browser with H.264 encoding support (Chrome 94+).`);const m=new VideoEncoder({output:(a,v)=>{C.addVideoChunk(a,v)},error:a=>{}});m.configure(y);const b=document.createElement("canvas");b.width=o,b.height=t;const M=b.getContext("2d");if(!M)throw new Error("Failed to create 2D context for export target canvas");for(let a=0;a<g;a++){if(c!=null&&c.aborted)throw m.close(),new DOMException("Export aborted","AbortError");const v=n+a/r,S=await i.captureFrameAt(v);if(!S)continue;M.clearRect(0,0,o,t),M.drawImage(S,0,0,o,t);const B=Math.floor(a/r*1e6),I=Math.floor(1e6/r),T=new VideoFrame(b,{timestamp:B,duration:I}),W=a%(r*2)===0;m.encode(T,{keyFrame:W}),T.close(),m.encodeQueueSize>5&&await new Promise(z=>{m.addEventListener("dequeue",()=>z(),{once:!0})});const _=Math.round((a+1)/g*90);e==null||e(_)}if(await m.flush(),m.close(),D){e==null||e(91);const a=q(E,n,A);await P(C,a.channels,a.sampleRate,a.numberOfChannels,x),e==null||e(99)}C.finalize();const{buffer:k}=C.target;return e==null||e(100),new Blob([k],{type:"video/mp4"})}exports.exportWithPixiFrames=X;exports.isWebCodecsSupported=V;
2
- //# sourceMappingURL=PixiFrameExporter-BTXhmL54.cjs.map