vargai 0.4.0-alpha113 → 0.4.0-alpha114
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/package.json +1 -1
- package/src/react/resolve.ts +16 -6
- package/src/react/types.ts +11 -1
package/package.json
CHANGED
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"license": "Apache-2.0",
|
|
108
108
|
"author": "varg.ai <hello@varg.ai> (https://varg.ai)",
|
|
109
109
|
"sideEffects": false,
|
|
110
|
-
"version": "0.4.0-
|
|
110
|
+
"version": "0.4.0-alpha114",
|
|
111
111
|
"exports": {
|
|
112
112
|
".": "./src/index.ts",
|
|
113
113
|
"./ai": "./src/ai-sdk/index.ts",
|
package/src/react/resolve.ts
CHANGED
|
@@ -938,13 +938,23 @@ export async function resolveSliceElement(
|
|
|
938
938
|
{ type: "video" as const, props: { src: seg.url }, children: [] },
|
|
939
939
|
{ file: segFile, duration: segDuration },
|
|
940
940
|
);
|
|
941
|
+
const augmented: {
|
|
942
|
+
url: string;
|
|
943
|
+
index: number;
|
|
944
|
+
start: number;
|
|
945
|
+
end: number;
|
|
946
|
+
first_frame?: string;
|
|
947
|
+
thumbnail?: string;
|
|
948
|
+
} = {
|
|
949
|
+
url: seg.url,
|
|
950
|
+
index: seg.index,
|
|
951
|
+
start: cursor,
|
|
952
|
+
end: cursor + segDuration,
|
|
953
|
+
};
|
|
954
|
+
if (seg.first_frame) augmented.first_frame = seg.first_frame;
|
|
955
|
+
if (seg.thumbnail) augmented.thumbnail = seg.thumbnail;
|
|
941
956
|
segments.push(
|
|
942
|
-
Object.assign(segElement,
|
|
943
|
-
url: seg.url,
|
|
944
|
-
index: seg.index,
|
|
945
|
-
start: cursor,
|
|
946
|
-
end: cursor + segDuration,
|
|
947
|
-
}) as import("./types").SliceSegment,
|
|
957
|
+
Object.assign(segElement, augmented) as import("./types").SliceSegment,
|
|
948
958
|
);
|
|
949
959
|
cursor += segDuration;
|
|
950
960
|
}
|
package/src/react/types.ts
CHANGED
|
@@ -417,7 +417,13 @@ export interface FFmpegGateway {
|
|
|
417
417
|
ranges?: Array<{ start: number; end: number }>;
|
|
418
418
|
}): Promise<{
|
|
419
419
|
url: string;
|
|
420
|
-
segments: Array<{
|
|
420
|
+
segments: Array<{
|
|
421
|
+
url: string;
|
|
422
|
+
index: number;
|
|
423
|
+
filename: string;
|
|
424
|
+
first_frame?: string;
|
|
425
|
+
thumbnail?: string;
|
|
426
|
+
}>;
|
|
421
427
|
jobId: string;
|
|
422
428
|
}>;
|
|
423
429
|
probe(params: { url: string }): Promise<{
|
|
@@ -499,6 +505,10 @@ export type SliceSegment =
|
|
|
499
505
|
readonly index: number;
|
|
500
506
|
readonly start: number;
|
|
501
507
|
readonly end: number;
|
|
508
|
+
/** Full-resolution first frame (JPEG). */
|
|
509
|
+
readonly first_frame?: string;
|
|
510
|
+
/** 480px-wide thumbnail (WebP). */
|
|
511
|
+
readonly thumbnail?: string;
|
|
502
512
|
};
|
|
503
513
|
|
|
504
514
|
export interface ElementPropsMap {
|