mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-25 15:25:44 +00:00
Merge branch 'main' into fix/lightning-pixi-lifecycle
This commit is contained in:
@@ -80,7 +80,7 @@ export const SourceSelectorContent = ({
|
||||
windowSources = [],
|
||||
selectedSource = "Screen",
|
||||
loading = false,
|
||||
onSourceSelect = () => {},
|
||||
onSourceSelect = () => undefined,
|
||||
}: Pick<SourceSelectorProps, "screenSources" | "windowSources" | "selectedSource" | "loading" | "onSourceSelect">) => {
|
||||
const t = useScopedT("launch");
|
||||
const renderSourceItem = (source: DesktopSource, index: number) => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { createContext, useContext } from "react";
|
||||
import { createContext, type MouseEvent, useContext } from "react";
|
||||
|
||||
interface HudInteractionContextType {
|
||||
onMouseEnter: () => void;
|
||||
onMouseLeave: (event: any) => void;
|
||||
onMouseLeave: (event: MouseEvent<HTMLDivElement>) => void;
|
||||
}
|
||||
|
||||
export const HudInteractionContext = createContext<HudInteractionContextType | null>(null);
|
||||
|
||||
@@ -170,7 +170,6 @@ import {
|
||||
import { clampFocusToStage as clampFocusToStageUtil } from "./videoPlayback/focusUtils";
|
||||
import {
|
||||
layoutVideoContent as layoutVideoContentUtil,
|
||||
scalePreviewBorderRadius,
|
||||
} from "./videoPlayback/layoutUtils";
|
||||
import { updateOverlayIndicator } from "./videoPlayback/overlayUtils";
|
||||
import { createVideoEventHandlers } from "./videoPlayback/videoEventHandlers";
|
||||
|
||||
@@ -6,7 +6,7 @@ type WaveformWorkerRequest = {
|
||||
|
||||
interface WorkerContext {
|
||||
onmessage: (e: MessageEvent<WaveformWorkerRequest>) => void;
|
||||
postMessage: (message: any, transfer?: Transferable[]) => void;
|
||||
postMessage: (message: unknown, transfer?: Transferable[]) => void;
|
||||
}
|
||||
|
||||
const workerScope = self as unknown as WorkerContext;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { useCallback, useMemo, useState } from "react";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import type { TimelineRegion } from "../core/timelineTypes";
|
||||
|
||||
interface UseTimelineSelectionParams {
|
||||
@@ -56,7 +55,10 @@ export function useTimelineSelection({
|
||||
if (totalMs === 0) return;
|
||||
const time = Math.max(0, Math.min(currentTimeMs, totalMs));
|
||||
if (keyframes.some((kf) => Math.abs(kf.time - time) < 1)) return;
|
||||
setKeyframes((prev) => [...prev, { id: uuidv4(), time }]);
|
||||
setKeyframes((prev) => [
|
||||
...prev,
|
||||
{ id: globalThis.crypto.randomUUID(), time },
|
||||
]);
|
||||
}, [currentTimeMs, totalMs, keyframes]);
|
||||
|
||||
const deleteSelectedKeyframe = useCallback(() => {
|
||||
|
||||
@@ -67,7 +67,7 @@ describe("StreamingVideoDecoder local media loading", () => {
|
||||
const decoder = new StreamingVideoDecoder();
|
||||
await decoder.loadMetadata("http://127.0.0.1:43123/video?path=%2Ftmp%2Fcapture.mp4");
|
||||
|
||||
expect((window as any).electronAPI.readLocalFile).not.toHaveBeenCalled();
|
||||
expect(window.electronAPI.readLocalFile).not.toHaveBeenCalled();
|
||||
expect(mockDemuxerLoad).toHaveBeenCalledWith(
|
||||
"http://127.0.0.1:43123/video?path=%2Ftmp%2Fcapture.mp4",
|
||||
);
|
||||
@@ -77,7 +77,7 @@ describe("StreamingVideoDecoder local media loading", () => {
|
||||
const decoder = new StreamingVideoDecoder();
|
||||
await decoder.loadMetadata("/tmp/capture.mp4");
|
||||
|
||||
expect((window as any).electronAPI.getLocalMediaUrl).toHaveBeenCalledWith(
|
||||
expect(window.electronAPI.getLocalMediaUrl).toHaveBeenCalledWith(
|
||||
"/tmp/capture.mp4",
|
||||
);
|
||||
expect(mockDemuxerLoad).toHaveBeenCalledWith(
|
||||
@@ -90,7 +90,7 @@ describe("StreamingVideoDecoder local media loading", () => {
|
||||
mockDemuxerLoad
|
||||
.mockRejectedValueOnce(new Error("get_media_info failed: Failed after 3 attempts"))
|
||||
.mockResolvedValueOnce(undefined);
|
||||
(window as any).electronAPI.readLocalFile = vi.fn(async () => ({
|
||||
window.electronAPI.readLocalFile = vi.fn(async () => ({
|
||||
success: true,
|
||||
data: new Uint8Array([1, 2, 3]),
|
||||
}));
|
||||
@@ -103,7 +103,7 @@ describe("StreamingVideoDecoder local media loading", () => {
|
||||
"http://127.0.0.1:4321/video?path=%2Ftmp%2Ffallback.mp4",
|
||||
);
|
||||
expect(mockDemuxerLoad.mock.calls[1]?.[0]).toBeInstanceOf(File);
|
||||
expect((window as any).electronAPI.readLocalFile).toHaveBeenCalledWith(
|
||||
expect(window.electronAPI.readLocalFile).toHaveBeenCalledWith(
|
||||
"/tmp/fallback.mp4",
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user