Spaces:
Running
Running
Commit ·
1e43950
1
Parent(s): b3a66b9
Update
Browse files
src/textWithBgImage/SemibitComposition.tsx
CHANGED
|
@@ -15,6 +15,12 @@ function getFileName(filePath: string, subdirpath?: string): string {
|
|
| 15 |
return undefined
|
| 16 |
if (filePath.startsWith("http"))
|
| 17 |
return filePath
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
const match = filePath.match(/([^\/\\]+)$/);
|
| 19 |
let folmat = match ? match[1] : '';
|
| 20 |
if (subdirpath) {
|
|
@@ -69,7 +75,7 @@ export const SemibitComposition: React.FC = () => {
|
|
| 69 |
curDurSecs = 3
|
| 70 |
}
|
| 71 |
//@ts-ignore
|
| 72 |
-
const transitionFile = section?.transition_file || Transitions[0].file
|
| 73 |
//@ts-ignore
|
| 74 |
const transitionDurationSec = (section?.transition_duration_sec || Transitions[0].durationSec)
|
| 75 |
const transitionDurationFrames = transitionDurationSec * fps
|
|
@@ -98,6 +104,7 @@ export const SemibitComposition: React.FC = () => {
|
|
| 98 |
let frame = Object.assign(section, {
|
| 99 |
"commulativeDurationStartSec": commDuration,
|
| 100 |
"text": text,
|
|
|
|
| 101 |
"durationInSecs": curDurSecs,
|
| 102 |
"duration": Math.ceil(curDurSecs * fps),
|
| 103 |
"offset": offset * fps,
|
|
|
|
| 15 |
return undefined
|
| 16 |
if (filePath.startsWith("http"))
|
| 17 |
return filePath
|
| 18 |
+
const slashCount = (filePath.replace("./", "").split("/").length - 1);
|
| 19 |
+
if (slashCount > 0) {
|
| 20 |
+
let pub = filePath.replace("./", "")
|
| 21 |
+
return pub
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
const match = filePath.match(/([^\/\\]+)$/);
|
| 25 |
let folmat = match ? match[1] : '';
|
| 26 |
if (subdirpath) {
|
|
|
|
| 75 |
curDurSecs = 3
|
| 76 |
}
|
| 77 |
//@ts-ignore
|
| 78 |
+
const transitionFile = (section?.transition_file || Transitions[0].file)
|
| 79 |
//@ts-ignore
|
| 80 |
const transitionDurationSec = (section?.transition_duration_sec || Transitions[0].durationSec)
|
| 81 |
const transitionDurationFrames = transitionDurationSec * fps
|
|
|
|
| 104 |
let frame = Object.assign(section, {
|
| 105 |
"commulativeDurationStartSec": commDuration,
|
| 106 |
"text": text,
|
| 107 |
+
"transition_file": getFileName(transitionFile),
|
| 108 |
"durationInSecs": curDurSecs,
|
| 109 |
"duration": Math.ceil(curDurSecs * fps),
|
| 110 |
"offset": offset * fps,
|