Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.
TypeScript cross-platformelectronffmpegopen-sourceproduct-demorustscreen-capturescreen-recorderscreen-recordingscreen-studioscreencastspeech-to-texttypescriptvideo-editingvideo-editorwaylandwgpuwhisper
merge: resolve conflicts and update video playback system
AmitwalaH1673daabe40e
diff --cc src/components/video-editor/VideoPlayback.tsxindex b4d98a622,b798641e4..71e5a4f1d--- a/src/components/video-editor/VideoPlayback.tsx+++ b/src/components/video-editor/VideoPlayback.tsx@@@ -163,11 -181,9 +181,10 @@@ const VideoPlayback = forwardRef<VideoPconst timeUpdateAnimationRef = useRef<number | null>(null);const [pixiReady, setPixiReady] = useState(false);const [videoReady, setVideoReady] = useState(false);+ const [overlaySize, setOverlaySize] = useState({ width: 800, height: 600 });+ const [overlayElement, setOverlayElement] = useState<HTMLDivElement | null>(null);const overlayRef = useRef<HTMLDivElement | null>(null);- const [containerSize, setContainerSize] = useState({- width: 800,- height: 600,- });++const focusIndicatorRef = useRef<HTMLDivElement | null>(null);const [webcamLayout, setWebcamLayout] = useState<StyledRenderRect | null>(null);const [webcamDimensions, setWebcamDimensions] = useState<Size | null>(null);@@@ -345,7 -368,7 +369,7 @@@if (!vid) return;try {allowPlaybackRef.current = true;-- await vid.play();++ await vid.play().catch((err) => console.log("PLAY ERROR:", err));} catch (error) {allowPlaybackRef.current = false;throw error;@@@ -519,83 -542,83 +543,22 @@@useEffect(() => {if (!pixiReady || !videoReady) return;-- const app = appRef.current;-- const cameraContainer = cameraContainerRef.current;-- const video = videoRef.current;---- if (!app || !cameraContainer || !video) return;++ const el = overlayRef.current;++ if (!el) return;-- const tickerWasStarted = app.ticker?.started || false;-- if (tickerWasStarted && app.ticker) {-- app.ticker.stop();-- }++ const observer = new ResizeObserver((entries) => {++ const { width, height } = entries[0].contentRect;-- const wasPlaying = !video.paused;-- if (wasPlaying) {-- video.pause();-- }---- animationStateRef.current = {-- scale: 1,-- focusX: DEFAULT_FOCUS.cx,-- focusY: DEFAULT_FOCUS.cy,-- progress: 0,-- x: 0,-- y: 0,-- appliedScale: 1,-- };---- // Reset motion blur state for clean transitions-- motionBlurStateRef.current = createMotionBlurState();---- if (blurFilterRef.current) {-- blurFilterRef.current.blur = 0;-- }---- requestAnimationFrame(() => {-- const container = cameraContainerRef.current;-- const videoStage = videoContainerRef.current;-- const sprite = videoSpriteRef.current;-- const currentApp = appRef.current;-- if (!container || !videoStage || !sprite || !currentApp) {-- return;-- }---- container.scale.set(1);-- container.position.set(0, 0);-- videoStage.scale.set(1);-- videoStage.position.set(0, 0);-- sprite.scale.set(1);-- sprite.position.set(0, 0);---- layoutVideoContent();---- applyZoomTransform({-- cameraContainer: container,-- blurFilter: blurFilterRef.current,-- stageSize: stageSizeRef.current,-- baseMask: baseMaskRef.current,-- zoomScale: 1,-- focusX: DEFAULT_FOCUS.cx,-- focusY: DEFAULT_FOCUS.cy,-- motionIntensity: 0,-- isPlaying: false,-- motionBlurAmount: motionBlurAmountRef.current,-- });---- requestAnimationFrame(() => {-- const finalApp = appRef.current;-- if (wasPlaying && video) {-- video.play().catch(() => {-- // Ignore autoplay restoration failures.-- });-- }-- if (tickerWasStarted && finalApp?.ticker) {-- finalApp.ticker.start();-- }++ setOverlaySize({++ width,++ height,});});-- }, [pixiReady, videoReady, layoutVideoContent]);++++ observer.observe(el);++++ return () => observer.disconnect();++ }, [pixiReady, videoReady]);useEffect(() => {if (!pixiReady || !videoReady) return;@@@ -1301,9 -1327,9 +1267,9 @@@{/* Only render overlay after PIXI and video are fully initialized */}{pixiReady && videoReady && (<div- ref={overlayRef}+ ref={setOverlayRefs}className="absolute inset-0 select-none"-- style={{ pointerEvents: "none", zIndex: 30 }}++ style={{ pointerEvents: "auto", zIndex: 30 }}onPointerDown={handleOverlayPointerDown}onPointerMove={handleOverlayPointerMove}onPointerUp={handleOverlayPointerUp}diff --cc src/lib/exporter/frameRenderer.tsindex be0e8e381,9b1cf6d68..f1815c163--- a/src/lib/exporter/frameRenderer.ts+++ b/src/lib/exporter/frameRenderer.ts@@@ -491,10 -509,15 +509,15 @@@ export class FrameRendererthis.videoContainer.y = screenRect.y;// scale border radius by export/preview canvas ratio- const previewWidth = this.config.previewWidth || 1920;- const previewHeight = this.config.previewHeight || 1080;+ const previewWidth = this.config.previewWidth ?? this.config.width;+ const previewHeight = this.config.previewHeight ?? this.config.height;const canvasScaleFactor = Math.min(width / previewWidth, height / previewHeight);- const scaledBorderRadius = compositeLayout.screenCover ? 0 : borderRadius * canvasScaleFactor;+ const scaledBorderRadius =+ compositeLayout.screenBorderRadius != null+ ? compositeLayout.screenBorderRadius+ : compositeLayout.screenCover+ ? 0+ : borderRadius * canvasScaleFactor;this.maskGraphics.clear();this.maskGraphics.roundRect(0, 0, screenRect.width, screenRect.height, scaledBorderRadius);