melies-video-editor 0.1.0 → 0.1.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.
@@ -5,6 +5,13 @@ export type MeliesVideoEditorProps = {
5
5
  * When omitted or empty, the footage bin will be empty.
6
6
  */
7
7
  footageUrls?: string[];
8
+ /**
9
+ * When true, automatically place `footageUrls` onto the timeline on first initialization
10
+ * (one after another, starting at t=0).
11
+ *
12
+ * Defaults to false.
13
+ */
14
+ autoPlaceFootage?: boolean;
8
15
  };
9
- declare const MeliesVideoEditor: ({ footageUrls }: MeliesVideoEditorProps) => import("react/jsx-runtime").JSX.Element;
16
+ declare const MeliesVideoEditor: ({ footageUrls, autoPlaceFootage }: MeliesVideoEditorProps) => import("react/jsx-runtime").JSX.Element;
10
17
  export default MeliesVideoEditor;
@@ -0,0 +1,3 @@
1
+ export default function HostApp({ footageUrls }: {
2
+ footageUrls?: string[];
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -12,6 +12,18 @@ declare class MediaCache {
12
12
  resolve(src: string): string;
13
13
  /** Starts preload in background (non-blocking). */
14
14
  warm(src: string): void;
15
+ /**
16
+ * Preload a list of srcs with bounded concurrency.
17
+ *
18
+ * This is useful when you know ahead of time which assets will be scrubbed/seeked,
19
+ * so we can eliminate network stalls during interaction.
20
+ */
21
+ warmAll(srcs: Iterable<string>, opts?: {
22
+ /** Maximum number of concurrent fetches. Defaults to 3. */
23
+ concurrency?: number;
24
+ /** Yield back to the event loop between items. Defaults to true. */
25
+ yieldBetween?: boolean;
26
+ }): Promise<void>;
15
27
  /** Convenience: preload all unique action.data.src from editor data. */
16
28
  warmFromEditorData(editorData: unknown): void;
17
29
  }
@@ -7,6 +7,8 @@ export interface CustomTimelineAction extends TimelineAction {
7
7
  src: string;
8
8
  previewSrc?: string;
9
9
  name: string;
10
+ /** Video lane index (0=V1, 1=V2). Higher value wins when overlapping. */
11
+ videoLayer?: number;
10
12
  /** Shared id for clips that should move/trim together (e.g. video + its embedded audio). */
11
13
  linkId?: string;
12
14
  /**
@@ -1,8 +1,11 @@
1
1
  import type { TimelineState } from '@xzdarcy/react-timeline-editor';
2
2
  export declare const Rates: number[];
3
- declare const TimelinePlayer: ({ timelineState, autoScrollWhenPlay, editorData, selectedActionId, onDeleteSelectedClip, onSplitSelectedClip, canUndo, canRedo, onUndo, onRedo, }: {
3
+ declare const TimelinePlayer: ({ timelineState, autoScrollWhenPlay, scale, scaleWidth, startLeft, editorData, selectedActionId, onDeleteSelectedClip, onSplitSelectedClip, canUndo, canRedo, onUndo, onRedo, }: {
4
4
  timelineState: React.MutableRefObject<TimelineState | null>;
5
5
  autoScrollWhenPlay: React.MutableRefObject<boolean>;
6
+ scale: number;
7
+ scaleWidth: number;
8
+ startLeft: number;
6
9
  editorData: any[];
7
10
  selectedActionId: string | null;
8
11
  onDeleteSelectedClip: () => void;
@@ -4,12 +4,26 @@ declare class VideoControl {
4
4
  private currentSrc;
5
5
  private lastSeekAtMs;
6
6
  private lastRate;
7
+ private videoClaims;
8
+ private activeVideoActionId;
9
+ private lastEngineTime;
7
10
  private boundEngine;
8
11
  private boundActionStart;
9
12
  private vfcHandle;
10
13
  private rafHandle;
11
14
  attach(el: HTMLVideoElement | null): void;
12
15
  setActive(active: boolean): void;
16
+ claimVideo(data: {
17
+ actionId: string;
18
+ layer: number;
19
+ src: string;
20
+ engine: TimelineEngine;
21
+ isPlaying: boolean;
22
+ time: number;
23
+ actionStart: number;
24
+ offset?: number;
25
+ }): void;
26
+ releaseVideo(actionIdRaw: string): void;
13
27
  bindEngine(engine: TimelineEngine, actionStart: number): void;
14
28
  unbindEngine(): void;
15
29
  private tickFromVideo;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "melies-video-editor",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "A React video timeline editor GUI built on @xzdarcy/react-timeline-editor.",
5
5
  "type": "module",
6
6
  "license": "MIT",