jbilcke-hf HF staff commited on
Commit
bb503b1
1 Parent(s): 2ed47da

let's add a fallback here

Browse files
.env CHANGED
@@ -1,3 +1,5 @@
1
 
2
  # the secret micro service key used in various API spaces
3
  MICROSERVICE_API_SECRET_TOKEN=""
 
 
 
1
 
2
  # the secret micro service key used in various API spaces
3
  MICROSERVICE_API_SECRET_TOKEN=""
4
+
5
+
src/core/exporters/clapWithStoryboardsToVideoFile.mts CHANGED
@@ -41,7 +41,9 @@ export async function clapWithStoryboardsToVideoFile({
41
  })
42
 
43
  const interfaceSegments = clap.segments.filter(s =>
44
- s.assetUrl.startsWith("data:text/") &&
 
 
45
  s.category === "interface" &&
46
  startOfSegment1IsWithinSegment2(s, segment)
47
  )
@@ -53,7 +55,9 @@ export async function clapWithStoryboardsToVideoFile({
53
  await addTextToVideo({
54
  inputVideoPath: storyboardSegmentVideoFilePath,
55
  outputVideoPath: videoSegmentWithOverlayFilePath,
56
- text: atob(extractBase64(interfaceSegment.assetUrl).data),
 
 
57
  width: clap.meta.width,
58
  height: clap.meta.height,
59
  })
 
41
  })
42
 
43
  const interfaceSegments = clap.segments.filter(s =>
44
+ // nope, not all interfaces asset have the assetUrl
45
+ // although in the future.. we might want to
46
+ // s.assetUrl.startsWith("data:text/") &&
47
  s.category === "interface" &&
48
  startOfSegment1IsWithinSegment2(s, segment)
49
  )
 
55
  await addTextToVideo({
56
  inputVideoPath: storyboardSegmentVideoFilePath,
57
  outputVideoPath: videoSegmentWithOverlayFilePath,
58
+ text: interfaceSegment.assetUrl.startsWith("data:text/")
59
+ ? atob(extractBase64(interfaceSegment.assetUrl).data)
60
+ : interfaceSegment.assetUrl,
61
  width: clap.meta.width,
62
  height: clap.meta.height,
63
  })
src/core/exporters/clapWithVideosToVideoFile.mts CHANGED
@@ -38,7 +38,9 @@ export async function clapWithVideosToVideoFile({
38
  )
39
 
40
  const interfaceSegments = clap.segments.filter(s =>
41
- s.assetUrl.startsWith("data:text/") &&
 
 
42
  s.category === "interface" &&
43
  startOfSegment1IsWithinSegment2(s, segment)
44
  )
@@ -50,7 +52,9 @@ export async function clapWithVideosToVideoFile({
50
  await addTextToVideo({
51
  inputVideoPath: videoSegmentFilePath,
52
  outputVideoPath: videoSegmentWithOverlayFilePath,
53
- text: atob(extractBase64(interfaceSegment.assetUrl).data),
 
 
54
  width: clap.meta.width,
55
  height: clap.meta.height,
56
  })
 
38
  )
39
 
40
  const interfaceSegments = clap.segments.filter(s =>
41
+ // nope, not all interfaces asset have the assetUrl
42
+ // although in the future.. we might want to
43
+ // s.assetUrl.startsWith("data:text/") &&
44
  s.category === "interface" &&
45
  startOfSegment1IsWithinSegment2(s, segment)
46
  )
 
52
  await addTextToVideo({
53
  inputVideoPath: videoSegmentFilePath,
54
  outputVideoPath: videoSegmentWithOverlayFilePath,
55
+ text: interfaceSegment.assetUrl.startsWith("data:text/")
56
+ ? atob(extractBase64(interfaceSegment.assetUrl).data)
57
+ : interfaceSegment.assetUrl,
58
  width: clap.meta.width,
59
  height: clap.meta.height,
60
  })