Skip to content

🎥 Make videos programmatically with React

template-recorder: Replace deprecated startFrom/endAt with trimBefore/trimAfter

copilot-swe-agent[bot]d35bb52c1d7b
diff --git a/packages/template-recorder/remotion/GoToRecorder.tsx b/packages/template-recorder/remotion/GoToRecorder.tsx
index 8bc0182ba8..5c893e6cf9 100644
--- a/packages/template-recorder/remotion/GoToRecorder.tsx
+++ b/packages/template-recorder/remotion/GoToRecorder.tsx
@@ -1,21 +1,21 @@
-import { AbsoluteFill } from "remotion";
-import { REGULAR_FONT } from "../config/fonts";
-import { SERVER_PORT } from "../config/server";
-import { COLORS } from "../config/themes";
-import { WaitForFonts } from "./helpers/WaitForFonts";
+import { AbsoluteFill } from 'remotion';
+import { REGULAR_FONT } from '../config/fonts';
+import { SERVER_PORT } from '../config/server';
+import { COLORS } from '../config/themes';
+import { WaitForFonts } from './helpers/WaitForFonts';
const container: React.CSSProperties = {
- justifyContent: "center",
- alignItems: "center",
- backgroundColor: "#fff",
+ justifyContent: 'center',
+ alignItems: 'center',
+ backgroundColor: '#fff',
fontSize: 30,
- textAlign: "center",
+ textAlign: 'center',
...REGULAR_FONT,
};
const link: React.CSSProperties = {
color: COLORS.light.ACCENT_COLOR,
- textDecoration: "underline",
+ textDecoration: 'underline',
};
export const GoToRecorder: React.FC = () => {
diff --git a/packages/template-recorder/remotion/Main.tsx b/packages/template-recorder/remotion/Main.tsx
index e8f3fd88a6..4511cee0c1 100644
--- a/packages/template-recorder/remotion/Main.tsx
+++ b/packages/template-recorder/remotion/Main.tsx
@@ -1,16 +1,16 @@
-import React, { useCallback, useMemo, useState } from "react";
-import { AbsoluteFill, Sequence } from "remotion";
-import type { Platform } from "../config/endcard";
-import type { CanvasLayout } from "../config/layout";
-import type { SceneAndMetadata, SelectableScene } from "../config/scenes";
-import type { Theme } from "../config/themes";
-import { COLORS } from "../config/themes";
-import { AudioTrack } from "./audio/AudioTrack";
-import { captionEditorPortal } from "./captions/editor/layout";
-import { EmitSrtFile } from "./captions/srt/EmitSrtFile";
-import { makeChapters } from "./chapters/make-chapters";
-import { Scene } from "./scenes/Scene";
-import { NoDataScene } from "./scenes/VideoScene/NoDataScene";
+import React, { useCallback, useMemo, useState } from 'react';
+import { AbsoluteFill, Sequence } from 'remotion';
+import type { Platform } from '../config/endcard';
+import type { CanvasLayout } from '../config/layout';
+import type { SceneAndMetadata, SelectableScene } from '../config/scenes';
+import type { Theme } from '../config/themes';
+import { COLORS } from '../config/themes';
+import { AudioTrack } from './audio/AudioTrack';
+import { captionEditorPortal } from './captions/editor/layout';
+import { EmitSrtFile } from './captions/srt/EmitSrtFile';
+import { makeChapters } from './chapters/make-chapters';
+import { Scene } from './scenes/Scene';
+import { NoDataScene } from './scenes/VideoScene/NoDataScene';
export type MainProps = {
canvasLayout: CanvasLayout;
@@ -87,7 +87,7 @@ export const Main: React.FC<MainProps> = ({
scenesAndMetadata={scenesAndMetadata}
canvasLayout={canvasLayout}
/>
- {canvasLayout === "landscape" ? (
+ {canvasLayout === 'landscape' ? (
<EmitSrtFile scenesAndMetadata={scenesAndMetadata} />
) : null}
<div ref={captionEditorPortal} />
diff --git a/packages/template-recorder/remotion/Root.tsx b/packages/template-recorder/remotion/Root.tsx
index 25a9b2c82c..092f293fde 100644
--- a/packages/template-recorder/remotion/Root.tsx
+++ b/packages/template-recorder/remotion/Root.tsx
@@ -1,8 +1,8 @@
-import { Composition } from "remotion";
-import { videoConf } from "../config/scenes";
-import { GoToRecorder } from "./GoToRecorder";
-import { Main } from "./Main";
-import { calcMetadata } from "./calculate-metadata/calc-metadata";
+import { Composition } from 'remotion';
+import { videoConf } from '../config/scenes';
+import { GoToRecorder } from './GoToRecorder';
+import { Main } from './Main';
+import { calcMetadata } from './calculate-metadata/calc-metadata';
export const RemotionRoot = () => {
return (
@@ -12,73 +12,73 @@ export const RemotionRoot = () => {
id="welcome"
schema={videoConf}
defaultProps={{
- theme: "light" as const,
- canvasLayout: "square" as const,
+ theme: 'light' as const,
+ canvasLayout: 'square' as const,
scenes: [
{
- type: "recorder" as const,
+ type: 'recorder' as const,
durationInFrames: 80,
- music: "epic" as const,
+ music: 'epic' as const,
transitionToNextScene: true,
},
{
- type: "videoscene" as const,
- webcamPosition: "previous" as const,
+ type: 'videoscene' as const,
+ webcamPosition: 'previous' as const,
endOffset: 0,
transitionToNextScene: true,
- newChapter: "",
+ newChapter: '',
stopChapteringAfterThis: false,
- music: "previous" as const,
+ music: 'previous' as const,
startOffset: 0,
bRolls: [],
},
{
- type: "videoscene" as const,
- webcamPosition: "previous" as const,
+ type: 'videoscene' as const,
+ webcamPosition: 'previous' as const,
endOffset: 0,
transitionToNextScene: true,
- newChapter: "",
+ newChapter: '',
stopChapteringAfterThis: false,
- music: "previous" as const,
+ music: 'previous' as const,
startOffset: 0,
bRolls: [],
},
{
- type: "videoscene" as const,
- webcamPosition: "previous" as const,
+ type: 'videoscene' as const,
+ webcamPosition: 'previous' as const,
endOffset: 0,
transitionToNextScene: true,
- newChapter: "",
+ newChapter: '',
stopChapteringAfterThis: false,
- music: "previous" as const,
+ music: 'previous' as const,
startOffset: 0,
bRolls: [],
},
{
- type: "videoscene" as const,
- webcamPosition: "previous" as const,
+ type: 'videoscene' as const,
+ webcamPosition: 'previous' as const,
endOffset: 0,
transitionToNextScene: true,
- newChapter: "",
+ newChapter: '',
stopChapteringAfterThis: false,
- music: "previous" as const,
+ music: 'previous' as const,
startOffset: 0,
bRolls: [],
},
{
- music: "previous" as const,
+ music: 'previous' as const,
transitionToNextScene: true,
- type: "endcard" as const,
+ type: 'endcard' as const,
durationInFrames: 200,
- channel: "remotion" as const,
+ channel: 'remotion' as const,
links: [
- { link: "remotion.dev/recorder" },
- { link: "remotion.dev/discord" },
+ { link: 'remotion.dev/recorder' },
+ { link: 'remotion.dev/discord' },
],
},
],
scenesAndMetadata: [],
- platform: "x" as const,
+ platform: 'x' as const,
}}
calculateMetadata={calcMetadata}
/>
@@ -95,9 +95,9 @@ export const RemotionRoot = () => {
id="empty"
schema={videoConf}
defaultProps={{
- theme: "light" as const,
- canvasLayout: "square" as const,
- platform: "youtube",
+ theme: 'light' as const,
+ canvasLayout: 'square' as const,
+ platform: 'youtube',
scenes: [],
scenesAndMetadata: [],
}}
diff --git a/packages/template-recorder/remotion/animations/caption-transitions/should-transition-subtitle.ts b/packages/template-recorder/remotion/animations/caption-transitions/should-transition-subtitle.ts
index 1e5951d08f..97d88d7c9b 100644
--- a/packages/template-recorder/remotion/animations/caption-transitions/should-transition-subtitle.ts
+++ b/packages/template-recorder/remotion/animations/caption-transitions/should-transition-subtitle.ts
@@ -1,7 +1,7 @@
import type {
SceneAndMetadata,
VideoSceneAndMetadata,
-} from "../../../config/scenes";
+} from '../../../config/scenes';
// An inline subtitle transition:
// - The subtitle stays at the same position and is the same subtitle type
@@ -18,7 +18,7 @@ export const shouldInlineTransitionSubtitles = ({
return false;
}
- if (nextScene.type !== "video-scene") {
+ if (nextScene.type !== 'video-scene') {
return false;
}
diff --git a/packages/template-recorder/remotion/animations/caption-transitions/square.ts b/packages/template-recorder/remotion/animations/caption-transitions/square.ts
index 66bbe8776b..9c91fd8a5a 100644
--- a/packages/template-recorder/remotion/animations/caption-transitions/square.ts
+++ b/packages/template-recorder/remotion/animations/caption-transitions/square.ts
@@ -1,10 +1,10 @@
-import { getSafeSpace } from "../../../config/layout";
+import { getSafeSpace } from '../../../config/layout';
import type {
SceneAndMetadata,
VideoSceneAndMetadata,
-} from "../../../config/scenes";
-import type { Layout } from "../../layout/layout-types";
-import { isWebCamAtBottom, isWebCamRight } from "../webcam-transitions/helpers";
+} from '../../../config/scenes';
+import type { Layout } from '../../layout/layout-types';
+import { isWebCamAtBottom, isWebCamRight } from '../webcam-transitions/helpers';
const getEnterAndExitOfFullscreenBox = ({
scene,
@@ -19,7 +19,7 @@ const getEnterAndExitOfFullscreenBox = ({
canvasWidth: number;
subtitleLayout: Layout;
}) => {
- if (otherScene === null || otherScene.type !== "video-scene") {
+ if (otherScene === null || otherScene.type !== 'video-scene') {
return subtitleLayout;
}
@@ -52,8 +52,8 @@ const getEnterAndExitOfFullscreenBox = ({
const top = isWebCamAtBottom(scene.webcamPosition)
? otherScene.layout.webcamLayout.top -
subtitleLayout.height -
- getSafeSpace("square")
- : getSafeSpace("square") * 2 + otherScene.layout.webcamLayout.height;
+ getSafeSpace('square')
+ : getSafeSpace('square') * 2 + otherScene.layout.webcamLayout.height;
// If the webcam moves to the top right corner, the subtitle should come from left corner
if (!isWebCamRight(otherScene.webcamPosition)) {
@@ -136,7 +136,7 @@ const getEnterAndExitOfBentoLayout = ({
subtitleLayout: Layout;
}) => {
if (!scene.layout.displayLayout) {
- throw new Error("Expected display layout to be present");
+ throw new Error('Expected display layout to be present');
}
if (otherScene.layout.displayLayout) {
@@ -163,14 +163,14 @@ const getEnterAndExitOfBentoLayout = ({
if (isWebCamAtBottom(scene.webcamPosition)) {
return {
...subtitleLayout,
- top: getSafeSpace("square"),
+ top: getSafeSpace('square'),
left,
};
}
return {
...subtitleLayout,
- top: canvasHeight - subtitleLayout.height - getSafeSpace("square"),
+ top: canvasHeight - subtitleLayout.height - getSafeSpace('square'),
left,
};
}
@@ -178,10 +178,10 @@ const getEnterAndExitOfBentoLayout = ({
const top = isWebCamAtBottom(scene.webcamPosition)
? canvasHeight -
otherScene.layout.webcamLayout.height -
- getSafeSpace("square")
+ getSafeSpace('square')
: otherScene.layout.webcamLayout.height -
subtitleLayout.height +
- getSafeSpace("square");
+ getSafeSpace('square');
return {
...subtitleLayout,
@@ -203,7 +203,7 @@ export const getSquareEnterOrExit = ({
canvasHeight: number;
subtitleLayout: Layout;
}): Layout => {
- if (otherScene === null || otherScene.type !== "video-scene") {
+ if (otherScene === null || otherScene.type !== 'video-scene') {
return subtitleLayout;
}
diff --git a/packages/template-recorder/remotion/animations/caption-transitions/subtitle-transitions.ts b/packages/template-recorder/remotion/animations/caption-transitions/subtitle-transitions.ts
index 4c31f0aac2..c7189e1517 100644
--- a/packages/template-recorder/remotion/animations/caption-transitions/subtitle-transitions.ts
+++ b/packages/template-recorder/remotion/animations/caption-transitions/subtitle-transitions.ts
@@ -1,10 +1,10 @@
import type {
SceneAndMetadata,
VideoSceneAndMetadata,
-} from "../../../config/scenes";
-import type { Layout } from "../../layout/layout-types";
-import { interpolateLayout } from "../interpolate-layout";
-import { getSquareEnterOrExit } from "./square";
+} from '../../../config/scenes';
+import type { Layout } from '../../layout/layout-types';
+import { interpolateLayout } from '../interpolate-layout';
+import { getSquareEnterOrExit } from './square';
export const getSubtitleTransform = ({
enterProgress,
diff --git a/packages/template-recorder/remotion/animations/display-transitions/index.ts b/packages/template-recorder/remotion/animations/display-transitions/index.ts
index 454c11e2f0..c742bbf964 100644
--- a/packages/template-recorder/remotion/animations/display-transitions/index.ts
+++ b/packages/template-recorder/remotion/animations/display-transitions/index.ts
@@ -1,12 +1,12 @@
-import type { CanvasLayout } from "../../../config/layout";
+import type { CanvasLayout } from '../../../config/layout';
import type {
SceneAndMetadata,
VideoSceneAndMetadata,
-} from "../../../config/scenes";
-import type { Layout, LayoutAndFade } from "../../layout/layout-types";
-import { interpolateLayoutAndFade } from "../interpolate-layout";
-import { getLandscapeDisplayEnterOrExit } from "./landscape";
-import { getSquareDisplayEnterOrExit } from "./square";
+} from '../../../config/scenes';
+import type { Layout, LayoutAndFade } from '../../layout/layout-types';
+import { interpolateLayoutAndFade } from '../interpolate-layout';
+import { getLandscapeDisplayEnterOrExit } from './landscape';
+import { getSquareDisplayEnterOrExit } from './square';
const getDisplayStartOrEndLayout = ({
currentScene,
@@ -21,14 +21,14 @@ const getDisplayStartOrEndLayout = ({
canvasHeight: number;
canvasLayout: CanvasLayout;
}): LayoutAndFade => {
- if (canvasLayout === "landscape") {
+ if (canvasLayout === 'landscape') {
return getLandscapeDisplayEnterOrExit({
currentScene,
otherScene,
});
}
- if (canvasLayout === "square") {
+ if (canvasLayout === 'square') {
return getSquareDisplayEnterOrExit({
currentScene,
otherScene,
@@ -97,10 +97,10 @@ export const getDisplayPosition = ({
canvasLayout: CanvasLayout;
}): Layout => {
if (
- currentScene.type !== "video-scene" ||
+ currentScene.type !== 'video-scene' ||
currentScene.layout.displayLayout === null
) {
- throw new Error("no transitions on non-video scenes");
+ throw new Error('no transitions on non-video scenes');
}
const { enter, exit } = getDisplayTransitionOrigins({
diff --git a/packages/template-recorder/remotion/animations/display-transitions/landscape.ts b/packages/template-recorder/remotion/animations/display-transitions/landscape.ts
index 4aefcd474f..c422aec370 100644
--- a/packages/template-recorder/remotion/animations/display-transitions/landscape.ts
+++ b/packages/template-recorder/remotion/animations/display-transitions/landscape.ts
@@ -1,8 +1,8 @@
import type {
SceneAndMetadata,
VideoSceneAndMetadata,
-} from "../../../config/scenes";
-import type { LayoutAndFade } from "../../layout/layout-types";
+} from '../../../config/scenes';
+import type { LayoutAndFade } from '../../layout/layout-types';
export const getLandscapeDisplayEnterOrExit = ({
currentScene,
@@ -12,13 +12,13 @@ export const getLandscapeDisplayEnterOrExit = ({
currentScene: VideoSceneAndMetadata;
}): LayoutAndFade => {
if (
- currentScene.type !== "video-scene" ||
+ currentScene.type !== 'video-scene' ||
currentScene.layout.displayLayout === null
) {
- throw new Error("no transitions on non-video scenes");
+ throw new Error('no transitions on non-video scenes');
}
- if (otherScene === null || otherScene.type !== "video-scene") {
+ if (otherScene === null || otherScene.type !== 'video-scene') {
return {
layout: currentScene.layout.displayLayout,
shouldFadeRecording: false,
diff --git a/packages/template-recorder/remotion/animations/display-transitions/square.ts b/packages/template-recorder/remotion/animations/display-transitions/square.ts
index bb2e8f75ad..aac081bb6f 100644
--- a/packages/template-recorder/remotion/animations/display-transitions/square.ts
+++ b/packages/template-recorder/remotion/animations/display-transitions/square.ts
@@ -1,10 +1,10 @@
-import { getSafeSpace } from "../../../config/layout";
+import { getSafeSpace } from '../../../config/layout';
import type {
SceneAndMetadata,
VideoSceneAndMetadata,
-} from "../../../config/scenes";
-import type { LayoutAndFade } from "../../layout/layout-types";
-import { isWebCamAtBottom } from "../webcam-transitions/helpers";
+} from '../../../config/scenes';
+import type { LayoutAndFade } from '../../layout/layout-types';
+import { isWebCamAtBottom } from '../webcam-transitions/helpers';
export const getSquareDisplayEnterOrExit = ({
currentScene,
@@ -18,13 +18,13 @@ export const getSquareDisplayEnterOrExit = ({
canvasHeight: number;
}): LayoutAndFade => {
if (
- currentScene.type !== "video-scene" ||
+ currentScene.type !== 'video-scene' ||
currentScene.layout.displayLayout === null
) {
- throw new Error("no transitions on non-video scenes");
+ throw new Error('no transitions on non-video scenes');
}
- if (otherScene === null || otherScene.type !== "video-scene") {
+ if (otherScene === null || otherScene.type !== 'video-scene') {
return {
layout: currentScene.layout.displayLayout,
shouldFadeRecording: false,
@@ -70,31 +70,31 @@ export const getSquareDisplayEnterOrExit = ({
}
// 3. From top right to top: Should slide display to left
- if (currentScene.webcamPosition === "top-right") {
+ if (currentScene.webcamPosition === 'top-right') {
return {
layout: {
...currentScene.layout.displayLayout,
left: -currentScene.layout.displayLayout.width,
- top: otherScene.layout.webcamLayout.height + getSafeSpace("square") * 2,
+ top: otherScene.layout.webcamLayout.height + getSafeSpace('square') * 2,
},
shouldFadeRecording: false,
};
}
// 4. From top left to top: Should slide display to right
- if (currentScene.webcamPosition === "top-left") {
+ if (currentScene.webcamPosition === 'top-left') {
return {
layout: {
...currentScene.layout.displayLayout,
left: canvasWidth,
- top: otherScene.layout.webcamLayout.height + getSafeSpace("square") * 2,
+ top: otherScene.layout.webcamLayout.height + getSafeSpace('square') * 2,
},
shouldFadeRecording: false,
};
}
// 5. From bottom left to bottom: Display should disappear to right
- if (currentScene.webcamPosition === "bottom-left") {
+ if (currentScene.webcamPosition === 'bottom-left') {
return {
layout: {
...currentScene.layout.displayLayout,
@@ -103,14 +103,14 @@ export const getSquareDisplayEnterOrExit = ({
canvasHeight -
currentScene.layout.displayLayout.height -
otherScene.layout.webcamLayout.height -
- getSafeSpace("square") * 2,
+ getSafeSpace('square') * 2,
},
shouldFadeRecording: false,
};
}
// 6. From bottom right to bottom: Display should disappear to left
- if (currentScene.webcamPosition === "bottom-right") {
+ if (currentScene.webcamPosition === 'bottom-right') {
return {
layout: {
...currentScene.layout.displayLayout,
@@ -119,11 +119,11 @@ export const getSquareDisplayEnterOrExit = ({
canvasHeight -
currentScene.layout.displayLayout.height -
otherScene.layout.webcamLayout.height -
- getSafeSpace("square") * 2,
+ getSafeSpace('square') * 2,
},
shouldFadeRecording: false,
};
}
- throw new Error("Unhandled case");
+ throw new Error('Unhandled case');
};
diff --git a/packages/template-recorder/remotion/animations/interpolate-layout.ts b/packages/template-recorder/remotion/animations/interpolate-layout.ts
index 5c004f3fc6..4b06322de9 100644
--- a/packages/template-recorder/remotion/animations/interpolate-layout.ts
+++ b/packages/template-recorder/remotion/animations/interpolate-layout.ts
@@ -1,5 +1,5 @@
-import { interpolate } from "remotion";
-import type { Layout } from "../layout/layout-types";
+import { interpolate } from 'remotion';
+import type { Layout } from '../layout/layout-types';
export const interpolateLayout = (
firstLayout: Layout,
diff --git a/packages/template-recorder/remotion/animations/scene-transitions.ts b/packages/template-recorder/remotion/animations/scene-transitions.ts
index a3ff7f8905..ae8df59c7b 100644
--- a/packages/template-recorder/remotion/animations/scene-transitions.ts
+++ b/packages/template-recorder/remotion/animations/scene-transitions.ts
@@ -1,4 +1,4 @@
-import type { SceneAndMetadata } from "../../config/scenes";
+import type { SceneAndMetadata } from '../../config/scenes';
export const getSceneEnter = ({
canvasWidth,
@@ -18,8 +18,8 @@ export const getSceneEnter = ({
}
if (
- previousScene.type === "video-scene" &&
- currentScene.type === "video-scene"
+ previousScene.type === 'video-scene' &&
+ currentScene.type === 'video-scene'
) {
return {
left: 0,
@@ -46,7 +46,7 @@ export const getSceneExit = ({
};
}
- if (nextScene.type === "video-scene" && currentScene.type === "video-scene") {
+ if (nextScene.type === 'video-scene' && currentScene.type === 'video-scene') {
return {
left: 0,
};
diff --git a/packages/template-recorder/remotion/animations/transitions.ts b/packages/template-recorder/remotion/animations/transitions.ts
index 5b2aebfaea..4147fc52ce 100644
--- a/packages/template-recorder/remotion/animations/transitions.ts
+++ b/packages/template-recorder/remotion/animations/transitions.ts
@@ -1,16 +1,16 @@
-import type { Dimensions } from "@remotion/layout-utils";
-import type { CanvasLayout } from "../../config/layout";
+import type { Dimensions } from '@remotion/layout-utils';
+import type { CanvasLayout } from '../../config/layout';
import type {
SceneAndMetadata,
VideoSceneAndMetadata,
WebcamPositionForComparison,
-} from "../../config/scenes";
+} from '../../config/scenes';
const getComparableWebcamPosition = (
sceneAndMetaData: VideoSceneAndMetadata,
canvasLayout: CanvasLayout,
): WebcamPositionForComparison => {
- if (canvasLayout !== "square") {
+ if (canvasLayout !== 'square') {
return sceneAndMetaData.webcamPosition;
}
@@ -19,13 +19,13 @@ const getComparableWebcamPosition = (
}
if (
- sceneAndMetaData.webcamPosition === "bottom-left" ||
- sceneAndMetaData.webcamPosition === "bottom-right"
+ sceneAndMetaData.webcamPosition === 'bottom-left' ||
+ sceneAndMetaData.webcamPosition === 'bottom-right'
) {
- return "bottom";
+ return 'bottom';
}
- return "top";
+ return 'top';
};
const getHasSameSize = (
@@ -68,8 +68,8 @@ export const getShouldTransitionOut = ({
// If not both are video scenes, we can transition (slide)
if (
- sceneAndMetadata.type !== "video-scene" ||
- nextSceneAndMetadata.type !== "video-scene"
+ sceneAndMetadata.type !== 'video-scene' ||
+ nextSceneAndMetadata.type !== 'video-scene'
) {
return true;
}
diff --git a/packages/template-recorder/remotion/animations/webcam-transitions/helpers.ts b/packages/template-recorder/remotion/animations/webcam-transitions/helpers.ts
index ef98e43390..69b90e8408 100644
--- a/packages/template-recorder/remotion/animations/webcam-transitions/helpers.ts
+++ b/packages/template-recorder/remotion/animations/webcam-transitions/helpers.ts
@@ -1,19 +1,19 @@
-import type { SceneAndMetadata, WebcamPosition } from "../../../config/scenes";
+import type { SceneAndMetadata, WebcamPosition } from '../../../config/scenes';
export const isWebCamAtBottom = (webcamPosition: WebcamPosition) => {
- if (webcamPosition === "center") {
- throw new Error("Webcam position cannot be center if checking at bottom");
+ if (webcamPosition === 'center') {
+ throw new Error('Webcam position cannot be center if checking at bottom');
}
- return webcamPosition === "bottom-left" || webcamPosition === "bottom-right";
+ return webcamPosition === 'bottom-left' || webcamPosition === 'bottom-right';
};
export const isWebCamRight = (webcamPosition: WebcamPosition) => {
- if (webcamPosition === "center") {
- throw new Error("Webcam position cannot be center if checking at right");
+ if (webcamPosition === 'center') {
+ throw new Error('Webcam position cannot be center if checking at right');
}
- return webcamPosition === "top-right" || webcamPosition === "bottom-right";
+ return webcamPosition === 'top-right' || webcamPosition === 'bottom-right';
};
export const isGrowingFromMiniature = ({
@@ -23,11 +23,11 @@ export const isGrowingFromMiniature = ({
firstScene: SceneAndMetadata;
secondScene: SceneAndMetadata;
}) => {
- if (secondScene.type !== "video-scene") {
+ if (secondScene.type !== 'video-scene') {
return false;
}
- if (firstScene.type !== "video-scene") {
+ if (firstScene.type !== 'video-scene') {
return false;
}
@@ -45,11 +45,11 @@ export const isShrinkingToMiniature = ({
firstScene: SceneAndMetadata;
secondScene: SceneAndMetadata;
}) => {
- if (secondScene.type !== "video-scene") {
+ if (secondScene.type !== 'video-scene') {
return false;
}
- if (firstScene.type !== "video-scene") {
+ if (firstScene.type !== 'video-scene') {
return false;
}
diff --git a/packages/template-recorder/remotion/animations/webcam-transitions/index.ts b/packages/template-recorder/remotion/animations/webcam-transitions/index.ts
index 5df6a380d0..f98b9afdf5 100644
--- a/packages/template-recorder/remotion/animations/webcam-transitions/index.ts
+++ b/packages/template-recorder/remotion/animations/webcam-transitions/index.ts
@@ -1,12 +1,12 @@
-import type { CanvasLayout } from "../../../config/layout";
+import type { CanvasLayout } from '../../../config/layout';
import type {
SceneAndMetadata,
VideoSceneAndMetadata,
-} from "../../../config/scenes";
-import type { Layout, LayoutAndFade } from "../../layout/layout-types";
-import { interpolateLayoutAndFade } from "../interpolate-layout";
-import { getLandscapeWebCamStartOrEndLayout } from "./landscape";
-import { getSquareWebcamStartOrEndLayout } from "./square";
+} from '../../../config/scenes';
+import type { Layout, LayoutAndFade } from '../../layout/layout-types';
+import { interpolateLayoutAndFade } from '../interpolate-layout';
+import { getLandscapeWebCamStartOrEndLayout } from './landscape';
+import { getSquareWebcamStartOrEndLayout } from './square';
const getWebCamStartOrEndLayout = ({
canvasWidth,
@@ -21,7 +21,7 @@ const getWebCamStartOrEndLayout = ({
canvasHeight: number;
canvasLayout: CanvasLayout;
}): LayoutAndFade => {
- if (canvasLayout === "landscape") {
+ if (canvasLayout === 'landscape') {
return getLandscapeWebCamStartOrEndLayout({
currentScene,
otherScene,
@@ -29,7 +29,7 @@ const getWebCamStartOrEndLayout = ({
});
}
- if (canvasLayout === "square") {
+ if (canvasLayout === 'square') {
return getSquareWebcamStartOrEndLayout({
currentScene,
canvasHeight,
diff --git a/packages/template-recorder/remotion/animations/webcam-transitions/landscape.ts b/packages/template-recorder/remotion/animations/webcam-transitions/landscape.ts
index 7fc8afd829..6707fda61c 100644
--- a/packages/template-recorder/remotion/animations/webcam-transitions/landscape.ts
+++ b/packages/template-recorder/remotion/animations/webcam-transitions/landscape.ts
@@ -1,10 +1,10 @@
-import { getSafeSpace } from "../../../config/layout";
+import { getSafeSpace } from '../../../config/layout';
import type {
SceneAndMetadata,
VideoSceneAndMetadata,
-} from "../../../config/scenes";
-import type { LayoutAndFade } from "../../layout/layout-types";
-import { isWebCamRight } from "./helpers";
+} from '../../../config/scenes';
+import type { LayoutAndFade } from '../../layout/layout-types';
+import { isWebCamRight } from './helpers';
export const getLandscapeWebCamStartOrEndLayout = ({
canvasWidth,
@@ -17,7 +17,7 @@ export const getLandscapeWebCamStartOrEndLayout = ({
}): LayoutAndFade => {
const currentLayout = currentScene.layout.webcamLayout;
- if (!otherScene || otherScene.type !== "video-scene") {
+ if (!otherScene || otherScene.type !== 'video-scene') {
return { layout: currentLayout, shouldFadeRecording: false };
}
@@ -47,7 +47,7 @@ export const getLandscapeWebCamStartOrEndLayout = ({
return {
layout: {
...currentLayout,
- left: canvasWidth + getSafeSpace("landscape"),
+ left: canvasWidth + getSafeSpace('landscape'),
},
shouldFadeRecording: false,
};
@@ -56,7 +56,7 @@ export const getLandscapeWebCamStartOrEndLayout = ({
return {
layout: {
...currentLayout,
- left: -getSafeSpace("landscape") - currentLayout.width,
+ left: -getSafeSpace('landscape') - currentLayout.width,
},
shouldFadeRecording: false,
};
diff --git a/packages/template-recorder/remotion/animations/webcam-transitions/square.ts b/packages/template-recorder/remotion/animations/webcam-transitions/square.ts
index c95e22efe9..b96759410e 100644
--- a/packages/template-recorder/remotion/animations/webcam-transitions/square.ts
+++ b/packages/template-recorder/remotion/animations/webcam-transitions/square.ts
@@ -1,9 +1,9 @@
import type {
SceneAndMetadata,
VideoSceneAndMetadata,
-} from "../../../config/scenes";
-import type { LayoutAndFade } from "../../layout/layout-types";
-import { isWebCamAtBottom } from "./helpers";
+} from '../../../config/scenes';
+import type { LayoutAndFade } from '../../layout/layout-types';
+import { isWebCamAtBottom } from './helpers';
export const getSquareWebcamStartOrEndLayout = ({
otherScene,
@@ -14,14 +14,14 @@ export const getSquareWebcamStartOrEndLayout = ({
currentScene: VideoSceneAndMetadata;
canvasHeight: number;
}): LayoutAndFade => {
- if (!currentScene || currentScene.type !== "video-scene") {
- throw new Error("no transitions on non-video scenes");
+ if (!currentScene || currentScene.type !== 'video-scene') {
+ throw new Error('no transitions on non-video scenes');
}
const currentLayout = currentScene.layout.webcamLayout;
// No entrance if the other scene is not a video scene
- if (!otherScene || otherScene.type !== "video-scene") {
+ if (!otherScene || otherScene.type !== 'video-scene') {
return {
layout: currentScene.layout.webcamLayout,
shouldFadeRecording: false,
diff --git a/packages/template-recorder/remotion/audio/AudioTrack.tsx b/packages/template-recorder/remotion/audio/AudioTrack.tsx
index 5e04a2f094..61b73ce4a4 100644
--- a/packages/template-recorder/remotion/audio/AudioTrack.tsx
+++ b/packages/template-recorder/remotion/audio/AudioTrack.tsx
@@ -1,15 +1,15 @@
-import React, { useMemo } from "react";
-import { Audio, interpolate, Sequence, useVideoConfig } from "remotion";
-import type { CanvasLayout } from "../../config/layout";
-import type { SceneAndMetadata } from "../../config/scenes";
+import React, { useMemo } from 'react';
+import { Audio, interpolate, Sequence, useVideoConfig } from 'remotion';
+import type { CanvasLayout } from '../../config/layout';
+import type { SceneAndMetadata } from '../../config/scenes';
import {
AUDIO_FADE_IN_FRAMES,
BACKGROUND_VOLUME,
getAudioSource,
REGULAR_VOLUME,
-} from "../../config/sounds";
-import { SCENE_TRANSITION_DURATION } from "../../config/transitions";
-import { getShouldTransitionOut } from "../animations/transitions";
+} from '../../config/sounds';
+import { SCENE_TRANSITION_DURATION } from '../../config/transitions';
+import { getShouldTransitionOut } from '../animations/transitions';
type LoudPart = [number, number];
@@ -48,8 +48,8 @@ const calculateVolume =
],
[0, BACKGROUND_VOLUME, BACKGROUND_VOLUME, 0],
{
- extrapolateLeft: "clamp",
- extrapolateRight: "clamp",
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
},
);
@@ -118,11 +118,11 @@ export const AudioTrack: React.FC<{
addedUpDurations -= SCENE_TRANSITION_DURATION;
}
- const isLoud = scene.type !== "video-scene";
+ const isLoud = scene.type !== 'video-scene';
const { music } = scene.scene;
- if (music === "previous" && audioClips.length > 0) {
+ if (music === 'previous' && audioClips.length > 0) {
const lastAudioClip = audioClips[audioClips.length - 1] as TAudioTrack;
lastAudioClip.duration += metadataForScene.durationInFrames;
@@ -144,7 +144,7 @@ export const AudioTrack: React.FC<{
}
}
} else {
- if (music === "previous") {
+ if (music === 'previous') {
return;
}
@@ -162,7 +162,7 @@ export const AudioTrack: React.FC<{
return (
<>
{audioClips.map((clip) => {
- if (clip.src === "none") {
+ if (clip.src === 'none') {
return null;
}
diff --git a/packages/template-recorder/remotion/calculate-metadata/add-chapters-to-scenes.ts b/packages/template-recorder/remotion/calculate-metadata/add-chapters-to-scenes.ts
index 52d47e9e03..874fc5b2ee 100644
--- a/packages/template-recorder/remotion/calculate-metadata/add-chapters-to-scenes.ts
+++ b/packages/template-recorder/remotion/calculate-metadata/add-chapters-to-scenes.ts
@@ -1,4 +1,4 @@
-import { SceneAndMetadata } from "../../config/scenes";
+import { SceneAndMetadata } from '../../config/scenes';
export const addChaptersToScenesAndMetadata = (
scenesAndMetadata: SceneAndMetadata[],
@@ -7,7 +7,7 @@ export const addChaptersToScenesAndMetadata = (
const newScenes: SceneAndMetadata[] = [];
for (const scene of scenesAndMetadata) {
- if (scene.type !== "video-scene") {
+ if (scene.type !== 'video-scene') {
newScenes.push(scene);
continue;
}
diff --git a/packages/template-recorder/remotion/calculate-metadata/add-durations-to-scenes.ts b/packages/template-recorder/remotion/calculate-metadata/add-durations-to-scenes.ts
index ece0407581..db7f8294f0 100644
--- a/packages/template-recorder/remotion/calculate-metadata/add-durations-to-scenes.ts
+++ b/packages/template-recorder/remotion/calculate-metadata/add-durations-to-scenes.ts
@@ -1,12 +1,12 @@
-import { CanvasLayout } from "../../config/layout";
-import { SceneAndMetadata } from "../../config/scenes";
-import { SCENE_TRANSITION_DURATION } from "../../config/transitions";
+import { CanvasLayout } from '../../config/layout';
+import { SceneAndMetadata } from '../../config/scenes';
+import { SCENE_TRANSITION_DURATION } from '../../config/transitions';
import {
getShouldTransitionIn,
getShouldTransitionOut,
-} from "../animations/transitions";
-import { applyBRollRules } from "../scenes/BRoll/apply-b-roll-rules";
-import { addPlaceholderIfNoScenes } from "./empty-place-holder";
+} from '../animations/transitions';
+import { applyBRollRules } from '../scenes/BRoll/apply-b-roll-rules';
+import { addPlaceholderIfNoScenes } from './empty-place-holder';
export const addDurationsToScenes = (
scenes: SceneAndMetadata[],
@@ -40,7 +40,7 @@ export const addDurationsToScenes = (
const from = totalDurationInFrames;
totalDurationInFrames += sceneAndMetadata.durationInFrames;
- if (sceneAndMetadata.type === "other-scene") {
+ if (sceneAndMetadata.type === 'other-scene') {
return {
...sceneAndMetadata,
from,
diff --git a/packages/template-recorder/remotion/calculate-metadata/add-metadata-to-scene.ts b/packages/template-recorder/remotion/calculate-metadata/add-metadata-to-scene.ts
index e7951e92a7..87b24fa84c 100644
--- a/packages/template-recorder/remotion/calculate-metadata/add-metadata-to-scene.ts
+++ b/packages/template-recorder/remotion/calculate-metadata/add-metadata-to-scene.ts
@@ -1,18 +1,18 @@
-import { parseMedia } from "@remotion/media-parser";
-import { CanvasLayout } from "../../config/layout";
+import { parseMedia } from '@remotion/media-parser';
+import { CanvasLayout } from '../../config/layout';
import {
Cameras,
SceneAndMetadata,
SceneVideos,
SelectableScene,
-} from "../../config/scenes";
-import { calculateSrt } from "../captions/srt/helpers/calculate-srt";
-import { getBRollDimensions } from "../layout/get-broll-dimensions";
-import { getVideoSceneLayout } from "../layout/get-layout";
-import { PLACEHOLDER_DURATION_IN_FRAMES } from "./empty-place-holder";
-import { fetchCaptions } from "./fetch-captions";
-import { getFinalWebcamPosition } from "./get-final-webcam-position";
-import { getStartEndFrame } from "./get-start-end-frame";
+} from '../../config/scenes';
+import { calculateSrt } from '../captions/srt/helpers/calculate-srt';
+import { getBRollDimensions } from '../layout/get-broll-dimensions';
+import { getVideoSceneLayout } from '../layout/get-layout';
+import { PLACEHOLDER_DURATION_IN_FRAMES } from './empty-place-holder';
+import { fetchCaptions } from './fetch-captions';
+import { getFinalWebcamPosition } from './get-final-webcam-position';
+import { getStartEndFrame } from './get-start-end-frame';
export const addMetadataToScene = async ({
scene,
@@ -27,9 +27,9 @@ export const addMetadataToScene = async ({
canvasLayout: CanvasLayout;
allScenes: SelectableScene[];
}): Promise<SceneAndMetadata> => {
- if (scene.type !== "videoscene") {
+ if (scene.type !== 'videoscene') {
return {
- type: "other-scene",
+ type: 'other-scene',
scene,
durationInFrames: scene.durationInFrames,
from: 0,
@@ -38,9 +38,9 @@ export const addMetadataToScene = async ({
if (!cameras) {
return {
- type: "other-scene",
+ type: 'other-scene',
scene: {
- type: hasAtLeast1Camera ? "nomorerecordings" : "norecordings",
+ type: hasAtLeast1Camera ? 'nomorerecordings' : 'norecordings',
transitionToNextScene: scene.transitionToNextScene,
music: scene.music,
},
@@ -59,10 +59,10 @@ export const addMetadataToScene = async ({
});
if (!webcamMetadata.dimensions) {
- throw new Error("No dimensions for webcam");
+ throw new Error('No dimensions for webcam');
}
if (!webcamMetadata.durationInSeconds) {
- throw new Error("No duration for webcam");
+ throw new Error('No duration for webcam');
}
const displayMetadata = cameras.display
@@ -105,7 +105,7 @@ export const addMetadataToScene = async ({
};
return {
- type: "video-scene",
+ type: 'video-scene',
scene,
videos,
layout: getVideoSceneLayout({
diff --git a/packages/template-recorder/remotion/calculate-metadata/calc-metadata.ts b/packages/template-recorder/remotion/calculate-metadata/calc-metadata.ts
index 5c7f9a5209..9a997969e8 100644
--- a/packages/template-recorder/remotion/calculate-metadata/calc-metadata.ts
+++ b/packages/template-recorder/remotion/calculate-metadata/calc-metadata.ts
@@ -1,11 +1,11 @@
-import type { CalculateMetadataFunction } from "remotion";
-import { FPS } from "../../config/fps";
-import type { MainProps } from "../Main";
-import { getDimensionsForLayout } from "../layout/dimensions";
-import { addChaptersToScenesAndMetadata } from "./add-chapters-to-scenes";
-import { addDurationsToScenes } from "./add-durations-to-scenes";
-import { addMetadataToScene } from "./add-metadata-to-scene";
-import { getAllCameras } from "./get-camera";
+import type { CalculateMetadataFunction } from 'remotion';
+import { FPS } from '../../config/fps';
+import type { MainProps } from '../Main';
+import { getDimensionsForLayout } from '../layout/dimensions';
+import { addChaptersToScenesAndMetadata } from './add-chapters-to-scenes';
+import { addDurationsToScenes } from './add-durations-to-scenes';
+import { addMetadataToScene } from './add-metadata-to-scene';
+import { getAllCameras } from './get-camera';
export const calcMetadata: CalculateMetadataFunction<MainProps> = async ({
props,
diff --git a/packages/template-recorder/remotion/calculate-metadata/empty-place-holder.ts b/packages/template-recorder/remotion/calculate-metadata/empty-place-holder.ts
index b2b91faaec..27be8ff2a7 100644
--- a/packages/template-recorder/remotion/calculate-metadata/empty-place-holder.ts
+++ b/packages/template-recorder/remotion/calculate-metadata/empty-place-holder.ts
@@ -1,4 +1,4 @@
-import { SceneAndMetadata } from "../../config/scenes";
+import { SceneAndMetadata } from '../../config/scenes';
export const PLACEHOLDER_DURATION_IN_FRAMES = 60;
@@ -22,10 +22,10 @@ export const addPlaceholderIfNoScenes = ({
return {
scenesAndMetadataWithDuration: [
{
- type: "other-scene" as const,
+ type: 'other-scene' as const,
scene: {
- type: "noscenes" as const,
- music: "none",
+ type: 'noscenes' as const,
+ music: 'none',
transitionToNextScene: true,
},
durationInFrames: PLACEHOLDER_DURATION_IN_FRAMES,
diff --git a/packages/template-recorder/remotion/calculate-metadata/fetch-captions.ts b/packages/template-recorder/remotion/calculate-metadata/fetch-captions.ts
index e2ec7f7993..917a891602 100644
--- a/packages/template-recorder/remotion/calculate-metadata/fetch-captions.ts
+++ b/packages/template-recorder/remotion/calculate-metadata/fetch-captions.ts
@@ -1,5 +1,5 @@
-import { Caption } from "@remotion/captions";
-import { StaticFile } from "@remotion/studio";
+import { Caption } from '@remotion/captions';
+import { StaticFile } from '@remotion/studio';
export const fetchCaptions = async (
file: StaticFile | null,
@@ -19,7 +19,7 @@ export const fetchCaptions = async (
const captions = data as Caption[];
return captions;
} catch (error) {
- console.error("Error fetching WhisperOutput from JSON:", error);
+ console.error('Error fetching WhisperOutput from JSON:', error);
return null;
}
};
diff --git a/packages/template-recorder/remotion/calculate-metadata/get-camera.ts b/packages/template-recorder/remotion/calculate-metadata/get-camera.ts
index 1b22c6f2c4..de1b55682c 100644
--- a/packages/template-recorder/remotion/calculate-metadata/get-camera.ts
+++ b/packages/template-recorder/remotion/calculate-metadata/get-camera.ts
@@ -1,12 +1,12 @@
-import { StaticFile, getStaticFiles } from "remotion";
+import { StaticFile, getStaticFiles } from 'remotion';
import {
ALTERNATIVE1_PREFIX,
ALTERNATIVE2_PREFIX,
CAPTIONS_PREFIX,
DISPLAY_PREFIX,
WEBCAM_PREFIX,
-} from "../../config/cameras";
-import { Cameras, SelectableScene } from "../../config/scenes";
+} from '../../config/cameras';
+import { Cameras, SelectableScene } from '../../config/scenes';
type CamerasAndScene = {
scene: SelectableScene;
@@ -47,12 +47,12 @@ const mapFile = ({
const timestamp = file.name
// compositionId is case sensitive:
// Need to replace it first before calling .toLowerCase()
- .replace(`${compositionId}/${WEBCAM_PREFIX}`, "")
+ .replace(`${compositionId}/${WEBCAM_PREFIX}`, '')
.toLowerCase()
- .replace(".webm", "")
- .replace(".mov", "")
- .replace(".mkv", "")
- .replace(".mp4", "");
+ .replace('.webm', '')
+ .replace('.mov', '')
+ .replace('.mkv', '')
+ .replace('.mp4', '');
const display = findMatchingFile({
files,
@@ -112,7 +112,7 @@ export const getAllCameras = ({
let videoIndex = -1;
const scenesWithCameras = scenes.map((scene): CamerasAndScene => {
- if (scene.type !== "videoscene") {
+ if (scene.type !== 'videoscene') {
return { cameras: null, scene };
}
diff --git a/packages/template-recorder/remotion/calculate-metadata/get-final-webcam-position.ts b/packages/template-recorder/remotion/calculate-metadata/get-final-webcam-position.ts
index ded8891425..c4410a7895 100644
--- a/packages/template-recorder/remotion/calculate-metadata/get-final-webcam-position.ts
+++ b/packages/template-recorder/remotion/calculate-metadata/get-final-webcam-position.ts
@@ -1,10 +1,10 @@
-import { CanvasLayout } from "../../config/layout";
+import { CanvasLayout } from '../../config/layout';
import {
Cameras,
SelectableScene,
SelectableVideoScene,
WebcamPosition,
-} from "../../config/scenes";
+} from '../../config/scenes';
export const getFinalWebcamPosition = ({
scenes,
@@ -17,28 +17,28 @@ export const getFinalWebcamPosition = ({
cameras: Cameras;
canvasLayout: CanvasLayout;
}): WebcamPosition => {
- if (!cameras.display && canvasLayout === "landscape") {
- return "center";
+ if (!cameras.display && canvasLayout === 'landscape') {
+ return 'center';
}
let idx = scenes.findIndex((s) => s === scene);
let webcamPosition = scene.webcamPosition;
- while (webcamPosition === "previous" && idx >= 0) {
+ while (webcamPosition === 'previous' && idx >= 0) {
const prevScene = scenes[idx] as SelectableScene;
- if (prevScene.type === "videoscene") {
+ if (prevScene.type === 'videoscene') {
webcamPosition = prevScene.webcamPosition;
}
- if (webcamPosition === "previous" && idx === 0) {
- webcamPosition = "top-left";
+ if (webcamPosition === 'previous' && idx === 0) {
+ webcamPosition = 'top-left';
}
idx -= 1;
}
- if (webcamPosition === "previous") {
+ if (webcamPosition === 'previous') {
throw new Error('Invalid webcam position "previous"');
}
diff --git a/packages/template-recorder/remotion/calculate-metadata/get-start-end-frame.ts b/packages/template-recorder/remotion/calculate-metadata/get-start-end-frame.ts
index 1e9f144ac2..0d110137b2 100644
--- a/packages/template-recorder/remotion/calculate-metadata/get-start-end-frame.ts
+++ b/packages/template-recorder/remotion/calculate-metadata/get-start-end-frame.ts
@@ -1,7 +1,7 @@
-import { Caption } from "@remotion/captions";
-import { FPS } from "../../config/fps";
-import { SelectableVideoScene } from "../../config/scenes";
-import { postprocessCaptions } from "../captions/processing/postprocess-subs";
+import { Caption } from '@remotion/captions';
+import { FPS } from '../../config/fps';
+import { SelectableVideoScene } from '../../config/scenes';
+import { postprocessCaptions } from '../captions/processing/postprocess-subs';
const START_FRAME_PADDING = Math.ceil(FPS / 4);
const END_FRAME_PADDING = FPS / 2;
diff --git a/packages/template-recorder/remotion/captions/boxed/BoxedCaptions.tsx b/packages/template-recorder/remotion/captions/boxed/BoxedCaptions.tsx
index 6a3f9fee46..4f68bfda74 100644
--- a/packages/template-recorder/remotion/captions/boxed/BoxedCaptions.tsx
+++ b/packages/template-recorder/remotion/captions/boxed/BoxedCaptions.tsx
@@ -1,13 +1,13 @@
-import React from "react";
+import React from 'react';
import {
SceneAndMetadata,
VideoSceneAndMetadata,
-} from "../../../config/scenes";
-import { Theme } from "../../../config/themes";
-import { WaitForFonts } from "../../helpers/WaitForFonts";
-import { CaptionOverlay } from "../editor/CaptionOverlay";
-import { AnimatedCaptions } from "./components/AnimatedCaptions";
-import { NoCaptionsPlaceholder } from "./components/NoCaptionsPlaceholder";
+} from '../../../config/scenes';
+import { Theme } from '../../../config/themes';
+import { WaitForFonts } from '../../helpers/WaitForFonts';
+import { CaptionOverlay } from '../editor/CaptionOverlay';
+import { AnimatedCaptions } from './components/AnimatedCaptions';
+import { NoCaptionsPlaceholder } from './components/NoCaptionsPlaceholder';
export const BoxedCaptions: React.FC<{
sceneAndMetadata: VideoSceneAndMetadata;
diff --git a/packages/template-recorder/remotion/captions/boxed/components/AnimatedCaptions.tsx b/packages/template-recorder/remotion/captions/boxed/components/AnimatedCaptions.tsx
index 60eaa09088..7610b30dda 100644
--- a/packages/template-recorder/remotion/captions/boxed/components/AnimatedCaptions.tsx
+++ b/packages/template-recorder/remotion/captions/boxed/components/AnimatedCaptions.tsx
@@ -1,26 +1,26 @@
-import React, { useMemo } from "react";
-import { AbsoluteFill, useVideoConfig } from "remotion";
+import React, { useMemo } from 'react';
+import { AbsoluteFill, useVideoConfig } from 'remotion';
import type {
SceneAndMetadata,
VideoSceneAndMetadata,
-} from "../../../../config/scenes";
-import type { Theme } from "../../../../config/themes";
-import { COLORS } from "../../../../config/themes";
-import { shouldInlineTransitionSubtitles } from "../../../animations/caption-transitions/should-transition-subtitle";
-import { getSubtitleTransform } from "../../../animations/caption-transitions/subtitle-transitions";
-import { Layout } from "../../../layout/layout-types";
-import { useCaptions } from "../../editor/captions-provider";
-import { layoutCaptions } from "../../processing/layout-captions";
-import { postprocessCaptions } from "../../processing/postprocess-subs";
+} from '../../../../config/scenes';
+import type { Theme } from '../../../../config/themes';
+import { COLORS } from '../../../../config/themes';
+import { shouldInlineTransitionSubtitles } from '../../../animations/caption-transitions/should-transition-subtitle';
+import { getSubtitleTransform } from '../../../animations/caption-transitions/subtitle-transitions';
+import { Layout } from '../../../layout/layout-types';
+import { useCaptions } from '../../editor/captions-provider';
+import { layoutCaptions } from '../../processing/layout-captions';
+import { postprocessCaptions } from '../../processing/postprocess-subs';
import {
CaptionSentence,
getBorderWidthForSubtitles,
getSubtitlesLines,
-} from "./CaptionSentence";
+} from './CaptionSentence';
import {
TransitionFromPreviousSubtitles,
TransitionToNextSubtitles,
-} from "./TransitionBetweenSubtitles";
+} from './TransitionBetweenSubtitles';
const LINE_HEIGHT = 2;
const SUBTITLES_FONT_SIZE = 56;
@@ -78,13 +78,13 @@ export const AnimatedCaptions: React.FC<{
return {
fontSize: SUBTITLES_FONT_SIZE,
- display: "flex",
+ display: 'flex',
lineHeight: LINE_HEIGHT,
borderWidth: getBorderWidthForSubtitles(),
- borderStyle: "solid",
+ borderStyle: 'solid',
borderColor: COLORS[theme].BORDER_COLOR,
backgroundColor,
- justifyContent: "center",
+ justifyContent: 'center',
...getSubtitleTransform({
enterProgress,
exitProgress,
diff --git a/packages/template-recorder/remotion/captions/boxed/components/CaptionSentence.tsx b/packages/template-recorder/remotion/captions/boxed/components/CaptionSentence.tsx
index 2eabb5e71d..28840846fa 100644
--- a/packages/template-recorder/remotion/captions/boxed/components/CaptionSentence.tsx
+++ b/packages/template-recorder/remotion/captions/boxed/components/CaptionSentence.tsx
@@ -1,14 +1,14 @@
-import { Caption } from "@remotion/captions";
-import React from "react";
+import { Caption } from '@remotion/captions';
+import React from 'react';
import {
Sequence,
interpolate,
useCurrentFrame,
useVideoConfig,
-} from "remotion";
-import type { Theme } from "../../../../config/themes";
-import type { CaptionPage } from "../../types";
-import { LINE_HEIGHT, SquareSubtitles } from "./SquareSubtitles";
+} from 'remotion';
+import type { Theme } from '../../../../config/themes';
+import type { CaptionPage } from '../../types';
+import { LINE_HEIGHT, SquareSubtitles } from './SquareSubtitles';
const getStartOfSegment = (segment: CaptionPage) => {
if (segment.captions.length === 0) {
@@ -60,8 +60,8 @@ const FadeSentence: React.FC<{
[0, 5, Math.max(6, durationInFrames - 5), Math.max(7, durationInFrames)],
[0, 1, 1, 0],
{
- extrapolateRight: "clamp",
- extrapolateLeft: "clamp",
+ extrapolateRight: 'clamp',
+ extrapolateLeft: 'clamp',
},
);
diff --git a/packages/template-recorder/remotion/captions/boxed/components/NoCaptionsPlaceholder.tsx b/packages/template-recorder/remotion/captions/boxed/components/NoCaptionsPlaceholder.tsx
index 7910dd1d7c..056a6905de 100644
--- a/packages/template-recorder/remotion/captions/boxed/components/NoCaptionsPlaceholder.tsx
+++ b/packages/template-recorder/remotion/captions/boxed/components/NoCaptionsPlaceholder.tsx
@@ -1,9 +1,9 @@
-import React, { useMemo } from "react";
-import { AbsoluteFill, getRemotionEnvironment } from "remotion";
-import { MONOSPACE_FONT, REGULAR_FONT } from "../../../../config/fonts";
-import type { Theme } from "../../../../config/themes";
-import { COLORS } from "../../../../config/themes";
-import type { Layout } from "../../../layout/layout-types";
+import React, { useMemo } from 'react';
+import { AbsoluteFill, getRemotionEnvironment } from 'remotion';
+import { MONOSPACE_FONT, REGULAR_FONT } from '../../../../config/fonts';
+import type { Theme } from '../../../../config/themes';
+import { COLORS } from '../../../../config/themes';
+import type { Layout } from '../../../layout/layout-types';
export const NoCaptionsPlaceholder: React.FC<{
layout: Layout;
@@ -12,16 +12,16 @@ export const NoCaptionsPlaceholder: React.FC<{
const style: React.CSSProperties = useMemo(() => {
return {
...layout,
- display: "flex",
- justifyContent: "center",
- alignItems: "center",
- position: "absolute",
+ display: 'flex',
+ justifyContent: 'center',
+ alignItems: 'center',
+ position: 'absolute',
color: COLORS[theme].WORD_COLOR_ON_BG_APPEARED,
...REGULAR_FONT,
border: `2px ${COLORS[theme].BORDER_COLOR} solid`,
backgroundColor: COLORS[theme].BACKGROUND,
fontSize: 28,
- textAlign: "center",
+ textAlign: 'center',
padding: 20,
};
}, [layout, theme]);
@@ -30,7 +30,7 @@ export const NoCaptionsPlaceholder: React.FC<{
return {
...MONOSPACE_FONT,
color: COLORS[theme].ACCENT_COLOR,
- display: "inline",
+ display: 'inline',
};
}, [theme]);
diff --git a/packages/template-recorder/remotion/captions/boxed/components/SingleCaption.tsx b/packages/template-recorder/remotion/captions/boxed/components/SingleCaption.tsx
index 94d5ff717b..6011a0a91b 100644
--- a/packages/template-recorder/remotion/captions/boxed/components/SingleCaption.tsx
+++ b/packages/template-recorder/remotion/captions/boxed/components/SingleCaption.tsx
@@ -1,19 +1,19 @@
-import { Caption } from "@remotion/captions";
-import React, { useCallback, useMemo, useState } from "react";
+import { Caption } from '@remotion/captions';
+import React, { useCallback, useMemo, useState } from 'react';
import {
interpolateColors,
spring,
useCurrentFrame,
useVideoConfig,
-} from "remotion";
-import { MONOSPACE_FONT, REGULAR_FONT } from "../../../../config/fonts";
-import type { Theme } from "../../../../config/themes";
-import { COLORS } from "../../../../config/themes";
-import { useCaptionOverlay } from "../../editor/use-caption-overlay";
+} from 'remotion';
+import { MONOSPACE_FONT, REGULAR_FONT } from '../../../../config/fonts';
+import type { Theme } from '../../../../config/themes';
+import { COLORS } from '../../../../config/themes';
+import { useCaptionOverlay } from '../../editor/use-caption-overlay';
import {
isCaptionMonospace,
removeMonospaceTicks,
-} from "../../processing/split-caption-into-monospace-segments";
+} from '../../processing/split-caption-into-monospace-segments';
type CaptionColor = {
appeared: string;
@@ -41,7 +41,7 @@ const getShownCaptionColor = ({
if (isCaptionMonospace(caption)) {
if (active) {
- return "white";
+ return 'white';
}
return captionColor.appeared;
@@ -133,25 +133,25 @@ export const BoxedSingleCaption: React.FC<{
const backgroundColor = shouldHighlight
? COLORS[theme].ACCENT_COLOR
- : "transparent";
+ : 'transparent';
const style: React.CSSProperties = useMemo(() => {
return {
- display: "inline",
+ display: 'inline',
color: shownCaptionColor,
...(monospace ? MONOSPACE_FONT : REGULAR_FONT),
backgroundColor,
outline: hovered
- ? "2px solid black"
+ ? '2px solid black'
: active
- ? "5px solid " + backgroundColor
- : "none",
- whiteSpace: monospace ? "nowrap" : undefined,
+ ? '5px solid ' + backgroundColor
+ : 'none',
+ whiteSpace: monospace ? 'nowrap' : undefined,
// Fix gap inbetween background and outline
- boxShadow: shouldHighlight ? `0 0 0 1px ${backgroundColor}` : "none",
+ boxShadow: shouldHighlight ? `0 0 0 1px ${backgroundColor}` : 'none',
borderRadius: WORD_HIGHLIGHT_BORDER_RADIUS,
scale: String(progress),
- cursor: "pointer",
+ cursor: 'pointer',
};
}, [
active,
diff --git a/packages/template-recorder/remotion/captions/boxed/components/SquareSubtitles.tsx b/packages/template-recorder/remotion/captions/boxed/components/SquareSubtitles.tsx
index 1638773808..3b4a910b0d 100644
--- a/packages/template-recorder/remotion/captions/boxed/components/SquareSubtitles.tsx
+++ b/packages/template-recorder/remotion/captions/boxed/components/SquareSubtitles.tsx
@@ -1,8 +1,8 @@
-import React, { useMemo } from "react";
-import type { Theme } from "../../../../config/themes";
-import { getHorizontalPaddingForSubtitles } from "../../processing/layout-captions";
-import type { CaptionPage } from "../../types";
-import { BoxedSingleCaption } from "./SingleCaption";
+import React, { useMemo } from 'react';
+import type { Theme } from '../../../../config/themes';
+import { getHorizontalPaddingForSubtitles } from '../../processing/layout-captions';
+import type { CaptionPage } from '../../types';
+import { BoxedSingleCaption } from './SingleCaption';
export const LINE_HEIGHT = 1.2;
@@ -22,13 +22,13 @@ export const SquareSubtitles: React.FC<{
const style: React.CSSProperties = useMemo(() => {
return {
lineHeight: LINE_HEIGHT,
- display: "inline-block",
- boxDecorationBreak: "clone",
- WebkitBoxDecorationBreak: "clone",
+ display: 'inline-block',
+ boxDecorationBreak: 'clone',
+ WebkitBoxDecorationBreak: 'clone',
paddingLeft: getHorizontalPaddingForSubtitles(),
paddingRight: getHorizontalPaddingForSubtitles(),
- wordBreak: "break-word",
- width: "100%",
+ wordBreak: 'break-word',
+ width: '100%',
};
}, []);
diff --git a/packages/template-recorder/remotion/captions/boxed/components/TransitionBetweenSubtitles.tsx b/packages/template-recorder/remotion/captions/boxed/components/TransitionBetweenSubtitles.tsx
index 736d912e0d..2427632b08 100644
--- a/packages/template-recorder/remotion/captions/boxed/components/TransitionBetweenSubtitles.tsx
+++ b/packages/template-recorder/remotion/captions/boxed/components/TransitionBetweenSubtitles.tsx
@@ -1,6 +1,6 @@
-import React from "react";
-import { interpolate, useCurrentFrame, useVideoConfig } from "remotion";
-import { SCENE_TRANSITION_DURATION } from "../../../../config/transitions";
+import React from 'react';
+import { interpolate, useCurrentFrame, useVideoConfig } from 'remotion';
+import { SCENE_TRANSITION_DURATION } from '../../../../config/transitions';
export const TransitionFromPreviousSubtitles: React.FC<{
children: React.ReactNode;
@@ -20,8 +20,8 @@ export const TransitionFromPreviousSubtitles: React.FC<{
[SCENE_TRANSITION_DURATION, SCENE_TRANSITION_DURATION + 5],
[0, 1],
{
- extrapolateLeft: "clamp",
- extrapolateRight: "clamp",
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
},
),
}}
@@ -53,8 +53,8 @@ export const TransitionToNextSubtitles: React.FC<{
],
[1, 0],
{
- extrapolateLeft: "clamp",
- extrapolateRight: "clamp",
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
},
),
}}
diff --git a/packages/template-recorder/remotion/captions/editor/CaptionOverlay.tsx b/packages/template-recorder/remotion/captions/editor/CaptionOverlay.tsx
index 90bfc32d05..d5e799ebdb 100644
--- a/packages/template-recorder/remotion/captions/editor/CaptionOverlay.tsx
+++ b/packages/template-recorder/remotion/captions/editor/CaptionOverlay.tsx
@@ -1,12 +1,12 @@
-import { Caption } from "@remotion/captions";
-import React, { useEffect, useMemo, useState } from "react";
-import type { StaticFile } from "remotion";
-import { continueRender, delayRender, watchStaticFile } from "remotion";
-import type { Theme } from "../../../config/themes";
-import { CaptionsEditor } from "./CaptionsEditor";
-import type { CaptionsContextType } from "./captions-provider";
-import { CaptionsProvider } from "./captions-provider";
-import { CaptionOverlayProvider } from "./use-caption-overlay";
+import { Caption } from '@remotion/captions';
+import React, { useEffect, useMemo, useState } from 'react';
+import type { StaticFile } from 'remotion';
+import { continueRender, delayRender, watchStaticFile } from 'remotion';
+import type { Theme } from '../../../config/themes';
+import { CaptionsEditor } from './CaptionsEditor';
+import type { CaptionsContextType } from './captions-provider';
+import { CaptionsProvider } from './captions-provider';
+import { CaptionOverlayProvider } from './use-caption-overlay';
export const CaptionOverlay: React.FC<{
children: React.ReactNode;
@@ -15,12 +15,12 @@ export const CaptionOverlay: React.FC<{
trimStart: number;
}> = ({ children, file, theme, trimStart }) => {
const [captions, setCaptions] = useState<Caption[] | null>(null);
- const [handle] = useState(() => delayRender("Waiting for captions "));
+ const [handle] = useState(() => delayRender('Waiting for captions '));
const [subEditorOpen, setSubEditorOpen] = useState<Caption | false>(false);
const [changeStatus, setChangeStatus] = useState<
- "initial" | "changed" | "unchanged"
- >("initial");
+ 'initial' | 'changed' | 'unchanged'
+ >('initial');
const state = useMemo(() => {
return { open: subEditorOpen, setOpen: setSubEditorOpen };
@@ -37,7 +37,7 @@ export const CaptionOverlay: React.FC<{
file.name,
(newData: StaticFile | null) => {
if (newData) {
- setChangeStatus("changed");
+ setChangeStatus('changed');
}
},
);
@@ -47,14 +47,14 @@ export const CaptionOverlay: React.FC<{
}, [file.name, subEditorOpen]);
useEffect(() => {
- if (changeStatus === "initial" || changeStatus === "changed") {
+ if (changeStatus === 'initial' || changeStatus === 'changed') {
fetch(file.src)
.then((res) => res.json())
.then((d) => {
continueRender(handle);
setCaptions(d);
});
- setChangeStatus("unchanged");
+ setChangeStatus('unchanged');
}
}, [changeStatus, file.src, handle]);
diff --git a/packages/template-recorder/remotion/captions/editor/CaptionsEditor.tsx b/packages/template-recorder/remotion/captions/editor/CaptionsEditor.tsx
index 7928476440..9f657e1af4 100644
--- a/packages/template-recorder/remotion/captions/editor/CaptionsEditor.tsx
+++ b/packages/template-recorder/remotion/captions/editor/CaptionsEditor.tsx
@@ -1,14 +1,14 @@
-import { Caption } from "@remotion/captions";
-import { writeStaticFile } from "@remotion/studio";
-import React, { useCallback, useEffect } from "react";
-import ReactDOM from "react-dom";
-import { AbsoluteFill } from "remotion";
-import type { Theme } from "../../../config/themes";
-import { EditCaption } from "./EditCaption";
-import { SubsEditorFooter } from "./Footer";
-import { SubsEditorHeader } from "./Header";
-import { FOOTER_HEIGHT, HEADER_HEIGHT, captionEditorPortal } from "./layout";
-import { useCaptionOverlay } from "./use-caption-overlay";
+import { Caption } from '@remotion/captions';
+import { writeStaticFile } from '@remotion/studio';
+import React, { useCallback, useEffect } from 'react';
+import ReactDOM from 'react-dom';
+import { AbsoluteFill } from 'remotion';
+import type { Theme } from '../../../config/themes';
+import { EditCaption } from './EditCaption';
+import { SubsEditorFooter } from './Footer';
+import { SubsEditorHeader } from './Header';
+import { FOOTER_HEIGHT, HEADER_HEIGHT, captionEditorPortal } from './layout';
+import { useCaptionOverlay } from './use-caption-overlay';
export const CaptionsEditor: React.FC<{
captions: Caption[];
@@ -34,7 +34,7 @@ export const CaptionsEditor: React.FC<{
}
if (!window.remotion_publicFolderExists) {
- throw new Error("window.remotion_publicFolderExists is not set");
+ throw new Error('window.remotion_publicFolderExists is not set');
}
const newOutput = updater(old);
@@ -79,15 +79,15 @@ export const CaptionsEditor: React.FC<{
useEffect(() => {
const onKeyDown = (e: KeyboardEvent) => {
- if (e.key === "Escape") {
+ if (e.key === 'Escape') {
e.preventDefault();
overlay.setOpen(false);
}
};
- window.addEventListener("keydown", onKeyDown);
+ window.addEventListener('keydown', onKeyDown);
return () => {
- window.removeEventListener("keydown", onKeyDown);
+ window.removeEventListener('keydown', onKeyDown);
};
}, [overlay, overlay.setOpen]);
@@ -98,12 +98,12 @@ export const CaptionsEditor: React.FC<{
return ReactDOM.createPortal(
<AbsoluteFill
style={{
- backgroundColor: "rgba(255, 255, 255, 0.9)",
+ backgroundColor: 'rgba(255, 255, 255, 0.9)',
}}
>
<AbsoluteFill
style={{
- overflowY: "auto",
+ overflowY: 'auto',
paddingTop: HEADER_HEIGHT,
paddingBottom: FOOTER_HEIGHT,
}}
@@ -111,7 +111,7 @@ export const CaptionsEditor: React.FC<{
{captions.map((caption, i) => {
return (
<EditCaption
- key={[caption.startMs, caption.endMs, i].join("-")}
+ key={[caption.startMs, caption.endMs, i].join('-')}
theme={theme}
index={i}
longestNumberLength={longestNumberLength}
diff --git a/packages/template-recorder/remotion/captions/editor/EditCaption.tsx b/packages/template-recorder/remotion/captions/editor/EditCaption.tsx
index f3904accbb..2b27033b9f 100644
--- a/packages/template-recorder/remotion/captions/editor/EditCaption.tsx
+++ b/packages/template-recorder/remotion/captions/editor/EditCaption.tsx
@@ -1,14 +1,14 @@
-import { Caption } from "@remotion/captions";
-import React, { useCallback, useEffect, useRef, useState } from "react";
-import { useCurrentFrame, useVideoConfig } from "remotion";
-import type { Theme } from "../../../config/themes";
-import { COLORS } from "../../../config/themes";
+import { Caption } from '@remotion/captions';
+import React, { useCallback, useEffect, useRef, useState } from 'react';
+import { useCurrentFrame, useVideoConfig } from 'remotion';
+import type { Theme } from '../../../config/themes';
+import { COLORS } from '../../../config/themes';
import {
FIRST_COLUMN_WIDTH,
SECOND_COLUMN_WIDTH,
SIDE_PADDING,
-} from "./layout";
-import { useCaptionOverlay } from "./use-caption-overlay";
+} from './layout';
+import { useCaptionOverlay } from './use-caption-overlay';
const Indent: React.FC<{ value: number; digits: number }> = ({
digits,
@@ -20,8 +20,8 @@ const Indent: React.FC<{ value: number; digits: number }> = ({
<span style={{ opacity: 0 }}>
{new Array(indentTo)
.fill(0)
- .map(() => "0")
- .join("")}
+ .map(() => '0')
+ .join('')}
</span>
);
};
@@ -63,19 +63,19 @@ export const EditCaption: React.FC<{
);
const isMonospaced =
- caption.text.trim().startsWith("`") && caption.text.trim().endsWith("`");
+ caption.text.trim().startsWith('`') && caption.text.trim().endsWith('`');
const toggleMonospace = useCallback(() => {
if (isMonospaced) {
- onUpdateText(index, caption.text.replace(/`/g, ""));
+ onUpdateText(index, caption.text.replace(/`/g, ''));
} else {
let newCaption = caption.text;
- if (!newCaption.trim().startsWith("`")) {
- newCaption = "`" + newCaption;
+ if (!newCaption.trim().startsWith('`')) {
+ newCaption = '`' + newCaption;
}
- if (!newCaption.trim().endsWith("`") || newCaption.trim().length === 1) {
- newCaption += "`";
+ if (!newCaption.trim().endsWith('`') || newCaption.trim().length === 1) {
+ newCaption += '`';
}
onUpdateText(index, newCaption);
@@ -85,46 +85,46 @@ export const EditCaption: React.FC<{
useEffect(() => {
if (active && initialFrame !== frame) {
ref.current?.scrollIntoView({
- behavior: "auto",
- block: "center",
+ behavior: 'auto',
+ block: 'center',
});
}
}, [active, frame, initialFrame]);
const onInputKeyDown = useCallback(
(e: React.KeyboardEvent<HTMLInputElement>) => {
- if (e.key === "ArrowDown") {
+ if (e.key === 'ArrowDown') {
e.preventDefault();
const next = ref.current?.nextElementSibling?.querySelector(
- "input[type=text]",
+ 'input[type=text]',
) as HTMLInputElement | undefined;
if (next) {
next.focus();
- next.scrollIntoView({ behavior: "auto", block: "center" });
+ next.scrollIntoView({ behavior: 'auto', block: 'center' });
}
}
- if (e.key === "ArrowUp") {
+ if (e.key === 'ArrowUp') {
e.preventDefault();
const prev = ref.current?.previousElementSibling?.querySelector(
- "input[type=text]",
+ 'input[type=text]',
) as HTMLInputElement | undefined;
if (prev) {
prev.focus();
- prev.scrollIntoView({ behavior: "auto", block: "center" });
+ prev.scrollIntoView({ behavior: 'auto', block: 'center' });
}
}
- if (e.key === "Enter") {
+ if (e.key === 'Enter') {
e.preventDefault();
overlay.setOpen(false);
}
- const ctrlOrCommandKey = window.navigator.platform.startsWith("Mac")
+ const ctrlOrCommandKey = window.navigator.platform.startsWith('Mac')
? e.metaKey
: e.ctrlKey;
- if (e.key === "i" && ctrlOrCommandKey) {
+ if (e.key === 'i' && ctrlOrCommandKey) {
e.preventDefault();
toggleMonospace();
}
@@ -136,35 +136,35 @@ export const EditCaption: React.FC<{
<div
ref={ref}
style={{
- flexDirection: "row",
- display: "flex",
+ flexDirection: 'row',
+ display: 'flex',
paddingTop: 5,
paddingBottom: 5,
paddingLeft: SIDE_PADDING,
paddingRight: SIDE_PADDING,
- backgroundColor: active ? "rgba(0, 0, 0, 0.1)" : "transparent",
+ backgroundColor: active ? 'rgba(0, 0, 0, 0.1)' : 'transparent',
}}
>
<div
style={{
- fontFamily: "Helvetica",
+ fontFamily: 'Helvetica',
fontSize: 30,
width: FIRST_COLUMN_WIDTH * usableWidth,
- fontVariantNumeric: "tabular-nums",
- color: "gray",
- textAlign: "right",
+ fontVariantNumeric: 'tabular-nums',
+ color: 'gray',
+ textAlign: 'right',
paddingRight: 30,
}}
>
<Indent value={caption.startMs} digits={longestNumberLength} />
- {String(caption.startMs)} :{" "}
+ {String(caption.startMs)} :{' '}
<Indent value={caption.endMs} digits={longestNumberLength} />
{caption.endMs}
</div>
<div
style={{
width: SECOND_COLUMN_WIDTH * usableWidth,
- whiteSpace: "pre",
+ whiteSpace: 'pre',
}}
>
<input
@@ -172,10 +172,10 @@ export const EditCaption: React.FC<{
autoFocus={isInitialCaption}
style={{
fontSize: 30,
- fontFamily: isMonospaced ? "monospace" : "Helvetica",
- backgroundColor: "transparent",
- border: "none",
- color: isMonospaced ? COLORS[theme].ACCENT_COLOR : "black",
+ fontFamily: isMonospaced ? 'monospace' : 'Helvetica',
+ backgroundColor: 'transparent',
+ border: 'none',
+ color: isMonospaced ? COLORS[theme].ACCENT_COLOR : 'black',
}}
value={caption.text}
onKeyDown={onInputKeyDown}
@@ -188,13 +188,13 @@ export const EditCaption: React.FC<{
width: 30,
height: 30,
border: isMonospaced
- ? "2px solid " + COLORS[theme].ACCENT_COLOR
- : "2px solid gray",
+ ? '2px solid ' + COLORS[theme].ACCENT_COLOR
+ : '2px solid gray',
borderRadius: 3,
- cursor: "pointer",
+ cursor: 'pointer',
background: isMonospaced
? COLORS[theme].ACCENT_COLOR
- : "transparent",
+ : 'transparent',
}}
onClick={toggleMonospace}
/>
diff --git a/packages/template-recorder/remotion/captions/editor/Footer.tsx b/packages/template-recorder/remotion/captions/editor/Footer.tsx
index 7a9c63f34a..e83329c74a 100644
--- a/packages/template-recorder/remotion/captions/editor/Footer.tsx
+++ b/packages/template-recorder/remotion/captions/editor/Footer.tsx
@@ -1,6 +1,6 @@
-import React, { useCallback } from "react";
-import { FOOTER_HEIGHT, SIDE_PADDING } from "./layout";
-import { useCaptionOverlay } from "./use-caption-overlay";
+import React, { useCallback } from 'react';
+import { FOOTER_HEIGHT, SIDE_PADDING } from './layout';
+import { useCaptionOverlay } from './use-caption-overlay';
export const SubsEditorFooter: React.FC<{
fileName: string;
@@ -14,24 +14,24 @@ export const SubsEditorFooter: React.FC<{
return (
<div
style={{
- display: "flex",
- flexDirection: "row",
+ display: 'flex',
+ flexDirection: 'row',
height: FOOTER_HEIGHT,
- width: "100%",
- backgroundImage: "linear-gradient(rgba(255, 255, 255, 0), white 20%)",
- position: "absolute",
+ width: '100%',
+ backgroundImage: 'linear-gradient(rgba(255, 255, 255, 0), white 20%)',
+ position: 'absolute',
bottom: 0,
paddingTop: 20,
paddingLeft: SIDE_PADDING,
paddingRight: SIDE_PADDING,
- alignItems: "center",
+ alignItems: 'center',
}}
>
<div
style={{
fontSize: 20,
- fontFamily: "sans-serif",
- color: "gray",
+ fontFamily: 'sans-serif',
+ color: 'gray',
flex: 1,
}}
>
@@ -42,21 +42,21 @@ export const SubsEditorFooter: React.FC<{
<div>
<button
style={{
- backgroundColor: "black",
+ backgroundColor: 'black',
fontSize: 30,
- color: "white",
+ color: 'white',
borderRadius: 7,
- padding: "12px 30px",
- cursor: "pointer",
+ padding: '12px 30px',
+ cursor: 'pointer',
}}
- type={"button"}
+ type={'button'}
onClick={onCloseSubEditor}
>
- Done{" "}
+ Done{' '}
<kbd
style={{
- color: "rgba(255, 255, 255, 0.4)",
- fontSize: "0.9em",
+ color: 'rgba(255, 255, 255, 0.4)',
+ fontSize: '0.9em',
marginLeft: 5,
}}
>
diff --git a/packages/template-recorder/remotion/captions/editor/Header.tsx b/packages/template-recorder/remotion/captions/editor/Header.tsx
index c7b28b259f..6c092b43dd 100644
--- a/packages/template-recorder/remotion/captions/editor/Header.tsx
+++ b/packages/template-recorder/remotion/captions/editor/Header.tsx
@@ -1,15 +1,15 @@
-import React from "react";
-import { useVideoConfig } from "remotion";
+import React from 'react';
+import { useVideoConfig } from 'remotion';
import {
FIRST_COLUMN_WIDTH,
HEADER_HEIGHT,
SECOND_COLUMN_WIDTH,
SIDE_PADDING,
-} from "./layout";
+} from './layout';
-const cmdOrCtrlCharacter = window.navigator.platform.startsWith("Mac")
- ? "⌘"
- : "Ctrl";
+const cmdOrCtrlCharacter = window.navigator.platform.startsWith('Mac')
+ ? '⌘'
+ : 'Ctrl';
export const SubsEditorHeader: React.FC = () => {
const { width } = useVideoConfig();
@@ -19,22 +19,22 @@ export const SubsEditorHeader: React.FC = () => {
<div
style={{
height: HEADER_HEIGHT,
- width: "100%",
- backgroundImage: "linear-gradient(white 60%, rgba(255, 255, 255, 0))",
- position: "absolute",
+ width: '100%',
+ backgroundImage: 'linear-gradient(white 60%, rgba(255, 255, 255, 0))',
+ position: 'absolute',
paddingLeft: SIDE_PADDING,
paddingRight: SIDE_PADDING,
- display: "flex",
- flexDirection: "row",
+ display: 'flex',
+ flexDirection: 'row',
}}
>
<div
style={{
- fontFamily: "Helvetica",
+ fontFamily: 'Helvetica',
fontSize: 20,
paddingTop: 30,
- color: "gray",
- textAlign: "right",
+ color: 'gray',
+ textAlign: 'right',
paddingRight: 30,
width: FIRST_COLUMN_WIDTH * usableWidth,
}}
@@ -43,10 +43,10 @@ export const SubsEditorHeader: React.FC = () => {
</div>
<div
style={{
- fontFamily: "Helvetica",
+ fontFamily: 'Helvetica',
fontSize: 20,
paddingTop: 30,
- color: "gray",
+ color: 'gray',
width: SECOND_COLUMN_WIDTH * usableWidth,
}}
>
@@ -54,10 +54,10 @@ export const SubsEditorHeader: React.FC = () => {
</div>
<div
style={{
- fontFamily: "Helvetica",
+ fontFamily: 'Helvetica',
fontSize: 20,
paddingTop: 30,
- color: "gray",
+ color: 'gray',
}}
>
MONOSPACE <kbd>({cmdOrCtrlCharacter}+I)</kbd>
diff --git a/packages/template-recorder/remotion/captions/editor/captions-provider.tsx b/packages/template-recorder/remotion/captions/editor/captions-provider.tsx
index bdf3b50796..ffa8329cf3 100644
--- a/packages/template-recorder/remotion/captions/editor/captions-provider.tsx
+++ b/packages/template-recorder/remotion/captions/editor/captions-provider.tsx
@@ -1,5 +1,5 @@
-import { Caption } from "@remotion/captions";
-import React, { useContext } from "react";
+import { Caption } from '@remotion/captions';
+import React, { useContext } from 'react';
export type CaptionsContextType = {
captions: Caption[] | null;
@@ -9,7 +9,7 @@ export type CaptionsContextType = {
const context = React.createContext<CaptionsContextType>({
captions: null,
setCaptions: () => {
- throw new Error("React Context not initialized");
+ throw new Error('React Context not initialized');
},
});
@@ -17,7 +17,7 @@ export const useCaptions = (): Caption[] => {
const ctx = useContext(context);
if (!ctx.captions) {
- throw new Error("Should not render without a captions");
+ throw new Error('Should not render without a captions');
}
return ctx.captions;
diff --git a/packages/template-recorder/remotion/captions/editor/layout.tsx b/packages/template-recorder/remotion/captions/editor/layout.tsx
index eeefff44a4..794ad68355 100644
--- a/packages/template-recorder/remotion/captions/editor/layout.tsx
+++ b/packages/template-recorder/remotion/captions/editor/layout.tsx
@@ -1,4 +1,4 @@
-import React from "react";
+import React from 'react';
export const captionEditorPortal = React.createRef<HTMLDivElement>();
diff --git a/packages/template-recorder/remotion/captions/editor/use-caption-overlay.tsx b/packages/template-recorder/remotion/captions/editor/use-caption-overlay.tsx
index d619009a84..004ae99fbe 100644
--- a/packages/template-recorder/remotion/captions/editor/use-caption-overlay.tsx
+++ b/packages/template-recorder/remotion/captions/editor/use-caption-overlay.tsx
@@ -1,5 +1,5 @@
-import { Caption } from "@remotion/captions";
-import React, { useContext, useMemo } from "react";
+import { Caption } from '@remotion/captions';
+import React, { useContext, useMemo } from 'react';
type CaptionOverlayContext = {
open: Caption | false;
@@ -9,7 +9,7 @@ type CaptionOverlayContext = {
const context = React.createContext<CaptionOverlayContext>({
open: false,
setOpen: () => {
- throw new Error("React Context not initialized");
+ throw new Error('React Context not initialized');
},
});
diff --git a/packages/template-recorder/remotion/captions/processing/fix-backticks.ts b/packages/template-recorder/remotion/captions/processing/fix-backticks.ts
index 5951cfdc71..ba898c1e5c 100644
--- a/packages/template-recorder/remotion/captions/processing/fix-backticks.ts
+++ b/packages/template-recorder/remotion/captions/processing/fix-backticks.ts
@@ -1,4 +1,4 @@
-import { Caption } from "@remotion/captions";
+import { Caption } from '@remotion/captions';
export const fixBackticks = (_captions: Caption[]): Caption[] => {
const newCaptions: Caption[] = [];
@@ -6,7 +6,7 @@ export const fixBackticks = (_captions: Caption[]): Caption[] => {
const captions = _captions.map((caption) => {
return {
...caption,
- text: caption.text.replaceAll(/`\s/g, " `"),
+ text: caption.text.replaceAll(/`\s/g, ' `'),
};
});
@@ -14,13 +14,13 @@ export const fixBackticks = (_captions: Caption[]): Caption[] => {
const caption = captions[i] as Caption;
const previousCaption = captions[i - 1] ?? null;
- if (caption.text.startsWith(". ")) {
+ if (caption.text.startsWith('. ')) {
const lastAddedCaption = newCaptions[newCaptions.length - 1] as Caption;
- lastAddedCaption.text += ".";
+ lastAddedCaption.text += '.';
caption.text = caption.text.slice(1);
}
- if (!caption.text.startsWith(" ") && previousCaption) {
+ if (!caption.text.startsWith(' ') && previousCaption) {
const lastAddedCaption = newCaptions[newCaptions.length - 1] as Caption;
lastAddedCaption.text += caption.text;
lastAddedCaption.endMs = caption.endMs;
@@ -34,7 +34,7 @@ export const fixBackticks = (_captions: Caption[]): Caption[] => {
...w,
text:
// Remove double backticks: ` n``px`` rem``otion`` render`
- w.text.replaceAll(/``/g, ""),
+ w.text.replaceAll(/``/g, ''),
};
});
};
diff --git a/packages/template-recorder/remotion/captions/processing/has-monospace-in-caption.ts b/packages/template-recorder/remotion/captions/processing/has-monospace-in-caption.ts
index 1f288322be..3d1dd32e88 100644
--- a/packages/template-recorder/remotion/captions/processing/has-monospace-in-caption.ts
+++ b/packages/template-recorder/remotion/captions/processing/has-monospace-in-caption.ts
@@ -1,7 +1,7 @@
-import { Caption } from "@remotion/captions";
+import { Caption } from '@remotion/captions';
export const hasMonoSpaceInCaption = (caption: Caption) => {
- if (caption.text.split("").filter((char) => char === "`").length >= 2) {
+ if (caption.text.split('').filter((char) => char === '`').length >= 2) {
return true;
}
diff --git a/packages/template-recorder/remotion/captions/processing/join-backticks.ts b/packages/template-recorder/remotion/captions/processing/join-backticks.ts
index e5a8fec30b..785dec2495 100644
--- a/packages/template-recorder/remotion/captions/processing/join-backticks.ts
+++ b/packages/template-recorder/remotion/captions/processing/join-backticks.ts
@@ -1,4 +1,4 @@
-import { Caption } from "@remotion/captions";
+import { Caption } from '@remotion/captions';
export const joinBackticks = (captions: Caption[]): Caption[] => {
const newCaptions: Caption[] = [];
@@ -6,10 +6,10 @@ export const joinBackticks = (captions: Caption[]): Caption[] => {
const previousCaption = newCaptions[i - 1] ?? null;
const newCaption = captions[i] as Caption;
- const previousCaptionEndsInMonospace = previousCaption?.text.endsWith("`");
+ const previousCaptionEndsInMonospace = previousCaption?.text.endsWith('`');
if (previousCaption && previousCaptionEndsInMonospace) {
- if (newCaption.text.startsWith("`")) {
+ if (newCaption.text.startsWith('`')) {
previousCaption.text = previousCaption.text.substring(
0,
previousCaption.text.length - 1,
@@ -17,12 +17,12 @@ export const joinBackticks = (captions: Caption[]): Caption[] => {
newCaption.text = newCaption.text.slice(1);
}
- if (newCaption.text.startsWith(" `")) {
+ if (newCaption.text.startsWith(' `')) {
previousCaption.text = previousCaption.text.substring(
0,
previousCaption.text.length - 1,
);
- newCaption.text = " " + newCaption.text.slice(2);
+ newCaption.text = ' ' + newCaption.text.slice(2);
}
}
diff --git a/packages/template-recorder/remotion/captions/processing/layout-captions.ts b/packages/template-recorder/remotion/captions/processing/layout-captions.ts
index 1895d553c7..6e9f8fe1c7 100644
--- a/packages/template-recorder/remotion/captions/processing/layout-captions.ts
+++ b/packages/template-recorder/remotion/captions/processing/layout-captions.ts
@@ -1,15 +1,15 @@
-import { Caption } from "@remotion/captions";
-import { fillTextBox } from "@remotion/layout-utils";
-import { MONOSPACE_FONT, REGULAR_FONT } from "../../../config/fonts";
-import { getSafeSpace } from "../../../config/layout";
-import { getBorderWidthForSubtitles } from "../boxed/components/CaptionSentence";
-import { CaptionPage, LayoutedCaptions } from "../types";
-import { hasMonoSpaceInCaption } from "./has-monospace-in-caption";
+import { Caption } from '@remotion/captions';
+import { fillTextBox } from '@remotion/layout-utils';
+import { MONOSPACE_FONT, REGULAR_FONT } from '../../../config/fonts';
+import { getSafeSpace } from '../../../config/layout';
+import { getBorderWidthForSubtitles } from '../boxed/components/CaptionSentence';
+import { CaptionPage, LayoutedCaptions } from '../types';
+import { hasMonoSpaceInCaption } from './has-monospace-in-caption';
import {
isCaptionMonospace,
removeMonospaceTicks,
splitCaptionIntoMonospaceSegments,
-} from "./split-caption-into-monospace-segments";
+} from './split-caption-into-monospace-segments';
const balanceCaptions = ({
captions,
@@ -34,7 +34,7 @@ const balanceCaptions = ({
for (let i = 1; i < 4; i++) {
const index = bestCut - i;
const caption = (captions[index] as Caption).text.trim();
- if (caption.endsWith(",") || caption.endsWith(".")) {
+ if (caption.endsWith(',') || caption.endsWith('.')) {
bestCut = index + 1;
break;
}
@@ -42,7 +42,7 @@ const balanceCaptions = ({
while (
(bestCut > 1 && hasMonoSpaceInCaption(captions[bestCut - 1] as Caption)) ||
- (captions[bestCut - 1] as Caption).text.trim() === ""
+ (captions[bestCut - 1] as Caption).text.trim() === ''
) {
bestCut--;
}
@@ -119,7 +119,7 @@ const cutCaptions = ({
};
export const getHorizontalPaddingForSubtitles = () => {
- return getSafeSpace("square");
+ return getSafeSpace('square');
};
export const layoutCaptions = ({
diff --git a/packages/template-recorder/remotion/captions/processing/postprocess-subs.ts b/packages/template-recorder/remotion/captions/processing/postprocess-subs.ts
index 8080983a53..e972e4260b 100644
--- a/packages/template-recorder/remotion/captions/processing/postprocess-subs.ts
+++ b/packages/template-recorder/remotion/captions/processing/postprocess-subs.ts
@@ -1,26 +1,26 @@
-import { Caption } from "@remotion/captions";
-import { autocorrectWords } from "../../../config/autocorrect";
-import { fixBackticks } from "./fix-backticks";
-import { removeBlankTokens } from "./remove-blank-tokens";
+import { Caption } from '@remotion/captions';
+import { autocorrectWords } from '../../../config/autocorrect';
+import { fixBackticks } from './fix-backticks';
+import { removeBlankTokens } from './remove-blank-tokens';
const FILLER_WORDS = [
- "[PAUSE]",
- "[BLANK_AUDIO]",
- "[Silence]",
- "[silence]",
- "[INAUDIBLE]",
+ '[PAUSE]',
+ '[BLANK_AUDIO]',
+ '[Silence]',
+ '[silence]',
+ '[INAUDIBLE]',
];
const removeWhisperBlankWords = (original: Caption[]): Caption[] => {
let firstIdx = 0;
- let concatenatedCaption = "";
+ let concatenatedCaption = '';
let inBlank = false;
const captions = [...original];
captions.forEach((caption, index) => {
const captionCopy = { ...caption };
captionCopy.text = captionCopy.text.trim();
- if (captionCopy.text.includes("[")) {
+ if (captionCopy.text.includes('[')) {
inBlank = true;
firstIdx = index;
}
@@ -29,7 +29,7 @@ const removeWhisperBlankWords = (original: Caption[]): Caption[] => {
concatenatedCaption += captionCopy.text;
}
- if (inBlank && captionCopy.text.includes("]")) {
+ if (inBlank && captionCopy.text.includes(']')) {
concatenatedCaption += captionCopy.text;
if (
FILLER_WORDS.find((caption) => concatenatedCaption.includes(caption))
@@ -39,7 +39,7 @@ const removeWhisperBlankWords = (original: Caption[]): Caption[] => {
if (currentCaption?.text !== undefined) {
captions[i] = {
...currentCaption,
- text: "",
+ text: '',
};
}
}
@@ -54,7 +54,7 @@ export const postprocessCaptions = (subTypes: Caption[]): Caption[] => {
const removeBlankAudioAndPause = removeWhisperBlankWords(blankTokensRemoved);
const removeBlankTokensAgain = removeBlankAudioAndPause.filter(
- (w) => w.text.trim() !== "",
+ (w) => w.text.trim() !== '',
);
const correctedCaptions = autocorrectWords(removeBlankTokensAgain);
diff --git a/packages/template-recorder/remotion/captions/processing/remove-blank-tokens.ts b/packages/template-recorder/remotion/captions/processing/remove-blank-tokens.ts
index 78bfea29df..5140b31381 100644
--- a/packages/template-recorder/remotion/captions/processing/remove-blank-tokens.ts
+++ b/packages/template-recorder/remotion/captions/processing/remove-blank-tokens.ts
@@ -1,8 +1,8 @@
-import { Caption } from "@remotion/captions";
+import { Caption } from '@remotion/captions';
export const removeBlankTokens = (tokens: Caption[]): Caption[] => {
return tokens
- .filter((t) => t.text.trim() !== "")
+ .filter((t) => t.text.trim() !== '')
.filter((t) => {
return !t.text.match(/TT_(\d+)/);
});
diff --git a/packages/template-recorder/remotion/captions/processing/split-caption-into-monospace-segments.ts b/packages/template-recorder/remotion/captions/processing/split-caption-into-monospace-segments.ts
index d8a96c24d7..32577c318d 100644
--- a/packages/template-recorder/remotion/captions/processing/split-caption-into-monospace-segments.ts
+++ b/packages/template-recorder/remotion/captions/processing/split-caption-into-monospace-segments.ts
@@ -1,4 +1,4 @@
-import { Caption } from "@remotion/captions";
+import { Caption } from '@remotion/captions';
export const splitCaptionIntoMonospaceSegments = (
caption: Caption,
@@ -19,7 +19,7 @@ export const splitCaptionIntoMonospaceSegments = (
result.push({
...caption,
- text: `${("`" + match[1]) as string}\``,
+ text: `${('`' + match[1]) as string}\``,
});
lastIndex = regex.lastIndex;
}
@@ -32,7 +32,7 @@ export const splitCaptionIntoMonospaceSegments = (
};
export const isCaptionMonospace = (caption: Caption) => {
- return caption.text.startsWith("`") && caption.text.endsWith("`");
+ return caption.text.startsWith('`') && caption.text.endsWith('`');
};
export const removeMonospaceTicks = (caption: Caption) => {
diff --git a/packages/template-recorder/remotion/captions/srt/EmitSrtFile.tsx b/packages/template-recorder/remotion/captions/srt/EmitSrtFile.tsx
index 35da58900e..7dcea5979c 100644
--- a/packages/template-recorder/remotion/captions/srt/EmitSrtFile.tsx
+++ b/packages/template-recorder/remotion/captions/srt/EmitSrtFile.tsx
@@ -1,9 +1,9 @@
-import React, { useMemo } from "react";
-import { Artifact, useCurrentFrame } from "remotion";
-import { FPS } from "../../../config/fps";
-import { SceneAndMetadata } from "../../../config/scenes";
-import { combineSrt } from "./helpers/combine-srt";
-import { serializeSrt } from "./helpers/serialize-srt";
+import React, { useMemo } from 'react';
+import { Artifact, useCurrentFrame } from 'remotion';
+import { FPS } from '../../../config/fps';
+import { SceneAndMetadata } from '../../../config/scenes';
+import { combineSrt } from './helpers/combine-srt';
+import { serializeSrt } from './helpers/serialize-srt';
// Rendering this component will cause an `captions.srt` file to be generated
// while rendering.
@@ -16,7 +16,7 @@ export const EmitSrtFile: React.FC<{
const toCombine = scenesAndMetadata.map((scene) => {
return {
offsetInMs: Math.round((scene.from * 1000) / FPS),
- srts: scene.type === "video-scene" ? scene.srt : [],
+ srts: scene.type === 'video-scene' ? scene.srt : [],
};
});
diff --git a/packages/template-recorder/remotion/captions/srt/SrtPreviewAndEditor/SingleCaption.tsx b/packages/template-recorder/remotion/captions/srt/SrtPreviewAndEditor/SingleCaption.tsx
index fee0017d5a..fbc4033d1f 100644
--- a/packages/template-recorder/remotion/captions/srt/SrtPreviewAndEditor/SingleCaption.tsx
+++ b/packages/template-recorder/remotion/captions/srt/SrtPreviewAndEditor/SingleCaption.tsx
@@ -1,6 +1,6 @@
-import { Caption } from "@remotion/captions";
-import React, { useCallback, useMemo, useState } from "react";
-import { useCaptionOverlay } from "../../editor/use-caption-overlay";
+import { Caption } from '@remotion/captions';
+import React, { useCallback, useMemo, useState } from 'react';
+import { useCaptionOverlay } from '../../editor/use-caption-overlay';
export const SrtSingleCaption: React.FC<{
caption: Caption;
@@ -19,8 +19,8 @@ export const SrtSingleCaption: React.FC<{
const style: React.CSSProperties = useMemo(() => {
return {
- cursor: "pointer",
- color: hovered ? "gray" : "inherit",
+ cursor: 'pointer',
+ color: hovered ? 'gray' : 'inherit',
};
}, [hovered]);
diff --git a/packages/template-recorder/remotion/captions/srt/SrtPreviewAndEditor/SrtPreview.tsx b/packages/template-recorder/remotion/captions/srt/SrtPreviewAndEditor/SrtPreview.tsx
index 93220e0bd0..46e4bb45ef 100644
--- a/packages/template-recorder/remotion/captions/srt/SrtPreviewAndEditor/SrtPreview.tsx
+++ b/packages/template-recorder/remotion/captions/srt/SrtPreviewAndEditor/SrtPreview.tsx
@@ -1,8 +1,8 @@
-import React, { useMemo } from "react";
-import { Sequence, useVideoConfig } from "remotion";
-import { useCaptions } from "../../editor/captions-provider";
-import { calculateSrt } from "../helpers/calculate-srt";
-import { SrtPreviewLine } from "./SrtPreviewLine";
+import React, { useMemo } from 'react';
+import { Sequence, useVideoConfig } from 'remotion';
+import { useCaptions } from '../../editor/captions-provider';
+import { calculateSrt } from '../helpers/calculate-srt';
+import { SrtPreviewLine } from './SrtPreviewLine';
export const SrtPreview: React.FC<{
startFrame: number;
diff --git a/packages/template-recorder/remotion/captions/srt/SrtPreviewAndEditor/SrtPreviewAndEditor.tsx b/packages/template-recorder/remotion/captions/srt/SrtPreviewAndEditor/SrtPreviewAndEditor.tsx
index 64aab31633..e8c12446be 100644
--- a/packages/template-recorder/remotion/captions/srt/SrtPreviewAndEditor/SrtPreviewAndEditor.tsx
+++ b/packages/template-recorder/remotion/captions/srt/SrtPreviewAndEditor/SrtPreviewAndEditor.tsx
@@ -1,9 +1,9 @@
-import { StaticFile } from "@remotion/studio";
-import React from "react";
-import { getRemotionEnvironment } from "remotion";
-import { Theme } from "../../../../config/themes";
-import { CaptionOverlay } from "../../editor/CaptionOverlay";
-import { SrtPreview } from "./SrtPreview";
+import { StaticFile } from '@remotion/studio';
+import React from 'react';
+import { getRemotionEnvironment } from 'remotion';
+import { Theme } from '../../../../config/themes';
+import { CaptionOverlay } from '../../editor/CaptionOverlay';
+import { SrtPreview } from './SrtPreview';
export const SrtPreviewAndEditor: React.FC<{
captions: StaticFile;
diff --git a/packages/template-recorder/remotion/captions/srt/SrtPreviewAndEditor/SrtPreviewLine.tsx b/packages/template-recorder/remotion/captions/srt/SrtPreviewAndEditor/SrtPreviewLine.tsx
index caa4ba478e..f7055ef7df 100644
--- a/packages/template-recorder/remotion/captions/srt/SrtPreviewAndEditor/SrtPreviewLine.tsx
+++ b/packages/template-recorder/remotion/captions/srt/SrtPreviewAndEditor/SrtPreviewLine.tsx
@@ -1,27 +1,27 @@
-import React from "react";
-import { UnserializedSrt } from "../helpers/serialize-srt";
-import { SrtSingleCaption } from "./SingleCaption";
+import React from 'react';
+import { UnserializedSrt } from '../helpers/serialize-srt';
+import { SrtSingleCaption } from './SingleCaption';
const container: React.CSSProperties = {
- justifyContent: "flex-end",
- alignItems: "center",
- position: "absolute",
+ justifyContent: 'flex-end',
+ alignItems: 'center',
+ position: 'absolute',
bottom: 0,
- width: "100%",
- display: "flex",
- flexDirection: "column",
+ width: '100%',
+ display: 'flex',
+ flexDirection: 'column',
};
const inner: React.CSSProperties = {
- backgroundColor: "rgba(0, 0, 0, 0.8)",
- padding: "12px 15px",
- color: "white",
- fontFamily: "Helvetica, Arial, sans-serif",
- pointerEvents: "unset",
+ backgroundColor: 'rgba(0, 0, 0, 0.8)',
+ padding: '12px 15px',
+ color: 'white',
+ fontFamily: 'Helvetica, Arial, sans-serif',
+ pointerEvents: 'unset',
borderRadius: 10,
fontSize: 48,
bottom: 50,
- position: "absolute",
+ position: 'absolute',
};
export const SrtPreviewLine: React.FC<{
diff --git a/packages/template-recorder/remotion/captions/srt/helpers/calculate-srt.ts b/packages/template-recorder/remotion/captions/srt/helpers/calculate-srt.ts
index b54b87771e..7fbe356cdf 100644
--- a/packages/template-recorder/remotion/captions/srt/helpers/calculate-srt.ts
+++ b/packages/template-recorder/remotion/captions/srt/helpers/calculate-srt.ts
@@ -1,8 +1,8 @@
-import type { Caption } from "@remotion/captions";
-import { FPS } from "../../../../config/fps";
-import { joinBackticks } from "../../processing/join-backticks";
-import { postprocessCaptions } from "../../processing/postprocess-subs";
-import type { UnserializedSrt } from "./serialize-srt";
+import type { Caption } from '@remotion/captions';
+import { FPS } from '../../../../config/fps';
+import { joinBackticks } from '../../processing/join-backticks';
+import { postprocessCaptions } from '../../processing/postprocess-subs';
+import type { UnserializedSrt } from './serialize-srt';
// The SRT standard recommends not more than 42 characters per line
@@ -64,17 +64,20 @@ export const calculateSrt = ({
const lastSegment = segment[segment.length - 1];
if (!firstSegment) {
- throw new Error("lastSegment is undefined");
+ throw new Error('lastSegment is undefined');
}
if (!lastSegment) {
- throw new Error("lastSegment is undefined");
+ throw new Error('lastSegment is undefined');
}
const offset = -(startFrame / FPS) * 1000;
- const firstTimestampMs = Math.max(0, Math.round(firstSegment.startMs + offset));
+ const firstTimestampMs = Math.max(
+ 0,
+ Math.round(firstSegment.startMs + offset),
+ );
if (lastSegment.endMs === null) {
- throw new Error("Cannot serialize .srt file: lastTimestamp is null");
+ throw new Error('Cannot serialize .srt file: lastTimestamp is null');
}
const lastTimestampMs = Math.max(0, lastSegment.endMs + offset);
@@ -84,7 +87,7 @@ export const calculateSrt = ({
lastTimestampMs,
text: segment
.map((s) => s.text.trim())
- .join(" ")
+ .join(' ')
.trim(),
captions: segment,
};
diff --git a/packages/template-recorder/remotion/captions/srt/helpers/combine-srt.ts b/packages/template-recorder/remotion/captions/srt/helpers/combine-srt.ts
index 9ed43b6c8a..17eef3da5e 100644
--- a/packages/template-recorder/remotion/captions/srt/helpers/combine-srt.ts
+++ b/packages/template-recorder/remotion/captions/srt/helpers/combine-srt.ts
@@ -1,4 +1,4 @@
-import { UnserializedSrt } from "./serialize-srt";
+import { UnserializedSrt } from './serialize-srt';
export type SrtsToCombine = {
offsetInMs: number;
diff --git a/packages/template-recorder/remotion/captions/srt/helpers/parse-srt.ts b/packages/template-recorder/remotion/captions/srt/helpers/parse-srt.ts
index cb950a0b9e..51ef2df797 100644
--- a/packages/template-recorder/remotion/captions/srt/helpers/parse-srt.ts
+++ b/packages/template-recorder/remotion/captions/srt/helpers/parse-srt.ts
@@ -8,7 +8,7 @@ export type ParsedSrtLine = {
export type ParsedSrt = ParsedSrtLine[];
function toSeconds(time: string) {
- const [first, second, third] = time.split(":");
+ const [first, second, third] = time.split(':');
if (!first) {
throw new Error(`Invalid timestamp:${time}`);
}
@@ -19,7 +19,7 @@ function toSeconds(time: string) {
throw new Error(`Invalid timestamp:${time}`);
}
- const [seconds, millis] = third.split(",");
+ const [seconds, millis] = third.split(',');
if (!seconds) {
throw new Error(`Invalid timestamp:${time}`);
}
@@ -36,30 +36,30 @@ function toSeconds(time: string) {
}
export const parseSrt = (input: string): ParsedSrt => {
- const inputLines = input.split("\n");
+ const inputLines = input.split('\n');
const lines: ParsedSrtLine[] = [];
for (let i = 0; i < inputLines.length; i++) {
const line = inputLines[i];
const nextLine = inputLines[i + 1];
- if (line?.match(/([0-9]+)/) && nextLine?.includes(" --> ")) {
- const nextLineSplit = nextLine.split(" --> ");
+ if (line?.match(/([0-9]+)/) && nextLine?.includes(' --> ')) {
+ const nextLineSplit = nextLine.split(' --> ');
const start = toSeconds(nextLineSplit[0] as string);
const end = toSeconds(nextLineSplit[1] as string);
lines.push({
index: Number(line),
- text: "",
+ text: '',
startInSeconds: start,
endInSeconds: end,
});
- } else if (line?.includes(" --> ")) {
+ } else if (line?.includes(' --> ')) {
continue;
- } else if (line?.trim() === "") {
+ } else if (line?.trim() === '') {
(lines[lines.length - 1] as ParsedSrtLine).text = (
lines[lines.length - 1] as ParsedSrtLine
).text.trim();
} else {
- (lines[lines.length - 1] as ParsedSrtLine).text += line + "\n";
+ (lines[lines.length - 1] as ParsedSrtLine).text += line + '\n';
}
}
diff --git a/packages/template-recorder/remotion/captions/srt/helpers/serialize-srt.ts b/packages/template-recorder/remotion/captions/srt/helpers/serialize-srt.ts
index c808b4efb0..d89e487c09 100644
--- a/packages/template-recorder/remotion/captions/srt/helpers/serialize-srt.ts
+++ b/packages/template-recorder/remotion/captions/srt/helpers/serialize-srt.ts
@@ -1,4 +1,4 @@
-import { Caption } from "@remotion/captions";
+import { Caption } from '@remotion/captions';
export type UnserializedSrt = {
firstTimestampMs: number;
@@ -14,7 +14,7 @@ const formatSingleSrtTimestamp = (timestamp: number) => {
const seconds = Math.floor((timestamp % 60000) / 1000);
const milliseconds = Math.floor(timestamp % 1000);
- return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")},${String(milliseconds).padStart(3, "0")}`;
+ return `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')},${String(milliseconds).padStart(3, '0')}`;
};
const formatSrtTimestamp = (startMs: number, endMs: number) => {
@@ -33,7 +33,7 @@ export const serializeSrt = (srt: UnserializedSrt[]) => {
formatSrtTimestamp(s.firstTimestampMs, s.lastTimestampMs),
// Text
s.text,
- ].join("\n");
+ ].join('\n');
})
- .join("\n\n");
+ .join('\n\n');
};
diff --git a/packages/template-recorder/remotion/captions/types.ts b/packages/template-recorder/remotion/captions/types.ts
index 73df47a365..7948494937 100644
--- a/packages/template-recorder/remotion/captions/types.ts
+++ b/packages/template-recorder/remotion/captions/types.ts
@@ -1,4 +1,4 @@
-import { Caption } from "@remotion/captions";
+import { Caption } from '@remotion/captions';
export type CaptionPage = {
captions: Caption[];
diff --git a/packages/template-recorder/remotion/chapters/landscape/ChapterTimestamp.tsx b/packages/template-recorder/remotion/chapters/landscape/ChapterTimestamp.tsx
index dba599ccb5..2c531f8aae 100644
--- a/packages/template-recorder/remotion/chapters/landscape/ChapterTimestamp.tsx
+++ b/packages/template-recorder/remotion/chapters/landscape/ChapterTimestamp.tsx
@@ -1,9 +1,9 @@
-import { measureText } from "@remotion/layout-utils";
-import React, { useMemo } from "react";
-import { TITLE_FONT } from "../../../config/fonts";
-import { FPS } from "../../../config/fps";
-import { formatMilliseconds } from "../../../src/helpers/format-time";
-import { ChapterType } from "../make-chapters";
+import { measureText } from '@remotion/layout-utils';
+import React, { useMemo } from 'react';
+import { TITLE_FONT } from '../../../config/fonts';
+import { FPS } from '../../../config/fps';
+import { formatMilliseconds } from '../../../src/helpers/format-time';
+import { ChapterType } from '../make-chapters';
const chapterFontSize = 32;
@@ -29,17 +29,17 @@ export const ChapterTimestamp: React.FC<{
const style: React.CSSProperties = useMemo(() => {
return {
- backgroundColor: "black",
- color: "white",
+ backgroundColor: 'black',
+ color: 'white',
padding: `${PADDING_VERTICAL}px 0px`,
fontSize: chapterFontSize,
...TITLE_FONT,
width: biggestWidth + PADDING_HORIZONTAL * 2,
- textAlign: "center",
- height: "100%",
- justifyContent: "center",
- alignItems: "center",
- display: "flex",
+ textAlign: 'center',
+ height: '100%',
+ justifyContent: 'center',
+ alignItems: 'center',
+ display: 'flex',
};
}, [biggestWidth]);
diff --git a/packages/template-recorder/remotion/chapters/landscape/ChapterTitle.tsx b/packages/template-recorder/remotion/chapters/landscape/ChapterTitle.tsx
index df66112d64..9df7d00797 100644
--- a/packages/template-recorder/remotion/chapters/landscape/ChapterTitle.tsx
+++ b/packages/template-recorder/remotion/chapters/landscape/ChapterTitle.tsx
@@ -1,7 +1,7 @@
-import React, { useMemo } from "react";
-import { TITLE_FONT } from "../../../config/fonts";
-import { COLORS, Theme } from "../../../config/themes";
-import { ChapterType } from "../make-chapters";
+import React, { useMemo } from 'react';
+import { TITLE_FONT } from '../../../config/fonts';
+import { COLORS, Theme } from '../../../config/themes';
+import { ChapterType } from '../make-chapters';
export const ChapterTitle: React.FC<{
rightAligned: boolean;
@@ -13,13 +13,13 @@ export const ChapterTitle: React.FC<{
const textStyle: React.CSSProperties = useMemo(() => {
return {
- padding: "0px 20px",
+ padding: '0px 20px',
fontSize: 36,
...TITLE_FONT,
- height: "100%",
- display: "flex",
- justifyContent: "center",
- alignItems: "center",
+ height: '100%',
+ display: 'flex',
+ justifyContent: 'center',
+ alignItems: 'center',
right: rightAligned ? undefined : 0,
left: rightAligned ? 0 : undefined,
};
@@ -29,9 +29,9 @@ export const ChapterTitle: React.FC<{
<div
style={{
...textStyle,
- backgroundColor: isCurrent ? COLORS[theme].ACCENT_COLOR : "white",
- padding: "0px 20px",
- color: isCurrent ? "white" : "black",
+ backgroundColor: isCurrent ? COLORS[theme].ACCENT_COLOR : 'white',
+ padding: '0px 20px',
+ color: isCurrent ? 'white' : 'black',
}}
>
{chapter.title}
diff --git a/packages/template-recorder/remotion/chapters/landscape/LandscapeChapter.tsx b/packages/template-recorder/remotion/chapters/landscape/LandscapeChapter.tsx
index 7122f18f4d..90e4a2b958 100644
--- a/packages/template-recorder/remotion/chapters/landscape/LandscapeChapter.tsx
+++ b/packages/template-recorder/remotion/chapters/landscape/LandscapeChapter.tsx
@@ -1,8 +1,8 @@
-import React, { useMemo } from "react";
-import { type Theme } from "../../../config/themes";
-import type { ChapterType } from "../make-chapters";
-import { ChapterTimestamp } from "./ChapterTimestamp";
-import { ChapterTitle } from "./ChapterTitle";
+import React, { useMemo } from 'react';
+import { type Theme } from '../../../config/themes';
+import type { ChapterType } from '../make-chapters';
+import { ChapterTimestamp } from './ChapterTimestamp';
+import { ChapterTitle } from './ChapterTitle';
export const CHAPTER_HEIGHT = 80;
export const CHAPTER_VERTICAL_MARGIN = 4;
@@ -26,16 +26,16 @@ export const LandscapeChapter: React.FC<{
}) => {
const style: React.CSSProperties = useMemo(() => {
return {
- display: "inline-flex",
+ display: 'inline-flex',
borderRadius: 20,
- border: "5px solid black",
+ border: '5px solid black',
marginTop: isFirstShown ? 0 : CHAPTER_VERTICAL_MARGIN,
marginBottom: isLastShown ? 0 : CHAPTER_VERTICAL_MARGIN,
- overflow: "hidden",
+ overflow: 'hidden',
height: CHAPTER_HEIGHT,
- justifyContent: "center",
- alignItems: "center",
- flexDirection: rightAligned ? "row-reverse" : "row",
+ justifyContent: 'center',
+ alignItems: 'center',
+ flexDirection: rightAligned ? 'row-reverse' : 'row',
};
}, [isFirstShown, isLastShown, rightAligned]);
diff --git a/packages/template-recorder/remotion/chapters/landscape/LandscapeChapters.tsx b/packages/template-recorder/remotion/chapters/landscape/LandscapeChapters.tsx
index c9d256a103..6e7abe892b 100644
--- a/packages/template-recorder/remotion/chapters/landscape/LandscapeChapters.tsx
+++ b/packages/template-recorder/remotion/chapters/landscape/LandscapeChapters.tsx
@@ -1,23 +1,23 @@
-import React, { useMemo } from "react";
+import React, { useMemo } from 'react';
import {
AbsoluteFill,
interpolate,
spring,
useCurrentFrame,
useVideoConfig,
-} from "remotion";
-import type { VideoSceneAndMetadata } from "../../../config/scenes";
-import { isWebCamRight } from "../../animations/webcam-transitions/helpers";
+} from 'remotion';
+import type { VideoSceneAndMetadata } from '../../../config/scenes';
+import { isWebCamRight } from '../../animations/webcam-transitions/helpers';
-import { Theme } from "../../../config/themes";
-import { SCENE_TRANSITION_DURATION } from "../../../config/transitions";
-import type { ChapterType } from "../make-chapters";
+import { Theme } from '../../../config/themes';
+import { SCENE_TRANSITION_DURATION } from '../../../config/transitions';
+import type { ChapterType } from '../make-chapters';
import {
CHAPTER_HEIGHT,
CHAPTER_VERTICAL_MARGIN,
LandscapeChapter,
-} from "./LandscapeChapter";
-import { getWidescreenChapterStyle } from "./layout";
+} from './LandscapeChapter';
+import { getWidescreenChapterStyle } from './layout';
export const LandscapeChapters: React.FC<{
scene: VideoSceneAndMetadata;
@@ -45,7 +45,7 @@ export const LandscapeChapters: React.FC<{
CHAPTER_VERTICAL_MARGIN * 2;
const rightAligned = isWebCamRight(
- scene.webcamPosition === "center" ? "top-left" : scene.webcamPosition,
+ scene.webcamPosition === 'center' ? 'top-left' : scene.webcamPosition,
);
const delay = didTransitionIn ? SCENE_TRANSITION_DURATION : 0;
@@ -82,7 +82,7 @@ export const LandscapeChapters: React.FC<{
>
<AbsoluteFill
style={{
- flexDirection: "column",
+ flexDirection: 'column',
height: tableOfContentHeight,
flex: 1,
...styles,
diff --git a/packages/template-recorder/remotion/chapters/landscape/layout.ts b/packages/template-recorder/remotion/chapters/landscape/layout.ts
index 1944104a56..527fbca25d 100644
--- a/packages/template-recorder/remotion/chapters/landscape/layout.ts
+++ b/packages/template-recorder/remotion/chapters/landscape/layout.ts
@@ -1,12 +1,12 @@
-import React from "react";
-import { getSafeSpace } from "../../../config/layout";
-import type { VideoSceneAndMetadata } from "../../../config/scenes";
-import {} from "../../animations/webcam-transitions";
+import React from 'react';
+import { getSafeSpace } from '../../../config/layout';
+import type { VideoSceneAndMetadata } from '../../../config/scenes';
+import {} from '../../animations/webcam-transitions';
import {
isWebCamAtBottom,
isWebCamRight,
-} from "../../animations/webcam-transitions/helpers";
-import type { Layout } from "../../layout/layout-types";
+} from '../../animations/webcam-transitions/helpers';
+import type { Layout } from '../../layout/layout-types';
const getWidescreenChapterLayout = (
scene: VideoSceneAndMetadata,
@@ -14,13 +14,13 @@ const getWidescreenChapterLayout = (
): React.CSSProperties => {
const { layout, webcamPosition } = scene;
- if (webcamPosition === "center") {
+ if (webcamPosition === 'center') {
return {
height: 1000,
borderRadius: 0,
opacity: 1,
- left: getSafeSpace("landscape"),
- bottom: getSafeSpace("landscape"),
+ left: getSafeSpace('landscape'),
+ bottom: getSafeSpace('landscape'),
width: 10000,
top: undefined,
};
@@ -44,12 +44,12 @@ const getWidescreenChapterLayout = (
top:
layout.webcamLayout.top -
tableOfContentHeight -
- getSafeSpace("landscape"),
+ getSafeSpace('landscape'),
bottom: undefined,
}
: {
top:
- getSafeSpace("landscape") +
+ getSafeSpace('landscape') +
layout.webcamLayout.top +
layout.webcamLayout.height,
bottom: undefined,
@@ -66,15 +66,15 @@ export const getWidescreenChapterStyle = (
const chapterLayout = getWidescreenChapterLayout(scene, tableOfContentHeight);
const rightAligned = isWebCamRight(
- scene.webcamPosition === "center" ? "bottom-left" : scene.webcamPosition,
+ scene.webcamPosition === 'center' ? 'bottom-left' : scene.webcamPosition,
);
return {
...chapterLayout,
...(rightAligned
? {
- alignSelf: "flex-end",
- alignItems: "flex-end",
+ alignSelf: 'flex-end',
+ alignItems: 'flex-end',
}
: {}),
};
diff --git a/packages/template-recorder/remotion/chapters/make-chapters.ts b/packages/template-recorder/remotion/chapters/make-chapters.ts
index f317e60b49..0e69c2ac9c 100644
--- a/packages/template-recorder/remotion/chapters/make-chapters.ts
+++ b/packages/template-recorder/remotion/chapters/make-chapters.ts
@@ -1,4 +1,4 @@
-import type { SceneAndMetadata } from "../../config/scenes";
+import type { SceneAndMetadata } from '../../config/scenes';
export type ChapterType = {
title: string;
@@ -12,7 +12,7 @@ export const makeChapters = ({ scenes }: { scenes: SceneAndMetadata[] }) => {
for (let i = 0; i < scenes.length; i++) {
const scene = scenes[i] as SceneAndMetadata;
- if (scene.type === "video-scene" && scene.scene.newChapter) {
+ if (scene.type === 'video-scene' && scene.scene.newChapter) {
const chapter: ChapterType = {
title: scene.scene.newChapter,
start: scene.from,
@@ -22,7 +22,7 @@ export const makeChapters = ({ scenes }: { scenes: SceneAndMetadata[] }) => {
chapters.push(chapter);
}
- if (scene.type === "video-scene" && scene.scene.stopChapteringAfterThis) {
+ if (scene.type === 'video-scene' && scene.scene.stopChapteringAfterThis) {
break;
}
}
diff --git a/packages/template-recorder/remotion/chapters/square/SquareChapter.tsx b/packages/template-recorder/remotion/chapters/square/SquareChapter.tsx
index f7fd87d3b1..a532cce8f9 100644
--- a/packages/template-recorder/remotion/chapters/square/SquareChapter.tsx
+++ b/packages/template-recorder/remotion/chapters/square/SquareChapter.tsx
@@ -1,15 +1,15 @@
-import React, { useMemo } from "react";
+import React, { useMemo } from 'react';
import {
AbsoluteFill,
spring,
useCurrentFrame,
useVideoConfig,
-} from "remotion";
-import { TITLE_FONT } from "../../../config/fonts";
-import { getSafeSpace } from "../../../config/layout";
-import { SCENE_TRANSITION_DURATION } from "../../../config/transitions";
-import { borderRadius } from "../../layout/get-layout";
-import type { Layout } from "../../layout/layout-types";
+} from 'remotion';
+import { TITLE_FONT } from '../../../config/fonts';
+import { getSafeSpace } from '../../../config/layout';
+import { SCENE_TRANSITION_DURATION } from '../../../config/transitions';
+import { borderRadius } from '../../layout/get-layout';
+import type { Layout } from '../../layout/layout-types';
const HEIGHT = 78;
@@ -36,7 +36,7 @@ export const SquareChapter: React.FC<{
}, [displayLayout, webcamLayout]);
const top = useMemo(() => {
- return layout.height - HEIGHT - getSafeSpace("square");
+ return layout.height - HEIGHT - getSafeSpace('square');
}, [layout.height]);
const frame = useCurrentFrame();
@@ -59,11 +59,11 @@ export const SquareChapter: React.FC<{
},
delay: 70,
});
- const toTop = (1 - enter) * (HEIGHT + getSafeSpace("square"));
+ const toTop = (1 - enter) * (HEIGHT + getSafeSpace('square'));
const toLeft = exit * -width;
return (
- <AbsoluteFill style={{ pointerEvents: "none" }}>
+ <AbsoluteFill style={{ pointerEvents: 'none' }}>
<div
style={{
...layout,
@@ -73,31 +73,31 @@ export const SquareChapter: React.FC<{
(gradientOpacities[i] as number) * globalGradientOpacity
}%`;
})
- .join(", ")}, hsl(0, 0%, 100%) 100%)`,
- position: "absolute",
+ .join(', ')}, hsl(0, 0%, 100%) 100%)`,
+ position: 'absolute',
opacity: (enter - exit) * 0.2,
}}
/>
- <div style={{ ...layout, position: "absolute", overflow: "hidden" }}>
+ <div style={{ ...layout, position: 'absolute', overflow: 'hidden' }}>
<div
style={{
- color: "white",
- padding: "0 30px",
- background: "black",
- position: "absolute",
+ color: 'white',
+ padding: '0 30px',
+ background: 'black',
+ position: 'absolute',
top: top + toTop,
height: HEIGHT,
- left: getSafeSpace("square"),
+ left: getSafeSpace('square'),
borderRadius,
fontSize: 40,
...TITLE_FONT,
- display: "flex",
- alignItems: "center",
+ display: 'flex',
+ alignItems: 'center',
transform: `translateX(${toLeft}px)`,
}}
>
{title}
- </div>{" "}
+ </div>{' '}
</div>
</AbsoluteFill>
);
diff --git a/packages/template-recorder/remotion/helpers/WaitForFonts.tsx b/packages/template-recorder/remotion/helpers/WaitForFonts.tsx
index 2642a437c5..8eed516e51 100644
--- a/packages/template-recorder/remotion/helpers/WaitForFonts.tsx
+++ b/packages/template-recorder/remotion/helpers/WaitForFonts.tsx
@@ -1,6 +1,6 @@
-import React, { useEffect, useState } from "react";
-import { cancelRender, continueRender, delayRender } from "remotion";
-import { waitForFonts } from "../../config/fonts";
+import React, { useEffect, useState } from 'react';
+import { cancelRender, continueRender, delayRender } from 'remotion';
+import { waitForFonts } from '../../config/fonts';
// Missing fonts can influence the layout calculation
// and cause the subtitles to be misaligned.
@@ -11,11 +11,11 @@ export const WaitForFonts: React.FC<{
}> = ({ children }) => {
const [fontsLoaded, setFontsLoaded] = useState(false);
const [handle] = useState(() =>
- delayRender("Waiting for fonts to be loaded"),
+ delayRender('Waiting for fonts to be loaded'),
);
useEffect(() => {
- const delay = delayRender("Waiting for fonts to be loaded");
+ const delay = delayRender('Waiting for fonts to be loaded');
waitForFonts()
.then(() => {
diff --git a/packages/template-recorder/remotion/helpers/refresh-on-public-folder-change.ts b/packages/template-recorder/remotion/helpers/refresh-on-public-folder-change.ts
index d363b75352..b1f9bd7af6 100644
--- a/packages/template-recorder/remotion/helpers/refresh-on-public-folder-change.ts
+++ b/packages/template-recorder/remotion/helpers/refresh-on-public-folder-change.ts
@@ -2,15 +2,15 @@ import {
getStaticFiles,
reevaluateComposition,
watchPublicFolder,
-} from "@remotion/studio";
-import { useEffect, useState } from "react";
-import { StaticFile } from "remotion";
+} from '@remotion/studio';
+import { useEffect, useState } from 'react';
+import { StaticFile } from 'remotion';
import {
ALTERNATIVE1_PREFIX,
ALTERNATIVE2_PREFIX,
DISPLAY_PREFIX,
WEBCAM_PREFIX,
-} from "../../config/cameras";
+} from '../../config/cameras';
const filterForCurrentComposition = (
files: StaticFile[],
diff --git a/packages/template-recorder/remotion/helpers/scroll-to-current-scene.ts b/packages/template-recorder/remotion/helpers/scroll-to-current-scene.ts
index cb10ca1115..5a2a383fca 100644
--- a/packages/template-recorder/remotion/helpers/scroll-to-current-scene.ts
+++ b/packages/template-recorder/remotion/helpers/scroll-to-current-scene.ts
@@ -1,8 +1,8 @@
// In the props editor, scroll to the current scene
-import { focusDefaultPropsPath } from "@remotion/studio";
-import { useEffect } from "react";
-import { useCurrentFrame } from "remotion";
+import { focusDefaultPropsPath } from '@remotion/studio';
+import { useEffect } from 'react';
+import { useCurrentFrame } from 'remotion';
export const useScrollToCurrentScene = ({
index,
@@ -25,8 +25,8 @@ export const useScrollToCurrentScene = ({
// Reveal the current scene in the props editor
focusDefaultPropsPath({
- path: ["scenes", index],
- scrollBehavior: "smooth",
+ path: ['scenes', index],
+ scrollBehavior: 'smooth',
});
}, [fullyEntered, index, isPremountingAndOrFirstFrame]);
};
diff --git a/packages/template-recorder/remotion/helpers/truthy.ts b/packages/template-recorder/remotion/helpers/truthy.ts
index d0b895751d..c4ed64913e 100644
--- a/packages/template-recorder/remotion/helpers/truthy.ts
+++ b/packages/template-recorder/remotion/helpers/truthy.ts
@@ -1,4 +1,4 @@
-type Truthy<T> = T extends false | "" | 0 | null | undefined ? never : T;
+type Truthy<T> = T extends false | '' | 0 | null | undefined ? never : T;
export function truthy<T>(value: T): value is Truthy<T> {
return Boolean(value);
diff --git a/packages/template-recorder/remotion/index.ts b/packages/template-recorder/remotion/index.ts
index f31c790edb..91fa0f3468 100644
--- a/packages/template-recorder/remotion/index.ts
+++ b/packages/template-recorder/remotion/index.ts
@@ -1,4 +1,4 @@
-import { registerRoot } from "remotion";
-import { RemotionRoot } from "./Root";
+import { registerRoot } from 'remotion';
+import { RemotionRoot } from './Root';
registerRoot(RemotionRoot);
diff --git a/packages/template-recorder/remotion/layout/blur.ts b/packages/template-recorder/remotion/layout/blur.ts
index 072af04055..8b8e732306 100644
--- a/packages/template-recorder/remotion/layout/blur.ts
+++ b/packages/template-recorder/remotion/layout/blur.ts
@@ -1,12 +1,12 @@
-import type React from "react";
+import type React from 'react';
import {
DIMENSIONS,
type CanvasLayout,
type Dimensions,
-} from "../../config/layout";
-import type { SceneAndMetadata } from "../../config/scenes";
-import { fitElementSizeInContainer } from "./fit-element";
-import type { Layout } from "./layout-types";
+} from '../../config/layout';
+import type { SceneAndMetadata } from '../../config/scenes';
+import { fitElementSizeInContainer } from './fit-element';
+import type { Layout } from './layout-types';
// Background blur should only be enabled in landscape layout
// when the webcam is in fullscreen
@@ -14,7 +14,7 @@ export const shouldEnableSceneBackgroundBlur = (
scene: SceneAndMetadata,
canvasLayout: CanvasLayout,
) => {
- if (scene.type !== "video-scene") {
+ if (scene.type !== 'video-scene') {
return false;
}
@@ -22,7 +22,7 @@ export const shouldEnableSceneBackgroundBlur = (
return false;
}
- if (canvasLayout !== "landscape") {
+ if (canvasLayout !== 'landscape') {
return false;
}
@@ -49,11 +49,11 @@ export const getBlurLayout = ({
...containerLayout,
left: 0,
top: 0,
- overflow: "hidden",
+ overflow: 'hidden',
};
const innerStyle: React.CSSProperties = {
- position: "absolute",
+ position: 'absolute',
...containerLayout,
...inner,
};
@@ -67,13 +67,13 @@ export const getBlurLayout = ({
blurStyle: {
// Chrome has "blur bleed" where it does not blur the edges of the image.
// Fixing by making the image larger
- width: "110%",
- height: "110%",
- objectFit: "cover",
- filter: "blur(20px)",
- top: "-5%",
- left: "-5%",
- position: "absolute",
+ width: '110%',
+ height: '110%',
+ objectFit: 'cover',
+ filter: 'blur(20px)',
+ top: '-5%',
+ left: '-5%',
+ position: 'absolute',
} as React.CSSProperties,
};
};
diff --git a/packages/template-recorder/remotion/layout/dimensions.ts b/packages/template-recorder/remotion/layout/dimensions.ts
index 3021aa8340..7ae83af91c 100644
--- a/packages/template-recorder/remotion/layout/dimensions.ts
+++ b/packages/template-recorder/remotion/layout/dimensions.ts
@@ -1,5 +1,5 @@
-import type { CanvasLayout, Dimensions } from "../../config/layout";
-import { DIMENSIONS } from "../../config/layout";
+import type { CanvasLayout, Dimensions } from '../../config/layout';
+import { DIMENSIONS } from '../../config/layout';
export const getDimensionsForLayout = (
canvasLayout: CanvasLayout,
diff --git a/packages/template-recorder/remotion/layout/fit-element.ts b/packages/template-recorder/remotion/layout/fit-element.ts
index af6287e3c0..136ebc7fba 100644
--- a/packages/template-recorder/remotion/layout/fit-element.ts
+++ b/packages/template-recorder/remotion/layout/fit-element.ts
@@ -1,5 +1,5 @@
-import type { Dimensions } from "@remotion/layout-utils";
-import type { Rect } from "./layout-types";
+import type { Dimensions } from '@remotion/layout-utils';
+import type { Rect } from './layout-types';
// Resize an aspect ratio to fit into a container
// and center it
diff --git a/packages/template-recorder/remotion/layout/get-broll-dimensions.ts b/packages/template-recorder/remotion/layout/get-broll-dimensions.ts
index 3bdd6521e5..7d056af504 100644
--- a/packages/template-recorder/remotion/layout/get-broll-dimensions.ts
+++ b/packages/template-recorder/remotion/layout/get-broll-dimensions.ts
@@ -1,19 +1,19 @@
-import { parseMedia } from "@remotion/media-parser";
-import { getImageDimensions } from "@remotion/media-utils";
-import type { BRoll, BRollWithDimensions } from "../../config/scenes";
+import { parseMedia } from '@remotion/media-parser';
+import { getImageDimensions } from '@remotion/media-utils';
+import type { BRoll, BRollWithDimensions } from '../../config/scenes';
const imageFileExtensions = [
- "jpg",
- "jpeg",
- "png",
- "gif",
- "webp",
- "bmp",
- "svg",
- "ico",
+ 'jpg',
+ 'jpeg',
+ 'png',
+ 'gif',
+ 'webp',
+ 'bmp',
+ 'svg',
+ 'ico',
];
-const videoFileExtensions = ["mp4", "webm", "mov", "mkv"];
+const videoFileExtensions = ['mp4', 'webm', 'mov', 'mkv'];
export const getBRollDimensions = async (
bRoll: BRoll,
@@ -24,7 +24,7 @@ export const getBRollDimensions = async (
const { width, height } = await getImageDimensions(bRoll.source);
return {
...bRoll,
- type: "image",
+ type: 'image',
assetWidth: width,
assetHeight: height,
};
@@ -36,21 +36,21 @@ export const getBRollDimensions = async (
const metadata = await parseMedia({
src: bRoll.source,
fields: { dimensions: true },
- acknowledgeRemotionLicense: true
+ acknowledgeRemotionLicense: true,
});
if (!metadata.dimensions) {
- throw new Error("No dimensions found for bRoll: " + bRoll.source);
+ throw new Error('No dimensions found for bRoll: ' + bRoll.source);
}
return {
...bRoll,
- type: "video",
+ type: 'video',
assetWidth: metadata.dimensions.width,
assetHeight: metadata.dimensions.height,
};
}
throw new Error(
- `Unsupported file extension for bRoll: ${bRoll.source}. Only ${[...imageFileExtensions, ...videoFileExtensions].join(", ")} are supported.`,
+ `Unsupported file extension for bRoll: ${bRoll.source}. Only ${[...imageFileExtensions, ...videoFileExtensions].join(', ')} are supported.`,
);
};
diff --git a/packages/template-recorder/remotion/layout/get-captions-layout.ts b/packages/template-recorder/remotion/layout/get-captions-layout.ts
index 136427834a..82f92d11e7 100644
--- a/packages/template-recorder/remotion/layout/get-captions-layout.ts
+++ b/packages/template-recorder/remotion/layout/get-captions-layout.ts
@@ -1,13 +1,13 @@
-import type { CanvasLayout, Dimensions } from "../../config/layout";
-import { getSafeSpace } from "../../config/layout";
-import type { WebcamPosition } from "../../config/scenes";
-import {} from "../animations/webcam-transitions";
+import type { CanvasLayout, Dimensions } from '../../config/layout';
+import { getSafeSpace } from '../../config/layout';
+import type { WebcamPosition } from '../../config/scenes';
+import {} from '../animations/webcam-transitions';
import {
isWebCamAtBottom,
isWebCamRight,
-} from "../animations/webcam-transitions/helpers";
-import { borderRadius } from "./get-layout";
-import type { Layout } from "./layout-types";
+} from '../animations/webcam-transitions/helpers';
+import { borderRadius } from './get-layout';
+import type { Layout } from './layout-types';
export const getCaptionsLayout = ({
canvasLayout,
@@ -22,7 +22,7 @@ export const getCaptionsLayout = ({
webcamPosition: WebcamPosition;
displayLayout: Dimensions | null;
}): Layout | null => {
- if (canvasLayout !== "square") {
+ if (canvasLayout !== 'square') {
return null;
}
if (displayLayout === null) {
diff --git a/packages/template-recorder/remotion/layout/get-display-layout.ts b/packages/template-recorder/remotion/layout/get-display-layout.ts
index fc3a01548b..b290bdc216 100644
--- a/packages/template-recorder/remotion/layout/get-display-layout.ts
+++ b/packages/template-recorder/remotion/layout/get-display-layout.ts
@@ -1,16 +1,16 @@
-import type { CanvasLayout } from "../../config/layout";
-import { getSafeSpace, type Dimensions } from "../../config/layout";
-import type { WebcamPosition } from "../../config/scenes";
+import type { CanvasLayout } from '../../config/layout';
+import { getSafeSpace, type Dimensions } from '../../config/layout';
+import type { WebcamPosition } from '../../config/scenes';
import {
isWebCamAtBottom,
isWebCamRight,
-} from "../animations/webcam-transitions/helpers";
-import { borderRadius, fullscreenLayout } from "./get-layout";
+} from '../animations/webcam-transitions/helpers';
+import { borderRadius, fullscreenLayout } from './get-layout';
import type {
BRollEnterDirection,
Layout,
RecordingsLayout,
-} from "./layout-types";
+} from './layout-types';
const getYForDisplayLayout = ({
webcamPosition,
@@ -22,10 +22,10 @@ const getYForDisplayLayout = ({
displayHeight: number;
}): number => {
if (isWebCamAtBottom(webcamPosition)) {
- return getSafeSpace("square");
+ return getSafeSpace('square');
}
- return canvasSize.height - displayHeight - getSafeSpace("square");
+ return canvasSize.height - displayHeight - getSafeSpace('square');
};
export const getSquareDisplayLayout = ({
@@ -61,15 +61,15 @@ export const getSquareBRollLayout = ({
displaySize: Dimensions;
}): { bRollLayout: Layout; bRollEnterDirection: BRollEnterDirection } => {
return {
- bRollEnterDirection: isWebCamAtBottom(webcamPosition) ? "top" : "bottom",
+ bRollEnterDirection: isWebCamAtBottom(webcamPosition) ? 'top' : 'bottom',
bRollLayout: {
- left: getSafeSpace("square"),
+ left: getSafeSpace('square'),
top: getYForDisplayLayout({
webcamPosition,
canvasSize,
displayHeight: displaySize.height,
}),
- width: canvasSize.width - getSafeSpace("square") * 2,
+ width: canvasSize.width - getSafeSpace('square') * 2,
height: displaySize.height,
borderRadius,
opacity: 1,
@@ -97,16 +97,16 @@ export const getLandscapeDisplayAndWebcamLayout = ({
opacity: 1,
left: isWebCamRight(webcamPosition)
? canvasSize.width - webcamSize.width - getSafeSpace(canvasLayout)
- : getSafeSpace("landscape"),
+ : getSafeSpace('landscape'),
top: isWebCamAtBottom(webcamPosition)
? canvasSize.height - webcamSize.height - getSafeSpace(canvasLayout)
- : getSafeSpace("landscape"),
+ : getSafeSpace('landscape'),
};
return {
displayLayout,
webcamLayout,
bRollLayout: displayLayout,
- bRollEnterDirection: isWebCamAtBottom(webcamPosition) ? "top" : "bottom",
+ bRollEnterDirection: isWebCamAtBottom(webcamPosition) ? 'top' : 'bottom',
};
};
diff --git a/packages/template-recorder/remotion/layout/get-display-size.ts b/packages/template-recorder/remotion/layout/get-display-size.ts
index 6c2ec4e0e2..29473497b3 100644
--- a/packages/template-recorder/remotion/layout/get-display-size.ts
+++ b/packages/template-recorder/remotion/layout/get-display-size.ts
@@ -1,10 +1,10 @@
-import type { CanvasLayout, Dimensions } from "../../config/layout";
+import type { CanvasLayout, Dimensions } from '../../config/layout';
import {
getSafeSpace,
LANDSCAPE_DISPLAY_MAX_WIDTH_OF_CANVAS,
-} from "../../config/layout";
-import { fitElementSizeInContainer } from "./fit-element";
-import { getBottomSafeSpace } from "./get-safe-space";
+} from '../../config/layout';
+import { fitElementSizeInContainer } from './fit-element';
+import { getBottomSafeSpace } from './get-safe-space';
const getMaxHeight = ({
canvasSize,
@@ -18,7 +18,7 @@ const getMaxHeight = ({
const withoutSafeAreas =
canvasSize.height - bottomSafeSpace - getSafeSpace(canvasLayout);
- if (canvasLayout === "square") {
+ if (canvasLayout === 'square') {
const threeFifths = withoutSafeAreas * (3 / 5);
return threeFifths;
@@ -36,7 +36,7 @@ const getMaxWidth = ({
}) => {
const withoutSafeArea = canvasSize.width - getSafeSpace(canvasLayout) * 2;
const fourFifths = canvasSize.width * LANDSCAPE_DISPLAY_MAX_WIDTH_OF_CANVAS;
- if (canvasLayout === "landscape") {
+ if (canvasLayout === 'landscape') {
return fourFifths;
}
diff --git a/packages/template-recorder/remotion/layout/get-layout.ts b/packages/template-recorder/remotion/layout/get-layout.ts
index bde3490c7a..a68bc14933 100644
--- a/packages/template-recorder/remotion/layout/get-layout.ts
+++ b/packages/template-recorder/remotion/layout/get-layout.ts
@@ -1,22 +1,22 @@
-import type { CanvasLayout, Dimensions } from "../../config/layout";
-import { getSafeSpace } from "../../config/layout";
-import type { SceneVideos, WebcamPosition } from "../../config/scenes";
-import { isWebCamAtBottom } from "../animations/webcam-transitions/helpers";
-import { getDimensionsForLayout } from "./dimensions";
-import { getCaptionsLayout } from "./get-captions-layout";
+import type { CanvasLayout, Dimensions } from '../../config/layout';
+import { getSafeSpace } from '../../config/layout';
+import type { SceneVideos, WebcamPosition } from '../../config/scenes';
+import { isWebCamAtBottom } from '../animations/webcam-transitions/helpers';
+import { getDimensionsForLayout } from './dimensions';
+import { getCaptionsLayout } from './get-captions-layout';
import {
getLandscapeDisplayAndWebcamLayout,
getSquareBRollLayout,
getSquareDisplayLayout,
-} from "./get-display-layout";
-import { getDisplaySize } from "./get-display-size";
-import { getNonFullscreenWebcamSize } from "./get-webcam-size";
+} from './get-display-layout';
+import { getDisplaySize } from './get-display-size';
+import { getNonFullscreenWebcamSize } from './get-webcam-size';
import type {
BRollEnterDirection,
BRollType,
Layout,
RecordingsLayout,
-} from "./layout-types";
+} from './layout-types';
export const borderRadius = 20;
@@ -35,9 +35,9 @@ const squareFullscreenWebcamLayout = ({
} => {
const aspectRatio = webcamSize.width / webcamSize.height;
- const maxWidth = canvasSize.width - getSafeSpace("square") * 2;
+ const maxWidth = canvasSize.width - getSafeSpace('square') * 2;
// Video can take up 75% of the height to leave place for the subtitles
- const maxHeight = (canvasSize.height - getSafeSpace("square") * 2) * 0.75;
+ const maxHeight = (canvasSize.height - getSafeSpace('square') * 2) * 0.75;
const provisionalHeight = maxWidth / aspectRatio;
const width =
@@ -46,8 +46,8 @@ const squareFullscreenWebcamLayout = ({
const left = (canvasSize.width - width) / 2;
const top = isWebCamAtBottom(webcamPosition)
- ? canvasSize.height - height - getSafeSpace("square")
- : getSafeSpace("square");
+ ? canvasSize.height - height - getSafeSpace('square')
+ : getSafeSpace('square');
const webcamLayout: Layout = {
left,
@@ -59,9 +59,9 @@ const squareFullscreenWebcamLayout = ({
};
const bRollLayout: Layout = {
- left: getSafeSpace("square"),
+ left: getSafeSpace('square'),
top,
- width: canvasSize.width - getSafeSpace("square") * 2,
+ width: canvasSize.width - getSafeSpace('square') * 2,
height,
borderRadius,
opacity: 1,
@@ -70,7 +70,7 @@ const squareFullscreenWebcamLayout = ({
return {
webcamLayout,
bRollLayout,
- bRollEnterDirection: isWebCamAtBottom(webcamPosition) ? "bottom" : "top",
+ bRollEnterDirection: isWebCamAtBottom(webcamPosition) ? 'bottom' : 'top',
};
};
@@ -93,41 +93,41 @@ const getSquareBentoBoxWebcamLayout = ({
webcamPosition: WebcamPosition;
canvasSize: Dimensions;
}): Layout => {
- if (webcamPosition === "bottom-right") {
+ if (webcamPosition === 'bottom-right') {
return {
...webcamSize,
- left: canvasSize.width - webcamSize.width - getSafeSpace("square"),
- top: canvasSize.height - webcamSize.height - getSafeSpace("square"),
+ left: canvasSize.width - webcamSize.width - getSafeSpace('square'),
+ top: canvasSize.height - webcamSize.height - getSafeSpace('square'),
borderRadius,
opacity: 1,
};
}
- if (webcamPosition === "bottom-left") {
+ if (webcamPosition === 'bottom-left') {
return {
...webcamSize,
- left: getSafeSpace("square"),
- top: canvasSize.height - webcamSize.height - getSafeSpace("square"),
+ left: getSafeSpace('square'),
+ top: canvasSize.height - webcamSize.height - getSafeSpace('square'),
borderRadius,
opacity: 1,
};
}
- if (webcamPosition === "top-left") {
+ if (webcamPosition === 'top-left') {
return {
...webcamSize,
- left: getSafeSpace("square"),
- top: getSafeSpace("square"),
+ left: getSafeSpace('square'),
+ top: getSafeSpace('square'),
borderRadius,
opacity: 1,
};
}
- if (webcamPosition === "top-right") {
+ if (webcamPosition === 'top-right') {
return {
...webcamSize,
- left: canvasSize.width - webcamSize.width - getSafeSpace("square"),
- top: getSafeSpace("square"),
+ left: canvasSize.width - webcamSize.width - getSafeSpace('square'),
+ top: getSafeSpace('square'),
borderRadius,
opacity: 1,
};
@@ -186,7 +186,7 @@ const getDisplayAndWebcamLayout = ({
videos: SceneVideos;
}): RecordingsLayout => {
if (!videos.display) {
- if (canvasLayout === "square") {
+ if (canvasLayout === 'square') {
const fullscreenWebcamSize = getFullScreenWebcamSize({
canvasSize,
canvasLayout,
@@ -208,7 +208,7 @@ const getDisplayAndWebcamLayout = ({
};
}
- if (canvasLayout === "landscape") {
+ if (canvasLayout === 'landscape') {
const webcamLayout = fullscreenLayout(canvasSize);
const bRollLayout = fullscreenLayout(canvasSize);
@@ -216,7 +216,7 @@ const getDisplayAndWebcamLayout = ({
displayLayout: null,
bRollLayout,
webcamLayout,
- bRollEnterDirection: "top",
+ bRollEnterDirection: 'top',
};
}
@@ -236,7 +236,7 @@ const getDisplayAndWebcamLayout = ({
displaySize,
});
- if (canvasLayout === "square") {
+ if (canvasLayout === 'square') {
const displayLayout = getSquareDisplayLayout({
canvasSize,
webcamPosition,
@@ -263,7 +263,7 @@ const getDisplayAndWebcamLayout = ({
};
}
- if (canvasLayout === "landscape") {
+ if (canvasLayout === 'landscape') {
return getLandscapeDisplayAndWebcamLayout({
webcamSize,
canvasLayout,
@@ -303,7 +303,7 @@ export const getVideoSceneLayout = ({
});
const bRollType =
- canvasLayout === "landscape" && videos.display === null ? "fade" : "scale";
+ canvasLayout === 'landscape' && videos.display === null ? 'fade' : 'scale';
return {
displayLayout,
diff --git a/packages/template-recorder/remotion/layout/get-safe-space.ts b/packages/template-recorder/remotion/layout/get-safe-space.ts
index d5d97156eb..0116ff83f0 100644
--- a/packages/template-recorder/remotion/layout/get-safe-space.ts
+++ b/packages/template-recorder/remotion/layout/get-safe-space.ts
@@ -1,8 +1,8 @@
-import type { CanvasLayout } from "../../config/layout";
-import { getSafeSpace } from "../../config/layout";
+import type { CanvasLayout } from '../../config/layout';
+import { getSafeSpace } from '../../config/layout';
export const getBottomSafeSpace = (canvasLayout: CanvasLayout) => {
- if (canvasLayout === "landscape") {
+ if (canvasLayout === 'landscape') {
return 140;
}
diff --git a/packages/template-recorder/remotion/layout/get-webcam-size.ts b/packages/template-recorder/remotion/layout/get-webcam-size.ts
index 80e49e8f6a..7b5290ba8b 100644
--- a/packages/template-recorder/remotion/layout/get-webcam-size.ts
+++ b/packages/template-recorder/remotion/layout/get-webcam-size.ts
@@ -1,5 +1,5 @@
-import type { CanvasLayout, Dimensions } from "../../config/layout";
-import { getSafeSpace } from "../../config/layout";
+import type { CanvasLayout, Dimensions } from '../../config/layout';
+import { getSafeSpace } from '../../config/layout';
// TODO: Use this also in the recording interface
const webcamRatio = 400 / 350;
@@ -13,7 +13,7 @@ export const getNonFullscreenWebcamSize = ({
canvasSize: Dimensions;
canvasLayout: CanvasLayout;
}): Dimensions => {
- if (canvasLayout === "square") {
+ if (canvasLayout === 'square') {
const remainingHeight =
canvasSize.height - displaySize.height - getSafeSpace(canvasLayout) * 3;
@@ -23,7 +23,7 @@ export const getNonFullscreenWebcamSize = ({
};
}
- if (canvasLayout === "landscape") {
+ if (canvasLayout === 'landscape') {
const remainingWidth =
canvasSize.width - displaySize.width - getSafeSpace(canvasLayout) * 3;
const maxWidth = 350;
diff --git a/packages/template-recorder/remotion/layout/layout-types.ts b/packages/template-recorder/remotion/layout/layout-types.ts
index 127bdf3110..59ae2001a7 100644
--- a/packages/template-recorder/remotion/layout/layout-types.ts
+++ b/packages/template-recorder/remotion/layout/layout-types.ts
@@ -22,5 +22,5 @@ export type RecordingsLayout = {
bRollEnterDirection: BRollEnterDirection;
};
-export type BRollEnterDirection = "top" | "bottom";
-export type BRollType = "scale" | "fade";
+export type BRollEnterDirection = 'top' | 'bottom';
+export type BRollType = 'scale' | 'fade';
diff --git a/packages/template-recorder/remotion/scenes/BRoll/BRoll.tsx b/packages/template-recorder/remotion/scenes/BRoll/BRoll.tsx
index 0ed66731c4..780c6adae1 100644
--- a/packages/template-recorder/remotion/scenes/BRoll/BRoll.tsx
+++ b/packages/template-recorder/remotion/scenes/BRoll/BRoll.tsx
@@ -1,11 +1,11 @@
-import React from "react";
-import { Sequence, spring, useCurrentFrame, useVideoConfig } from "remotion";
-import type { CanvasLayout } from "../../../config/layout";
-import type { BRollWithDimensions } from "../../../config/scenes";
-import { B_ROLL_TRANSITION_DURATION } from "../../../config/transitions";
-import type { BRollEnterDirection, Layout } from "../../layout/layout-types";
-import { Fade, FadeBRoll } from "./FadeBRoll";
-import { ScaleDownBRoll } from "./ScaleDownBRoll";
+import React from 'react';
+import { Sequence, spring, useCurrentFrame, useVideoConfig } from 'remotion';
+import type { CanvasLayout } from '../../../config/layout';
+import type { BRollWithDimensions } from '../../../config/scenes';
+import { B_ROLL_TRANSITION_DURATION } from '../../../config/transitions';
+import type { BRollEnterDirection, Layout } from '../../layout/layout-types';
+import { Fade, FadeBRoll } from './FadeBRoll';
+import { ScaleDownBRoll } from './ScaleDownBRoll';
const InnerBRoll: React.FC<{
bRoll: BRollWithDimensions;
@@ -25,7 +25,7 @@ const InnerBRoll: React.FC<{
const { fps } = useVideoConfig();
const frame = useCurrentFrame();
- const bRollType = canvasLayout === "landscape" ? "fade" : "scale";
+ const bRollType = canvasLayout === 'landscape' ? 'fade' : 'scale';
const appearProgress = spring({
fps,
@@ -46,7 +46,7 @@ const InnerBRoll: React.FC<{
durationInFrames: B_ROLL_TRANSITION_DURATION,
});
- if (bRollType === "fade") {
+ if (bRollType === 'fade') {
return (
<Fade
appearProgress={appearProgress}
diff --git a/packages/template-recorder/remotion/scenes/BRoll/BRollStack.tsx b/packages/template-recorder/remotion/scenes/BRoll/BRollStack.tsx
index 97672dca5e..8dae6d2972 100644
--- a/packages/template-recorder/remotion/scenes/BRoll/BRollStack.tsx
+++ b/packages/template-recorder/remotion/scenes/BRoll/BRollStack.tsx
@@ -1,9 +1,9 @@
-import React from "react";
-import { useCurrentFrame } from "remotion";
-import type { CanvasLayout } from "../../../config/layout";
-import type { BRollWithDimensions } from "../../../config/scenes";
-import type { BRollEnterDirection, Layout } from "../../layout/layout-types";
-import { BRoll } from "./BRoll";
+import React from 'react';
+import { useCurrentFrame } from 'remotion';
+import type { CanvasLayout } from '../../../config/layout';
+import type { BRollWithDimensions } from '../../../config/scenes';
+import type { BRollEnterDirection, Layout } from '../../layout/layout-types';
+import { BRoll } from './BRoll';
export const BRollStack: React.FC<{
bRollLayout: Layout;
diff --git a/packages/template-recorder/remotion/scenes/BRoll/FadeBRoll.tsx b/packages/template-recorder/remotion/scenes/BRoll/FadeBRoll.tsx
index 7666baadd8..ba7c8771ae 100644
--- a/packages/template-recorder/remotion/scenes/BRoll/FadeBRoll.tsx
+++ b/packages/template-recorder/remotion/scenes/BRoll/FadeBRoll.tsx
@@ -1,9 +1,9 @@
-import React, { useMemo } from "react";
-import { AbsoluteFill } from "remotion";
-import type { BRollWithDimensions } from "../../../config/scenes";
-import type { Layout } from "../../layout/layout-types";
-import { ImgWithBlur } from "../VideoScene/ImgWithBlur";
-import { VideoWithBlur } from "../VideoScene/VideoWithBlur";
+import React, { useMemo } from 'react';
+import { AbsoluteFill } from 'remotion';
+import type { BRollWithDimensions } from '../../../config/scenes';
+import type { Layout } from '../../layout/layout-types';
+import { ImgWithBlur } from '../VideoScene/ImgWithBlur';
+import { VideoWithBlur } from '../VideoScene/VideoWithBlur';
export const Fade: React.FC<{
appearProgress: number;
@@ -30,7 +30,7 @@ export const FadeBRoll: React.FC<{
};
}, [bRoll.assetHeight, bRoll.assetWidth]);
- if (bRoll.type === "image") {
+ if (bRoll.type === 'image') {
return (
<ImgWithBlur
src={bRoll.source}
@@ -40,7 +40,7 @@ export const FadeBRoll: React.FC<{
);
}
- if (bRoll.type === "video") {
+ if (bRoll.type === 'video') {
return (
<VideoWithBlur
src={bRoll.source}
diff --git a/packages/template-recorder/remotion/scenes/BRoll/ScaleDownBRoll.tsx b/packages/template-recorder/remotion/scenes/BRoll/ScaleDownBRoll.tsx
index 97aaea2eec..0c3dfb59ac 100644
--- a/packages/template-recorder/remotion/scenes/BRoll/ScaleDownBRoll.tsx
+++ b/packages/template-recorder/remotion/scenes/BRoll/ScaleDownBRoll.tsx
@@ -1,13 +1,13 @@
-import React, { useMemo } from "react";
-import { Img, interpolate, OffthreadVideo, useVideoConfig } from "remotion";
-import type { BRollWithDimensions } from "../../../config/scenes";
-import { fitElementSizeInContainer } from "../../layout/fit-element";
+import React, { useMemo } from 'react';
+import { Img, interpolate, OffthreadVideo, useVideoConfig } from 'remotion';
+import type { BRollWithDimensions } from '../../../config/scenes';
+import { fitElementSizeInContainer } from '../../layout/fit-element';
import type {
BRollEnterDirection,
Layout,
Rect,
-} from "../../layout/layout-types";
-import { ScaleDownIfBRollRequiresIt } from "./ScaleDownWithBRoll";
+} from '../../layout/layout-types';
+import { ScaleDownIfBRollRequiresIt } from './ScaleDownWithBRoll';
export const ScaleDownBRoll: React.FC<{
bRollEnterDirection: BRollEnterDirection;
@@ -31,16 +31,16 @@ export const ScaleDownBRoll: React.FC<{
const bRollContainer: Layout = useMemo(() => {
return {
...bRollLayout,
- display: "flex",
+ display: 'flex',
};
}, [bRollLayout]);
const enterPosition = useMemo(() => {
- if (bRollEnterDirection === "top") {
+ if (bRollEnterDirection === 'top') {
return -bRollLayout.height;
}
- if (bRollEnterDirection === "bottom") {
+ if (bRollEnterDirection === 'bottom') {
return canvasHeight;
}
@@ -51,16 +51,16 @@ export const ScaleDownBRoll: React.FC<{
appearProgress - disappearProgress,
[0, 1],
[enterPosition, bRollLayout.top],
- { extrapolateLeft: "clamp", extrapolateRight: "clamp" },
+ { extrapolateLeft: 'clamp', extrapolateRight: 'clamp' },
);
const outerStyle: React.CSSProperties = useMemo(() => {
return {
...bRollContainer,
- position: "absolute",
+ position: 'absolute',
top: topOffset,
- justifyContent: "center",
- alignItems: "center",
+ justifyContent: 'center',
+ alignItems: 'center',
};
}, [bRollContainer, topOffset]);
@@ -77,8 +77,8 @@ export const ScaleDownBRoll: React.FC<{
const style = useMemo(() => {
return {
borderRadius: bRollLayout.borderRadius,
- overflow: "hidden",
- boxShadow: "0 0 50px rgba(0, 0, 0, 0.2)",
+ overflow: 'hidden',
+ boxShadow: '0 0 50px rgba(0, 0, 0, 0.2)',
height: biggestLayout.height,
width: biggestLayout.width,
aspectRatio: bRoll.assetWidth / bRoll.assetHeight,
@@ -96,12 +96,12 @@ export const ScaleDownBRoll: React.FC<{
<ScaleDownIfBRollRequiresIt
frame={sceneFrame}
bRolls={bRollsBefore}
- bRollType={"scale"}
+ bRollType={'scale'}
>
- {bRoll.type === "image" ? (
+ {bRoll.type === 'image' ? (
<Img src={bRoll.source} style={style} />
) : null}
- {bRoll.type === "video" ? (
+ {bRoll.type === 'video' ? (
<OffthreadVideo src={bRoll.source} muted style={style} />
) : null}
</ScaleDownIfBRollRequiresIt>
diff --git a/packages/template-recorder/remotion/scenes/BRoll/ScaleDownWithBRoll.tsx b/packages/template-recorder/remotion/scenes/BRoll/ScaleDownWithBRoll.tsx
index bf4c82eebd..5cf17b9ae2 100644
--- a/packages/template-recorder/remotion/scenes/BRoll/ScaleDownWithBRoll.tsx
+++ b/packages/template-recorder/remotion/scenes/BRoll/ScaleDownWithBRoll.tsx
@@ -1,8 +1,8 @@
-import React, { useMemo } from "react";
-import { AbsoluteFill, spring, useVideoConfig } from "remotion";
-import type { BRoll } from "../../../config/scenes";
-import { B_ROLL_TRANSITION_DURATION } from "../../../config/transitions";
-import type { BRollType } from "../../layout/layout-types";
+import React, { useMemo } from 'react';
+import { AbsoluteFill, spring, useVideoConfig } from 'remotion';
+import type { BRoll } from '../../../config/scenes';
+import { B_ROLL_TRANSITION_DURATION } from '../../../config/transitions';
+import type { BRollType } from '../../layout/layout-types';
// A value of 0.1 means that the original
// video only has a 90% of its original size
@@ -49,8 +49,8 @@ const ScaleDownWithBRoll: React.FC<Props> = ({ bRolls, frame, children }) => {
const style: React.CSSProperties = useMemo(() => {
return {
scale: String(scale),
- justifyContent: "center",
- alignItems: "center",
+ justifyContent: 'center',
+ alignItems: 'center',
};
}, [scale]);
@@ -62,7 +62,7 @@ export const ScaleDownIfBRollRequiresIt: React.FC<
bRollType: BRollType;
}
> = ({ bRollType, bRolls, frame, children }) => {
- if (bRollType !== "scale") {
+ if (bRollType !== 'scale') {
return <>{children}</>;
}
diff --git a/packages/template-recorder/remotion/scenes/BRoll/apply-b-roll-rules.ts b/packages/template-recorder/remotion/scenes/BRoll/apply-b-roll-rules.ts
index 5b160c4c44..7bcefe7387 100644
--- a/packages/template-recorder/remotion/scenes/BRoll/apply-b-roll-rules.ts
+++ b/packages/template-recorder/remotion/scenes/BRoll/apply-b-roll-rules.ts
@@ -1,5 +1,5 @@
-import type { BRollWithDimensions } from "../../../config/scenes";
-import { SCENE_TRANSITION_DURATION } from "../../../config/transitions";
+import type { BRollWithDimensions } from '../../../config/scenes';
+import { SCENE_TRANSITION_DURATION } from '../../../config/transitions';
const ensureNoBRollOverlaps = (
bRollsEnsureSceneEnds: BRollWithDimensions[],
diff --git a/packages/template-recorder/remotion/scenes/EndCard/FollowButton.tsx b/packages/template-recorder/remotion/scenes/EndCard/FollowButton.tsx
index cbe465da5b..ac6b1c2aa4 100644
--- a/packages/template-recorder/remotion/scenes/EndCard/FollowButton.tsx
+++ b/packages/template-recorder/remotion/scenes/EndCard/FollowButton.tsx
@@ -1,7 +1,7 @@
-import type { Platform } from "../../../config/endcard";
-import { ENDCARD_FONT } from "../../../config/fonts";
-import type { Theme } from "../../../config/themes";
-import { COLORS } from "../../../config/themes";
+import type { Platform } from '../../../config/endcard';
+import { ENDCARD_FONT } from '../../../config/fonts';
+import type { Theme } from '../../../config/themes';
+import { COLORS } from '../../../config/themes';
export const followButtonHeight = 140;
@@ -18,20 +18,20 @@ export const FollowButton: React.FC<{
width: 400,
backgroundColor: COLORS[theme].CTA_BUTTON_BACKGROUND_COLOR,
color: COLORS[theme].CTA_BUTTON_COLOR,
- display: "flex",
- justifyContent: "center",
- alignItems: "center",
+ display: 'flex',
+ justifyContent: 'center',
+ alignItems: 'center',
fontSize: 50,
...ENDCARD_FONT,
}}
>
- {platform === "youtube"
- ? "Subscribe"
- : platform === "linkedin"
+ {platform === 'youtube'
+ ? 'Subscribe'
+ : platform === 'linkedin'
? isLinkedInBusinessPage
- ? "Follow"
- : "Connect"
- : "Follow"}
+ ? 'Follow'
+ : 'Connect'
+ : 'Follow'}
</div>
);
};
diff --git a/packages/template-recorder/remotion/scenes/EndCard/IconRow.tsx b/packages/template-recorder/remotion/scenes/EndCard/IconRow.tsx
index 581f1b8bbd..95a24b5d0a 100644
--- a/packages/template-recorder/remotion/scenes/EndCard/IconRow.tsx
+++ b/packages/template-recorder/remotion/scenes/EndCard/IconRow.tsx
@@ -1,9 +1,9 @@
-import { useMemo } from "react";
-import type { Platform } from "../../../config/endcard";
-import { ENDCARD_FONT } from "../../../config/fonts";
-import type { Theme } from "../../../config/themes";
-import { COLORS } from "../../../config/themes";
-import { followButtonHeight } from "./FollowButton";
+import { useMemo } from 'react';
+import type { Platform } from '../../../config/endcard';
+import { ENDCARD_FONT } from '../../../config/fonts';
+import type { Theme } from '../../../config/themes';
+import { COLORS } from '../../../config/themes';
+import { followButtonHeight } from './FollowButton';
import {
GitHubIcon,
InstagramIcon,
@@ -11,20 +11,20 @@ import {
LinkedInIcon,
XIcon,
YouTubeIcon,
-} from "./icons";
+} from './icons';
const iconContainer: React.CSSProperties = {
- display: "flex",
- alignItems: "center",
- justifyContent: "center",
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
height: 60,
width: followButtonHeight,
};
const iconRow: React.CSSProperties = {
- display: "flex",
- flexDirection: "row",
- alignItems: "center",
+ display: 'flex',
+ flexDirection: 'row',
+ alignItems: 'center',
paddingTop: 20,
paddingBottom: 20,
};
@@ -32,7 +32,7 @@ const iconRow: React.CSSProperties = {
export const spaceBetweenImgAndText = 30;
export const IconRow: React.FC<{
- type: Platform | "link";
+ type: Platform | 'link';
label: string;
opacity: number;
theme: Theme;
@@ -48,16 +48,16 @@ export const IconRow: React.FC<{
);
const finalLabel = useMemo(() => {
- if (label.startsWith("https://github.com/")) {
- return label.substring("https://github.com/".length);
+ if (label.startsWith('https://github.com/')) {
+ return label.substring('https://github.com/'.length);
}
return label;
}, [label]);
const finalType = useMemo(() => {
- if (label.startsWith("https://github.com/")) {
- return "github";
+ if (label.startsWith('https://github.com/')) {
+ return 'github';
}
return type;
@@ -66,18 +66,18 @@ export const IconRow: React.FC<{
return (
<div style={{ ...iconRow, opacity }}>
<div style={iconContainer}>
- {finalType === "github" ? (
+ {finalType === 'github' ? (
<GitHubIcon theme={theme} height={60} />
) : null}
- {finalType === "link" ? <LinkIcon theme={theme} height={60} /> : null}
- {finalType === "youtube" ? (
+ {finalType === 'link' ? <LinkIcon theme={theme} height={60} /> : null}
+ {finalType === 'youtube' ? (
<YouTubeIcon theme={theme} height={60} />
) : null}
- {finalType === "x" ? <XIcon theme={theme} height={60} /> : null}
- {finalType === "instagram" ? (
+ {finalType === 'x' ? <XIcon theme={theme} height={60} /> : null}
+ {finalType === 'instagram' ? (
<InstagramIcon theme={theme} height={70} />
) : null}
- {finalType === "linkedin" ? (
+ {finalType === 'linkedin' ? (
<LinkedInIcon theme={theme} height={60} />
) : null}
</div>
diff --git a/packages/template-recorder/remotion/scenes/EndCard/LeftSide.tsx b/packages/template-recorder/remotion/scenes/EndCard/LeftSide.tsx
index e690070c25..2d561067a1 100644
--- a/packages/template-recorder/remotion/scenes/EndCard/LeftSide.tsx
+++ b/packages/template-recorder/remotion/scenes/EndCard/LeftSide.tsx
@@ -1,4 +1,4 @@
-import React, { useEffect, useMemo, useRef, useState } from "react";
+import React, { useEffect, useMemo, useRef, useState } from 'react';
import {
AbsoluteFill,
Img,
@@ -9,14 +9,14 @@ import {
useCurrentFrame,
useCurrentScale,
useVideoConfig,
-} from "remotion";
-import type { Brand, LinkType, Platform } from "../../../config/endcard";
-import { avatars, channels } from "../../../config/endcard";
-import type { Theme } from "../../../config/themes";
-import { SCENE_TRANSITION_DURATION } from "../../../config/transitions";
-import { FollowButton, followButtonHeight } from "./FollowButton";
-import { IconRow, spaceBetweenImgAndText } from "./IconRow";
-import { Links } from "./Links";
+} from 'remotion';
+import type { Brand, LinkType, Platform } from '../../../config/endcard';
+import { avatars, channels } from '../../../config/endcard';
+import type { Theme } from '../../../config/themes';
+import { SCENE_TRANSITION_DURATION } from '../../../config/transitions';
+import { FollowButton, followButtonHeight } from './FollowButton';
+import { IconRow, spaceBetweenImgAndText } from './IconRow';
+import { Links } from './Links';
const Avatar: React.FC<{
avatar: string;
@@ -27,11 +27,11 @@ const Avatar: React.FC<{
style={{
height: followButtonHeight,
width: followButtonHeight,
- borderRadius: "50%",
+ borderRadius: '50%',
boxShadow:
- theme === "light"
- ? "0px 0px 20px rgba(0, 0, 0, 0.2)"
- : "0px 0px 50px rgba(255, 255, 255, 0.2)",
+ theme === 'light'
+ ? '0px 0px 20px rgba(0, 0, 0, 0.2)'
+ : '0px 0px 50px rgba(255, 255, 255, 0.2)',
}}
src={avatar}
/>
@@ -39,8 +39,8 @@ const Avatar: React.FC<{
};
const style: React.CSSProperties = {
- display: "flex",
- alignItems: "center",
+ display: 'flex',
+ alignItems: 'center',
};
const FollowCTA: React.FC<{
@@ -70,7 +70,7 @@ export const LeftSide: React.FC<{
}> = ({ platform, channel, links, theme }) => {
const ref = useRef<HTMLDivElement>(null);
const scaler = useRef<HTMLDivElement>(null);
- const [handle] = useState(() => delayRender("Waiting for measurement"));
+ const [handle] = useState(() => delayRender('Waiting for measurement'));
const [contentHeight, setHeight] = useState(0);
const { fps, width } = useVideoConfig();
@@ -133,7 +133,7 @@ export const LeftSide: React.FC<{
if (c === platform) {
continue;
}
- if (c === "isLinkedInBusinessPage") {
+ if (c === 'isLinkedInBusinessPage') {
continue;
}
@@ -155,13 +155,13 @@ export const LeftSide: React.FC<{
<AbsoluteFill
style={{
left: 80,
- justifyContent: "center",
+ justifyContent: 'center',
maxWidth: Math.min(maxWidth, 1000),
}}
>
<div
ref={scaler}
- style={{ height: 100, position: "absolute", top: -100000 }}
+ style={{ height: 100, position: 'absolute', top: -100000 }}
/>
<div
style={{
diff --git a/packages/template-recorder/remotion/scenes/EndCard/Links.tsx b/packages/template-recorder/remotion/scenes/EndCard/Links.tsx
index 1480a7d412..f361410839 100644
--- a/packages/template-recorder/remotion/scenes/EndCard/Links.tsx
+++ b/packages/template-recorder/remotion/scenes/EndCard/Links.tsx
@@ -1,8 +1,8 @@
-import React from "react";
-import { spring, useCurrentFrame, useVideoConfig } from "remotion";
-import type { LinkType } from "../../../config/endcard";
-import type { Theme } from "../../../config/themes";
-import { IconRow } from "./IconRow";
+import React from 'react';
+import { spring, useCurrentFrame, useVideoConfig } from 'remotion';
+import type { LinkType } from '../../../config/endcard';
+import type { Theme } from '../../../config/themes';
+import { IconRow } from './IconRow';
export const Links: React.FC<{
links: LinkType[];
diff --git a/packages/template-recorder/remotion/scenes/EndCard/RightSide.tsx b/packages/template-recorder/remotion/scenes/EndCard/RightSide.tsx
index 867251ec6f..6cbee802ca 100644
--- a/packages/template-recorder/remotion/scenes/EndCard/RightSide.tsx
+++ b/packages/template-recorder/remotion/scenes/EndCard/RightSide.tsx
@@ -1,7 +1,7 @@
-import React from "react";
-import { AbsoluteFill } from "remotion";
-import type { Theme } from "../../../config/themes";
-import { COLORS } from "../../../config/themes";
+import React from 'react';
+import { AbsoluteFill } from 'remotion';
+import type { Theme } from '../../../config/themes';
+import { COLORS } from '../../../config/themes';
const border = 6;
@@ -34,7 +34,7 @@ export const ThumbnailContainers: React.FC<{
return (
<AbsoluteFill
style={{
- alignItems: "flex-end",
+ alignItems: 'flex-end',
paddingRight: 100,
top: YOUTUBE_END_SCREEN_SAFE_AREA_TOP,
}}
@@ -42,8 +42,8 @@ export const ThumbnailContainers: React.FC<{
<div
style={{
height: YOUTUBE_END_SCREEN_SAFE_AREA_HEIGHT,
- display: "flex",
- flexDirection: "column",
+ display: 'flex',
+ flexDirection: 'column',
}}
>
<ThumbnailPreview theme={theme} />
diff --git a/packages/template-recorder/remotion/scenes/EndCard/icons.tsx b/packages/template-recorder/remotion/scenes/EndCard/icons.tsx
index 96451d700a..ee58f5beb0 100644
--- a/packages/template-recorder/remotion/scenes/EndCard/icons.tsx
+++ b/packages/template-recorder/remotion/scenes/EndCard/icons.tsx
@@ -1,6 +1,6 @@
-import React from "react";
-import type { Theme } from "../../../config/themes";
-import { COLORS } from "../../../config/themes";
+import React from 'react';
+import type { Theme } from '../../../config/themes';
+import { COLORS } from '../../../config/themes';
export const LinkedInIcon: React.FC<{
height: number;
diff --git a/packages/template-recorder/remotion/scenes/EndCard/index.tsx b/packages/template-recorder/remotion/scenes/EndCard/index.tsx
index b3cd026a9d..646592c341 100644
--- a/packages/template-recorder/remotion/scenes/EndCard/index.tsx
+++ b/packages/template-recorder/remotion/scenes/EndCard/index.tsx
@@ -1,11 +1,11 @@
-import React from "react";
-import { AbsoluteFill } from "remotion";
-import type { Brand, LinkType, Platform } from "../../../config/endcard";
-import type { CanvasLayout } from "../../../config/layout";
-import type { Theme } from "../../../config/themes";
-import { COLORS } from "../../../config/themes";
-import { LeftSide } from "./LeftSide";
-import { ThumbnailContainers } from "./RightSide";
+import React from 'react';
+import { AbsoluteFill } from 'remotion';
+import type { Brand, LinkType, Platform } from '../../../config/endcard';
+import type { CanvasLayout } from '../../../config/layout';
+import type { Theme } from '../../../config/themes';
+import { COLORS } from '../../../config/themes';
+import { LeftSide } from './LeftSide';
+import { ThumbnailContainers } from './RightSide';
export const EndCard: React.FC<{
channel: Brand;
@@ -26,7 +26,7 @@ export const EndCard: React.FC<{
channel={channel}
platform={platform}
/>
- {canvasLayout === "landscape" ? (
+ {canvasLayout === 'landscape' ? (
<ThumbnailContainers theme={theme} />
) : null}
</AbsoluteFill>
diff --git a/packages/template-recorder/remotion/scenes/Placeholders/NoRecordingsScene.tsx b/packages/template-recorder/remotion/scenes/Placeholders/NoRecordingsScene.tsx
index ff74323805..dc67efa42e 100644
--- a/packages/template-recorder/remotion/scenes/Placeholders/NoRecordingsScene.tsx
+++ b/packages/template-recorder/remotion/scenes/Placeholders/NoRecordingsScene.tsx
@@ -1,17 +1,17 @@
-import { AbsoluteFill, useVideoConfig } from "remotion";
-import { MONOSPACE_FONT, REGULAR_FONT } from "../../../config/fonts";
-import { SERVER_PORT } from "../../../config/server";
-import { COLORS } from "../../../config/themes";
+import { AbsoluteFill, useVideoConfig } from 'remotion';
+import { MONOSPACE_FONT, REGULAR_FONT } from '../../../config/fonts';
+import { SERVER_PORT } from '../../../config/server';
+import { COLORS } from '../../../config/themes';
const container: React.CSSProperties = {
...REGULAR_FONT,
fontSize: 36,
padding: 60,
- flexDirection: "column",
+ flexDirection: 'column',
lineHeight: 1.5,
width: 1080,
- margin: "auto",
- justifyContent: "center",
+ margin: 'auto',
+ justifyContent: 'center',
};
const accent: React.CSSProperties = {
@@ -21,11 +21,11 @@ const accent: React.CSSProperties = {
const link: React.CSSProperties = {
color: COLORS.light.ACCENT_COLOR,
- borderBottom: "4px solid " + COLORS.light.ACCENT_COLOR,
- textDecoration: "none",
+ borderBottom: '4px solid ' + COLORS.light.ACCENT_COLOR,
+ textDecoration: 'none',
};
-export const NoRecordingsScene: React.FC<{ type: "none" | "no-more" }> = ({
+export const NoRecordingsScene: React.FC<{ type: 'none' | 'no-more' }> = ({
type,
}) => {
const { id } = useVideoConfig();
@@ -34,8 +34,8 @@ export const NoRecordingsScene: React.FC<{ type: "none" | "no-more" }> = ({
return (
<AbsoluteFill style={container}>
<p>
- This is a video scene but there are no{" "}
- {type === "no-more" ? "more" : null} recordings in the
+ This is a video scene but there are no{' '}
+ {type === 'no-more' ? 'more' : null} recordings in the
<span style={accent}> public/{id} </span>
folder.
</p>
@@ -45,8 +45,8 @@ export const NoRecordingsScene: React.FC<{ type: "none" | "no-more" }> = ({
<li>
<a href={url} target="_blank" style={link}>
Make
- </a>{" "}
- a new recording or add a new video{" "}
+ </a>{' '}
+ a new recording or add a new video{' '}
<a
target="_blank"
href="https://www.remotion.dev/docs/recorder/external-recordings"
@@ -57,7 +57,7 @@ export const NoRecordingsScene: React.FC<{ type: "none" | "no-more" }> = ({
.
</li>
<li>
- Switch this scene to a different type, e.g.{" "}
+ Switch this scene to a different type, e.g.{' '}
<code style={accent}>&quot;title&quot;</code>
</li>
<li>Delete this scene.</li>
diff --git a/packages/template-recorder/remotion/scenes/Placeholders/NoScenes.tsx b/packages/template-recorder/remotion/scenes/Placeholders/NoScenes.tsx
index 7a5b295683..db5c2f4f9d 100644
--- a/packages/template-recorder/remotion/scenes/Placeholders/NoScenes.tsx
+++ b/packages/template-recorder/remotion/scenes/Placeholders/NoScenes.tsx
@@ -1,15 +1,15 @@
-import { AbsoluteFill } from "remotion";
-import { REGULAR_FONT } from "../../../config/fonts";
+import { AbsoluteFill } from 'remotion';
+import { REGULAR_FONT } from '../../../config/fonts';
const container: React.CSSProperties = {
- display: "flex",
- justifyContent: "center",
- alignItems: "center",
+ display: 'flex',
+ justifyContent: 'center',
+ alignItems: 'center',
flex: 1,
...REGULAR_FONT,
fontSize: 36,
gap: 10,
- flexDirection: "column",
+ flexDirection: 'column',
};
export const NoScenes: React.FC = () => {
diff --git a/packages/template-recorder/remotion/scenes/Recorder/index.tsx b/packages/template-recorder/remotion/scenes/Recorder/index.tsx
index e1397df422..ba47d96e9a 100644
--- a/packages/template-recorder/remotion/scenes/Recorder/index.tsx
+++ b/packages/template-recorder/remotion/scenes/Recorder/index.tsx
@@ -1,4 +1,4 @@
-import React from "react";
+import React from 'react';
import {
Easing,
interpolate,
@@ -6,23 +6,23 @@ import {
spring,
useCurrentFrame,
useVideoConfig,
-} from "remotion";
-import type { Theme } from "../../../config/themes";
+} from 'remotion';
+import type { Theme } from '../../../config/themes';
-import { Rect, Triangle } from "@remotion/shapes";
-import { AbsoluteFill, interpolateColors } from "remotion";
-import { REGULAR_FONT } from "../../../config/fonts";
+import { Rect, Triangle } from '@remotion/shapes';
+import { AbsoluteFill, interpolateColors } from 'remotion';
+import { REGULAR_FONT } from '../../../config/fonts';
const getBackground = (theme: Theme) => {
- return theme === "dark" ? "#2E2E2E" : "rgba(255, 255, 255, 1)";
+ return theme === 'dark' ? '#2E2E2E' : 'rgba(255, 255, 255, 1)';
};
const getOpacity = (theme: Theme) => {
- return theme === "dark" ? 0.13 : 0.08;
+ return theme === 'dark' ? 0.13 : 0.08;
};
const getBrand = (theme: Theme) => {
- return theme === "dark" ? "white" : "#0C85F3";
+ return theme === 'dark' ? 'white' : '#0C85F3';
};
const TriangleToSquare: React.FC<{
@@ -52,7 +52,7 @@ const TriangleToSquare: React.FC<{
[0, 1],
[getBackground(theme), getBrand(theme)],
),
- interpolateColors(opacity, [0, 1], [getBackground(theme), "#F43B00"]),
+ interpolateColors(opacity, [0, 1], [getBackground(theme), '#F43B00']),
],
);
@@ -127,7 +127,7 @@ const R3: React.FC = () => {
stroke="currentColor"
strokeWidth="27.4281"
strokeLinecap="square"
- />{" "}
+ />{' '}
</svg>
);
};
@@ -157,7 +157,7 @@ const E: React.FC = () => {
<svg width="1080" height="1080" viewBox="0 0 1080 1080" fill="none">
<mask
id="mask0_20_679"
- style={{ maskType: "alpha" }}
+ style={{ maskType: 'alpha' }}
maskUnits="userSpaceOnUse"
x="351"
y="487"
@@ -181,7 +181,7 @@ const E: React.FC = () => {
</g>
<mask
id="mask1_20_679"
- style={{ maskType: "alpha" }}
+ style={{ maskType: 'alpha' }}
maskUnits="userSpaceOnUse"
x="336"
y="475"
@@ -210,7 +210,7 @@ const C: React.FC = () => {
<g mask="url(#mask4_20_679)" />
<mask
id="mask5_20_679"
- style={{ maskType: "alpha" }}
+ style={{ maskType: 'alpha' }}
maskUnits="userSpaceOnUse"
x="448"
y="475"
@@ -238,7 +238,7 @@ const E2: React.FC = () => {
<svg width="1080" height="1080" viewBox="0 0 1080 1080" fill="none">
<mask
id="mask2_20_679"
- style={{ maskType: "alpha" }}
+ style={{ maskType: 'alpha' }}
maskUnits="userSpaceOnUse"
x="861"
y="487"
@@ -262,7 +262,7 @@ const E2: React.FC = () => {
</g>
<mask
id="mask3_20_679"
- style={{ maskType: "alpha" }}
+ style={{ maskType: 'alpha' }}
maskUnits="userSpaceOnUse"
x="846"
y="475"
@@ -283,7 +283,7 @@ const E2: React.FC = () => {
</g>
<mask
id="mask4_20_679"
- style={{ maskType: "alpha" }}
+ style={{ maskType: 'alpha' }}
maskUnits="userSpaceOnUse"
x="463"
y="487"
@@ -325,7 +325,7 @@ const FromRight: React.FC<{
<AbsoluteFill
style={{
transform: `rotate(${rotation}rad)`,
- transformOrigin: "150% 50%",
+ transformOrigin: '150% 50%',
}}
>
{children}
@@ -334,7 +334,7 @@ const FromRight: React.FC<{
};
const getColor = (theme: Theme) => {
- return theme === "dark" ? "white" : "black";
+ return theme === 'dark' ? 'white' : 'black';
};
const Recorder: React.FC<{
@@ -346,7 +346,7 @@ const Recorder: React.FC<{
WebkitMaskImage: `linear-gradient(black 58%, transparent 74%)`,
}}
>
- <AbsoluteFill style={{ overflow: "visible", color: getColor(theme) }}>
+ <AbsoluteFill style={{ overflow: 'visible', color: getColor(theme) }}>
<FromRight delay={0}>
<R1 />
</FromRight>
@@ -373,8 +373,8 @@ const Recorder: React.FC<{
</FromRight>
<AbsoluteFill
style={{
- width: "160%",
- height: "100.2%",
+ width: '160%',
+ height: '100.2%',
}}
/>
</AbsoluteFill>
@@ -455,15 +455,15 @@ const Logo: React.FC<{
return (
<Sequence
style={{
- transformOrigin: "center center",
+ transformOrigin: 'center center',
transform: `scale(0.68) translateX(${posX}px) translateY(${posY}px)`,
}}
>
<Sequence style={{}}>
<Sequence
style={{
- justifyContent: "center",
- alignItems: "center",
+ justifyContent: 'center',
+ alignItems: 'center',
scale: String(1.2 + anim(2)),
}}
>
@@ -479,8 +479,8 @@ const Logo: React.FC<{
</Sequence>
<Sequence
style={{
- justifyContent: "center",
- alignItems: "center",
+ justifyContent: 'center',
+ alignItems: 'center',
scale: String(1.2 + anim(1)),
}}
>
@@ -496,8 +496,8 @@ const Logo: React.FC<{
</Sequence>
<Sequence
style={{
- justifyContent: "center",
- alignItems: "center",
+ justifyContent: 'center',
+ alignItems: 'center',
scale: String(1.2 + Math.max(anim(0), 0)),
}}
>
@@ -532,15 +532,15 @@ const Attribution: React.FC<{
}> = ({ theme }) => {
const frame = useCurrentFrame();
const opacity = interpolate(frame, [40, 50], [0, 1], {
- extrapolateLeft: "clamp",
- extrapolateRight: "clamp",
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
});
return (
<AbsoluteFill
style={{
- justifyContent: "center",
- alignItems: "center",
+ justifyContent: 'center',
+ alignItems: 'center',
fontSize: 30,
...REGULAR_FONT,
marginTop: 450,
@@ -554,7 +554,7 @@ const Attribution: React.FC<{
};
export const RecorderScene: React.FC<{
- theme: "light" | "dark";
+ theme: 'light' | 'dark';
}> = ({ theme }) => {
const config = useVideoConfig();
@@ -563,16 +563,16 @@ export const RecorderScene: React.FC<{
width={1080}
height={1080}
style={{
- justifyContent: "center",
- alignItems: "center",
+ justifyContent: 'center',
+ alignItems: 'center',
left: (config.width - 1080) / 2,
}}
>
<AbsoluteFill
style={{
transform: `scale(0.7)`,
- overflowY: "hidden",
- overflowX: "hidden",
+ overflowY: 'hidden',
+ overflowX: 'hidden',
}}
>
<All theme={theme} />
diff --git a/packages/template-recorder/remotion/scenes/Scene.tsx b/packages/template-recorder/remotion/scenes/Scene.tsx
index 8ffa9167d2..ed2a2ec420 100644
--- a/packages/template-recorder/remotion/scenes/Scene.tsx
+++ b/packages/template-recorder/remotion/scenes/Scene.tsx
@@ -1,33 +1,33 @@
-import { interpolateStyles } from "@remotion/animation-utils";
-import React, { useMemo } from "react";
+import { interpolateStyles } from '@remotion/animation-utils';
+import React, { useMemo } from 'react';
import {
AbsoluteFill,
Sequence,
spring,
useCurrentFrame,
useVideoConfig,
-} from "remotion";
-import type { Platform } from "../../config/endcard";
-import type { CanvasLayout } from "../../config/layout";
-import type { SceneAndMetadata } from "../../config/scenes";
-import type { Theme } from "../../config/themes";
-import { SCENE_TRANSITION_DURATION } from "../../config/transitions";
-import { getSceneEnter, getSceneExit } from "../animations/scene-transitions";
+} from 'remotion';
+import type { Platform } from '../../config/endcard';
+import type { CanvasLayout } from '../../config/layout';
+import type { SceneAndMetadata } from '../../config/scenes';
+import type { Theme } from '../../config/themes';
+import { SCENE_TRANSITION_DURATION } from '../../config/transitions';
+import { getSceneEnter, getSceneExit } from '../animations/scene-transitions';
import {
getShouldTransitionIn,
getShouldTransitionOut,
-} from "../animations/transitions";
-import type { ChapterType } from "../chapters/make-chapters";
-import { useRefreshOnPublicFolderChange } from "../helpers/refresh-on-public-folder-change";
-import { useScrollToCurrentScene } from "../helpers/scroll-to-current-scene";
-import { EndCard } from "./EndCard";
-import { NoRecordingsScene } from "./Placeholders/NoRecordingsScene";
-import { NoScenes } from "./Placeholders/NoScenes";
-import { RecorderScene } from "./Recorder";
-import { TableOfContents } from "./TableOfContents";
-import { Title } from "./Title/Title";
-import { SoundEffects } from "./VideoScene/SoundEffects";
-import { VideoScene } from "./VideoScene/VideoScene";
+} from '../animations/transitions';
+import type { ChapterType } from '../chapters/make-chapters';
+import { useRefreshOnPublicFolderChange } from '../helpers/refresh-on-public-folder-change';
+import { useScrollToCurrentScene } from '../helpers/scroll-to-current-scene';
+import { EndCard } from './EndCard';
+import { NoRecordingsScene } from './Placeholders/NoRecordingsScene';
+import { NoScenes } from './Placeholders/NoScenes';
+import { RecorderScene } from './Recorder';
+import { TableOfContents } from './TableOfContents';
+import { Title } from './Title/Title';
+import { SoundEffects } from './VideoScene/SoundEffects';
+import { VideoScene } from './VideoScene/VideoScene';
type Props = {
sceneAndMetadata: SceneAndMetadata;
@@ -59,7 +59,7 @@ const InnerScene: React.FC<
index,
hovered,
}) => {
- if (sceneAndMetadata.type === "video-scene") {
+ if (sceneAndMetadata.type === 'video-scene') {
return (
<VideoScene
enterProgress={enterProgress}
@@ -76,7 +76,7 @@ const InnerScene: React.FC<
);
}
- if (sceneAndMetadata.scene.type === "title") {
+ if (sceneAndMetadata.scene.type === 'title') {
return (
<Title
subtitle={sceneAndMetadata.scene.subtitle}
@@ -86,11 +86,11 @@ const InnerScene: React.FC<
);
}
- if (sceneAndMetadata.scene.type === "recorder") {
+ if (sceneAndMetadata.scene.type === 'recorder') {
return <RecorderScene theme={theme} />;
}
- if (sceneAndMetadata.scene.type === "endcard") {
+ if (sceneAndMetadata.scene.type === 'endcard') {
return (
<EndCard
theme={theme}
@@ -102,29 +102,29 @@ const InnerScene: React.FC<
);
}
- if (sceneAndMetadata.scene.type === "tableofcontents") {
+ if (sceneAndMetadata.scene.type === 'tableofcontents') {
return <TableOfContents theme={theme} chapters={chapters} />;
}
- if (sceneAndMetadata.scene.type === "norecordings") {
+ if (sceneAndMetadata.scene.type === 'norecordings') {
return <NoRecordingsScene type="none" />;
}
- if (sceneAndMetadata.scene.type === "nomorerecordings") {
+ if (sceneAndMetadata.scene.type === 'nomorerecordings') {
return <NoRecordingsScene type="no-more" />;
}
- if (sceneAndMetadata.scene.type === "noscenes") {
+ if (sceneAndMetadata.scene.type === 'noscenes') {
return <NoScenes />;
}
- if (sceneAndMetadata.scene.type === "videoscene") {
+ if (sceneAndMetadata.scene.type === 'videoscene') {
throw new Error(
'Video scene should be handled using sceneAndMetadata.type === "video-scene"',
);
}
throw new Error(
- "Scene type not implemented in Scene.tsx: " +
+ 'Scene type not implemented in Scene.tsx: ' +
// @ts-expect-error If this gives a TS error, then you need to implement a new scene type
sceneAndMetadata.scene.type,
);
@@ -226,7 +226,7 @@ export const Scene: React.FC<Props> = ({
hovered,
}) => {
const chapter = useMemo(() => {
- if (sceneAndMetadata.scene.type === "videoscene") {
+ if (sceneAndMetadata.scene.type === 'videoscene') {
return sceneAndMetadata.scene.newChapter;
}
diff --git a/packages/template-recorder/remotion/scenes/TableOfContents/index.tsx b/packages/template-recorder/remotion/scenes/TableOfContents/index.tsx
index c39c064d64..f2aa4caee5 100644
--- a/packages/template-recorder/remotion/scenes/TableOfContents/index.tsx
+++ b/packages/template-recorder/remotion/scenes/TableOfContents/index.tsx
@@ -1,10 +1,10 @@
-import React from "react";
-import { AbsoluteFill } from "remotion";
-import { REGULAR_FONT } from "../../../config/fonts";
-import type { Theme } from "../../../config/themes";
-import { COLORS } from "../../../config/themes";
-import type { ChapterType } from "../../chapters/make-chapters";
-import { TableOfContentItem } from "./item";
+import React from 'react';
+import { AbsoluteFill } from 'remotion';
+import { REGULAR_FONT } from '../../../config/fonts';
+import type { Theme } from '../../../config/themes';
+import { COLORS } from '../../../config/themes';
+import type { ChapterType } from '../../chapters/make-chapters';
+import { TableOfContentItem } from './item';
export const TableOfContents: React.FC<{
chapters: ChapterType[];
@@ -15,7 +15,7 @@ export const TableOfContents: React.FC<{
style={{
backgroundColor: COLORS[theme].BACKGROUND,
- justifyContent: "center",
+ justifyContent: 'center',
paddingLeft: 80,
paddingRight: 80,
color: COLORS[theme].ENDCARD_TEXT_COLOR,
diff --git a/packages/template-recorder/remotion/scenes/TableOfContents/item.tsx b/packages/template-recorder/remotion/scenes/TableOfContents/item.tsx
index b09970ca06..ef4ebe8a8f 100644
--- a/packages/template-recorder/remotion/scenes/TableOfContents/item.tsx
+++ b/packages/template-recorder/remotion/scenes/TableOfContents/item.tsx
@@ -1,7 +1,7 @@
-import { useMemo } from "react";
-import { useVideoConfig } from "remotion";
-import { REGULAR_FONT } from "../../../config/fonts";
-import { formatMilliseconds } from "../../../src/helpers/format-time";
+import { useMemo } from 'react';
+import { useVideoConfig } from 'remotion';
+import { REGULAR_FONT } from '../../../config/fonts';
+import { formatMilliseconds } from '../../../src/helpers/format-time';
export const TableOfContentItem: React.FC<{
title: string;
@@ -18,9 +18,9 @@ export const TableOfContentItem: React.FC<{
style={{
...REGULAR_FONT,
fontSize: 46,
- display: "flex",
- flexDirection: "row",
- width: "100%",
+ display: 'flex',
+ flexDirection: 'row',
+ width: '100%',
lineHeight: 1.5,
}}
>
@@ -28,8 +28,8 @@ export const TableOfContentItem: React.FC<{
<div
style={{
width: 150,
- textAlign: "right",
- fontVariantNumeric: "tabular-nums",
+ textAlign: 'right',
+ fontVariantNumeric: 'tabular-nums',
}}
>
{formatMilliseconds(time * 1000)}
diff --git a/packages/template-recorder/remotion/scenes/Title/Title.tsx b/packages/template-recorder/remotion/scenes/Title/Title.tsx
index 9e91ddc660..89f2fe86fc 100644
--- a/packages/template-recorder/remotion/scenes/Title/Title.tsx
+++ b/packages/template-recorder/remotion/scenes/Title/Title.tsx
@@ -1,8 +1,8 @@
-import React from "react";
-import { AbsoluteFill } from "remotion";
-import { TITLE_FONT } from "../../../config/fonts";
-import type { Theme } from "../../../config/themes";
-import { COLORS } from "../../../config/themes";
+import React from 'react';
+import { AbsoluteFill } from 'remotion';
+import { TITLE_FONT } from '../../../config/fonts';
+import type { Theme } from '../../../config/themes';
+import { COLORS } from '../../../config/themes';
export const Title: React.FC<{
title: string;
@@ -12,8 +12,8 @@ export const Title: React.FC<{
return (
<AbsoluteFill
style={{
- justifyContent: "center",
- alignItems: "center",
+ justifyContent: 'center',
+ alignItems: 'center',
paddingLeft: 30,
paddingRight: 30,
}}
@@ -23,13 +23,13 @@ export const Title: React.FC<{
...TITLE_FONT,
fontSize: 60,
color: COLORS[theme].WORD_COLOR_ON_BG_APPEARED,
- textAlign: "center",
- textWrap: "balance",
+ textAlign: 'center',
+ textWrap: 'balance',
}}
>
{title}
</div>
- {subtitle?.trim() === "" ? null : (
+ {subtitle?.trim() === '' ? null : (
<div
style={{
fontSize: 40,
@@ -37,8 +37,8 @@ export const Title: React.FC<{
color: COLORS[theme].ENDCARD_TEXT_COLOR,
...TITLE_FONT,
marginTop: 10,
- textAlign: "center",
- textWrap: "balance",
+ textAlign: 'center',
+ textWrap: 'balance',
}}
>
{subtitle}
diff --git a/packages/template-recorder/remotion/scenes/VideoScene/ActionOverlay/Action.tsx b/packages/template-recorder/remotion/scenes/VideoScene/ActionOverlay/Action.tsx
index 3275841bfa..cd77aa43e4 100644
--- a/packages/template-recorder/remotion/scenes/VideoScene/ActionOverlay/Action.tsx
+++ b/packages/template-recorder/remotion/scenes/VideoScene/ActionOverlay/Action.tsx
@@ -1,4 +1,4 @@
-import React, { useCallback, useState } from "react";
+import React, { useCallback, useState } from 'react';
export const ActionContainer: React.FC<{
children: React.ReactNode;
@@ -23,21 +23,21 @@ export const ActionContainer: React.FC<{
height: 100,
width: 150,
fontSize: 16,
- fontFamily: "sans-serif",
- fontWeight: "bold",
- display: "flex",
- flexDirection: "column",
- justifyContent: "flex-start",
- alignItems: "center",
- textAlign: "center",
+ fontFamily: 'sans-serif',
+ fontWeight: 'bold',
+ display: 'flex',
+ flexDirection: 'column',
+ justifyContent: 'flex-start',
+ alignItems: 'center',
+ textAlign: 'center',
paddingTop: 20,
gap: 10,
- cursor: "pointer",
- appearance: "none",
- border: "none",
+ cursor: 'pointer',
+ appearance: 'none',
+ border: 'none',
borderRadius: 0,
- background: "none",
- color: "black",
+ background: 'none',
+ color: 'black',
opacity: hovered ? 1 : 0.8,
}}
>
diff --git a/packages/template-recorder/remotion/scenes/VideoScene/ActionOverlay/Actions.tsx b/packages/template-recorder/remotion/scenes/VideoScene/ActionOverlay/Actions.tsx
index 3ceb7b6fdf..104271b2d0 100644
--- a/packages/template-recorder/remotion/scenes/VideoScene/ActionOverlay/Actions.tsx
+++ b/packages/template-recorder/remotion/scenes/VideoScene/ActionOverlay/Actions.tsx
@@ -1,7 +1,7 @@
-import React, { useMemo } from "react";
-import { useVideoConfig } from "remotion";
-import { Cameras } from "../../../../config/scenes";
-import { DeleteRecordingAction } from "./DeleteRecordingAction";
+import React, { useMemo } from 'react';
+import { useVideoConfig } from 'remotion';
+import { Cameras } from '../../../../config/scenes';
+import { DeleteRecordingAction } from './DeleteRecordingAction';
const gradientSteps = [
0, 0.013, 0.049, 0.104, 0.175, 0.259, 0.352, 0.45, 0.55, 0.648, 0.741, 0.825,
@@ -23,13 +23,13 @@ export const container: React.CSSProperties = {
(gradientOpacities[i] as number) * globalGradientOpacity
}%`;
})
- .join(", ")}, hsl(0, 0%, 0%) 100%)`,
+ .join(', ')}, hsl(0, 0%, 0%) 100%)`,
top: 0,
- position: "absolute",
- justifyContent: "center",
- color: "white",
- display: "flex",
- transition: "opacity 0.15s",
+ position: 'absolute',
+ justifyContent: 'center',
+ color: 'white',
+ display: 'flex',
+ transition: 'opacity 0.15s',
};
export const Actions: React.FC<{
diff --git a/packages/template-recorder/remotion/scenes/VideoScene/ActionOverlay/DeleteRecordingAction.tsx b/packages/template-recorder/remotion/scenes/VideoScene/ActionOverlay/DeleteRecordingAction.tsx
index 6ccc94361f..5650742de5 100644
--- a/packages/template-recorder/remotion/scenes/VideoScene/ActionOverlay/DeleteRecordingAction.tsx
+++ b/packages/template-recorder/remotion/scenes/VideoScene/ActionOverlay/DeleteRecordingAction.tsx
@@ -1,9 +1,9 @@
-import { deleteStaticFile, saveDefaultProps } from "@remotion/studio";
-import React, { useCallback } from "react";
-import { useVideoConfig } from "remotion";
-import { z } from "zod";
-import { Cameras, videoConf } from "../../../../config/scenes";
-import { ActionContainer } from "./Action";
+import { deleteStaticFile, saveDefaultProps } from '@remotion/studio';
+import React, { useCallback } from 'react';
+import { useVideoConfig } from 'remotion';
+import { z } from 'zod';
+import { Cameras, videoConf } from '../../../../config/scenes';
+import { ActionContainer } from './Action';
export const DeleteRecordingAction: React.FC<{
cameras: Cameras;
@@ -20,7 +20,7 @@ export const DeleteRecordingAction: React.FC<{
].filter(Boolean) as string[];
if (
!confirm(
- `This will remove ${filesToDelete.join(", ")} from the file system and delete the scene. Do you want to proceed?`,
+ `This will remove ${filesToDelete.join(', ')} from the file system and delete the scene. Do you want to proceed?`,
)
) {
return;
diff --git a/packages/template-recorder/remotion/scenes/VideoScene/Display.tsx b/packages/template-recorder/remotion/scenes/VideoScene/Display.tsx
index 1a8e5cd857..82d9e8cf56 100644
--- a/packages/template-recorder/remotion/scenes/VideoScene/Display.tsx
+++ b/packages/template-recorder/remotion/scenes/VideoScene/Display.tsx
@@ -1,17 +1,17 @@
-import React, { useMemo } from "react";
-import { OffthreadVideo, useCurrentFrame, useVideoConfig } from "remotion";
-import type { CanvasLayout } from "../../../config/layout";
+import React, { useMemo } from 'react';
+import { OffthreadVideo, useCurrentFrame, useVideoConfig } from 'remotion';
+import type { CanvasLayout } from '../../../config/layout';
import type {
SceneAndMetadata,
VideoSceneAndMetadata,
-} from "../../../config/scenes";
-import { getDisplayPosition } from "../../animations/display-transitions";
-import { BRollStack } from "../BRoll/BRollStack";
-import { ScaleDownIfBRollRequiresIt } from "../BRoll/ScaleDownWithBRoll";
+} from '../../../config/scenes';
+import { getDisplayPosition } from '../../animations/display-transitions';
+import { BRollStack } from '../BRoll/BRollStack';
+import { ScaleDownIfBRollRequiresIt } from '../BRoll/ScaleDownWithBRoll';
const outer: React.CSSProperties = {
- position: "absolute",
- display: "flex",
+ position: 'absolute',
+ display: 'flex',
};
export const Display: React.FC<{
@@ -21,7 +21,7 @@ export const Display: React.FC<{
nextScene: SceneAndMetadata | null;
previousScene: SceneAndMetadata | null;
startFrame: number;
- endAt: number | undefined;
+ trimAfter: number | undefined;
canvasLayout: CanvasLayout;
}> = ({
scene,
@@ -30,15 +30,15 @@ export const Display: React.FC<{
nextScene,
canvasLayout,
previousScene,
- endAt,
+ trimAfter,
startFrame,
}) => {
if (scene.layout.displayLayout === null) {
- throw new Error("No display");
+ throw new Error('No display');
}
if (scene.cameras.display === null) {
- throw new Error("No display");
+ throw new Error('No display');
}
const frame = useCurrentFrame();
@@ -68,7 +68,7 @@ export const Display: React.FC<{
const container: React.CSSProperties = useMemo(() => {
return {
- position: "absolute",
+ position: 'absolute',
...displayLayout,
};
}, [displayLayout]);
@@ -82,14 +82,14 @@ export const Display: React.FC<{
frame={frame}
>
<OffthreadVideo
- startFrom={startFrame}
- endAt={endAt}
+ trimBefore={startFrame}
+ trimAfter={trimAfter}
src={scene.cameras.display.src}
style={{
width: displayLayout.width,
height: displayLayout.height,
borderRadius: displayLayout.borderRadius,
- objectFit: "cover",
+ objectFit: 'cover',
}}
/>
</ScaleDownIfBRollRequiresIt>
diff --git a/packages/template-recorder/remotion/scenes/VideoScene/DragDropBRoll.tsx b/packages/template-recorder/remotion/scenes/VideoScene/DragDropBRoll.tsx
index f10abb5d73..b310c229da 100644
--- a/packages/template-recorder/remotion/scenes/VideoScene/DragDropBRoll.tsx
+++ b/packages/template-recorder/remotion/scenes/VideoScene/DragDropBRoll.tsx
@@ -1,11 +1,11 @@
-import { updateDefaultProps, writeStaticFile } from "@remotion/studio";
-import React from "react";
-import { staticFile } from "remotion";
+import { updateDefaultProps, writeStaticFile } from '@remotion/studio';
+import React from 'react';
+import { staticFile } from 'remotion';
import {
BRoll,
SelectableScene,
SelectableVideoScene,
-} from "../../../config/scenes";
+} from '../../../config/scenes';
export const onBRollDropHandler = async ({
e,
diff --git a/packages/template-recorder/remotion/scenes/VideoScene/ImgWithBlur.tsx b/packages/template-recorder/remotion/scenes/VideoScene/ImgWithBlur.tsx
index 86aff127df..64ce1a596c 100644
--- a/packages/template-recorder/remotion/scenes/VideoScene/ImgWithBlur.tsx
+++ b/packages/template-recorder/remotion/scenes/VideoScene/ImgWithBlur.tsx
@@ -1,16 +1,16 @@
-import React, { useMemo } from "react";
-import type { ImgProps } from "remotion";
-import { AbsoluteFill, Img } from "remotion";
-import type { Dimensions } from "../../../config/layout";
-import { getBlurLayout } from "../../layout/blur";
-import type { Layout } from "../../layout/layout-types";
+import React, { useMemo } from 'react';
+import type { ImgProps } from 'remotion';
+import { AbsoluteFill, Img } from 'remotion';
+import type { Dimensions } from '../../../config/layout';
+import { getBlurLayout } from '../../layout/blur';
+import type { Layout } from '../../layout/layout-types';
// An image that if it cannot fill out the canvas, will have a background-blurred replica
export const ImgWithBlur: React.FC<
{
containerLayout: Layout;
imageSize: Dimensions;
- } & Omit<ImgProps, "style">
+ } & Omit<ImgProps, 'style'>
> = ({ containerLayout, imageSize, ...props }) => {
const { innerStyle, needsBlur, outerStyle, blurStyle } = useMemo(() => {
return getBlurLayout({
diff --git a/packages/template-recorder/remotion/scenes/VideoScene/NoDataScene.tsx b/packages/template-recorder/remotion/scenes/VideoScene/NoDataScene.tsx
index 1b6e855e5f..0e73e2518d 100644
--- a/packages/template-recorder/remotion/scenes/VideoScene/NoDataScene.tsx
+++ b/packages/template-recorder/remotion/scenes/VideoScene/NoDataScene.tsx
@@ -1,20 +1,20 @@
-import { useMemo } from "react";
-import { AbsoluteFill } from "remotion";
-import { MONOSPACE_FONT, REGULAR_FONT } from "../../../config/fonts";
-import { COLORS } from "../../../config/themes";
+import { useMemo } from 'react';
+import { AbsoluteFill } from 'remotion';
+import { MONOSPACE_FONT, REGULAR_FONT } from '../../../config/fonts';
+import { COLORS } from '../../../config/themes';
const textWrapper = {
- display: "flex",
- justifyContent: "center",
- alignItems: "center",
- height: "100%",
+ display: 'flex',
+ justifyContent: 'center',
+ alignItems: 'center',
+ height: '100%',
gap: 10,
...REGULAR_FONT,
fontSize: 40,
};
export const NoDataScene: React.FC<{
- theme: "light" | "dark";
+ theme: 'light' | 'dark';
}> = ({ theme }) => {
const spanStyle: React.CSSProperties = useMemo(() => {
return {
diff --git a/packages/template-recorder/remotion/scenes/VideoScene/SoundEffects.tsx b/packages/template-recorder/remotion/scenes/VideoScene/SoundEffects.tsx
index 317250f572..8f466818c4 100644
--- a/packages/template-recorder/remotion/scenes/VideoScene/SoundEffects.tsx
+++ b/packages/template-recorder/remotion/scenes/VideoScene/SoundEffects.tsx
@@ -1,9 +1,9 @@
-import { Audio, staticFile } from "remotion";
-import type { SceneAndMetadata } from "../../../config/scenes";
+import { Audio, staticFile } from 'remotion';
+import type { SceneAndMetadata } from '../../../config/scenes';
import {
isGrowingFromMiniature,
isShrinkingToMiniature,
-} from "../../animations/webcam-transitions/helpers";
+} from '../../animations/webcam-transitions/helpers';
export const SoundEffects: React.FC<{
previousScene: SceneAndMetadata | null;
@@ -19,7 +19,7 @@ export const SoundEffects: React.FC<{
secondScene: sceneAndMetadata,
})
) {
- return <Audio src={staticFile("sounds/shrink.m4a")} volume={0.2} />;
+ return <Audio src={staticFile('sounds/shrink.m4a')} volume={0.2} />;
}
if (
@@ -28,8 +28,8 @@ export const SoundEffects: React.FC<{
secondScene: sceneAndMetadata,
})
) {
- return <Audio src={staticFile("sounds/grow.m4a")} volume={0.2} />;
+ return <Audio src={staticFile('sounds/grow.m4a')} volume={0.2} />;
}
- return <Audio src={staticFile("sounds/whip.wav")} volume={0.1} />;
+ return <Audio src={staticFile('sounds/whip.wav')} volume={0.1} />;
};
diff --git a/packages/template-recorder/remotion/scenes/VideoScene/VideoScene.tsx b/packages/template-recorder/remotion/scenes/VideoScene/VideoScene.tsx
index ac50a4b9b3..b20071940e 100644
--- a/packages/template-recorder/remotion/scenes/VideoScene/VideoScene.tsx
+++ b/packages/template-recorder/remotion/scenes/VideoScene/VideoScene.tsx
@@ -1,27 +1,27 @@
-import React, { useCallback, useMemo } from "react";
+import React, { useCallback, useMemo } from 'react';
import {
AbsoluteFill,
getRemotionEnvironment,
useCurrentFrame,
useVideoConfig,
-} from "remotion";
-import type { CanvasLayout } from "../../../config/layout";
+} from 'remotion';
+import type { CanvasLayout } from '../../../config/layout';
import type {
SceneAndMetadata,
VideoSceneAndMetadata,
-} from "../../../config/scenes";
-import type { Theme } from "../../../config/themes";
-import { B_ROLL_TRANSITION_DURATION } from "../../../config/transitions";
-import { getShouldTransitionIn } from "../../animations/transitions";
-import { BoxedCaptions } from "../../captions/boxed/BoxedCaptions";
-import { SrtPreviewAndEditor } from "../../captions/srt/SrtPreviewAndEditor/SrtPreviewAndEditor";
-import { LandscapeChapters } from "../../chapters/landscape/LandscapeChapters";
-import type { ChapterType } from "../../chapters/make-chapters";
-import { SquareChapter } from "../../chapters/square/SquareChapter";
-import { Actions } from "./ActionOverlay/Actions";
-import { Display } from "./Display";
-import { onBRollDragOver, onBRollDropHandler } from "./DragDropBRoll";
-import { Webcam } from "./Webcam";
+} from '../../../config/scenes';
+import type { Theme } from '../../../config/themes';
+import { B_ROLL_TRANSITION_DURATION } from '../../../config/transitions';
+import { getShouldTransitionIn } from '../../animations/transitions';
+import { BoxedCaptions } from '../../captions/boxed/BoxedCaptions';
+import { SrtPreviewAndEditor } from '../../captions/srt/SrtPreviewAndEditor/SrtPreviewAndEditor';
+import { LandscapeChapters } from '../../chapters/landscape/LandscapeChapters';
+import type { ChapterType } from '../../chapters/make-chapters';
+import { SquareChapter } from '../../chapters/square/SquareChapter';
+import { Actions } from './ActionOverlay/Actions';
+import { Display } from './Display';
+import { onBRollDragOver, onBRollDropHandler } from './DragDropBRoll';
+import { Webcam } from './Webcam';
export const VideoScene: React.FC<{
enterProgress: number;
@@ -47,10 +47,10 @@ export const VideoScene: React.FC<{
hovered,
}) => {
const startFrame = sceneAndMetadata.startFrame;
- const endAt = sceneAndMetadata.endFrame;
+ const trimAfter = sceneAndMetadata.endFrame;
- if (sceneAndMetadata.type !== "video-scene") {
- throw new Error("Not a camera scene");
+ if (sceneAndMetadata.type !== 'video-scene') {
+ throw new Error('Not a camera scene');
}
const didTransitionIn = getShouldTransitionIn({
@@ -91,14 +91,14 @@ export const VideoScene: React.FC<{
nextScene={nextScene}
previousScene={previousScene}
startFrame={startFrame}
- endAt={endAt}
+ trimAfter={trimAfter}
canvasLayout={canvasLayout}
/>
) : null}
<Webcam
bRolls={bRollsOnTopOfWebcam}
currentScene={sceneAndMetadata}
- endAt={endAt}
+ trimAfter={trimAfter}
enterProgress={enterProgress}
exitProgress={exitProgress}
startFrame={startFrame}
@@ -106,7 +106,7 @@ export const VideoScene: React.FC<{
nextScene={nextScene}
previousScene={previousScene}
/>
- {canvasLayout === "square" ? (
+ {canvasLayout === 'square' ? (
<BoxedCaptions
enterProgress={enterProgress}
exitProgress={exitProgress}
@@ -117,7 +117,7 @@ export const VideoScene: React.FC<{
theme={theme}
/>
) : null}
- {sceneAndMetadata.scene.newChapter && canvasLayout === "square" ? (
+ {sceneAndMetadata.scene.newChapter && canvasLayout === 'square' ? (
<SquareChapter
title={sceneAndMetadata.scene.newChapter}
displayLayout={sceneAndMetadata.layout.displayLayout}
@@ -125,7 +125,7 @@ export const VideoScene: React.FC<{
didTransitionIn={didTransitionIn}
/>
) : null}
- {sceneAndMetadata.scene.newChapter && canvasLayout === "landscape" ? (
+ {sceneAndMetadata.scene.newChapter && canvasLayout === 'landscape' ? (
<LandscapeChapters
scene={sceneAndMetadata}
theme={theme}
@@ -133,7 +133,7 @@ export const VideoScene: React.FC<{
didTransitionIn={didTransitionIn}
/>
) : null}
- {canvasLayout === "landscape" && sceneAndMetadata.cameras.captions ? (
+ {canvasLayout === 'landscape' && sceneAndMetadata.cameras.captions ? (
<SrtPreviewAndEditor
captions={sceneAndMetadata.cameras.captions}
startFrame={startFrame}
diff --git a/packages/template-recorder/remotion/scenes/VideoScene/VideoWithBlur.tsx b/packages/template-recorder/remotion/scenes/VideoScene/VideoWithBlur.tsx
index 335e6024ba..5776b9d868 100644
--- a/packages/template-recorder/remotion/scenes/VideoScene/VideoWithBlur.tsx
+++ b/packages/template-recorder/remotion/scenes/VideoScene/VideoWithBlur.tsx
@@ -1,12 +1,12 @@
-import React, { useMemo } from "react";
+import React, { useMemo } from 'react';
import {
AbsoluteFill,
OffthreadVideo,
RemotionOffthreadVideoProps,
-} from "remotion";
-import type { Dimensions } from "../../../config/layout";
-import { getBlurLayout } from "../../layout/blur";
-import type { Layout } from "../../layout/layout-types";
+} from 'remotion';
+import type { Dimensions } from '../../../config/layout';
+import { getBlurLayout } from '../../layout/blur';
+import type { Layout } from '../../layout/layout-types';
// An image that if it cannot fill out the canvas, will have a background-blurred replica
export const VideoWithBlur: React.FC<
@@ -14,7 +14,7 @@ export const VideoWithBlur: React.FC<
containerLayout: Layout;
videoSize: Dimensions;
enableBlur: boolean;
- } & Omit<RemotionOffthreadVideoProps, "style">
+ } & Omit<RemotionOffthreadVideoProps, 'style'>
> = ({ containerLayout, videoSize, enableBlur, ...props }) => {
const { innerStyle, needsBlur, outerStyle, blurStyle } = useMemo(() => {
return getBlurLayout({
@@ -28,9 +28,9 @@ export const VideoWithBlur: React.FC<
<AbsoluteFill>
<OffthreadVideo
style={{
- objectFit: "cover",
+ objectFit: 'cover',
...outerStyle,
- position: "absolute",
+ position: 'absolute',
}}
{...props}
/>
diff --git a/packages/template-recorder/remotion/scenes/VideoScene/Webcam.tsx b/packages/template-recorder/remotion/scenes/VideoScene/Webcam.tsx
index 68489db39a..a007371a55 100644
--- a/packages/template-recorder/remotion/scenes/VideoScene/Webcam.tsx
+++ b/packages/template-recorder/remotion/scenes/VideoScene/Webcam.tsx
@@ -1,22 +1,22 @@
-import React, { useMemo } from "react";
-import { useCurrentFrame, useVideoConfig } from "remotion";
-import type { CanvasLayout } from "../../../config/layout";
+import React, { useMemo } from 'react';
+import { useCurrentFrame, useVideoConfig } from 'remotion';
+import type { CanvasLayout } from '../../../config/layout';
import type {
BRollWithDimensions,
SceneAndMetadata,
VideoSceneAndMetadata,
-} from "../../../config/scenes";
-import { getWebcamLayout } from "../../animations/webcam-transitions";
-import { shouldEnableSceneBackgroundBlur } from "../../layout/blur";
-import { BRollStack } from "../BRoll/BRollStack";
-import { ScaleDownIfBRollRequiresIt } from "../BRoll/ScaleDownWithBRoll";
-import { VideoWithBlur } from "./VideoWithBlur";
+} from '../../../config/scenes';
+import { getWebcamLayout } from '../../animations/webcam-transitions';
+import { shouldEnableSceneBackgroundBlur } from '../../layout/blur';
+import { BRollStack } from '../BRoll/BRollStack';
+import { ScaleDownIfBRollRequiresIt } from '../BRoll/ScaleDownWithBRoll';
+import { VideoWithBlur } from './VideoWithBlur';
export const Webcam: React.FC<{
enterProgress: number;
exitProgress: number;
startFrame: number;
- endAt: number | undefined;
+ trimAfter: number | undefined;
canvasLayout: CanvasLayout;
nextScene: SceneAndMetadata | null;
previousScene: SceneAndMetadata | null;
@@ -26,7 +26,7 @@ export const Webcam: React.FC<{
enterProgress,
exitProgress,
startFrame,
- endAt,
+ trimAfter,
nextScene,
previousScene,
canvasLayout,
@@ -60,8 +60,8 @@ export const Webcam: React.FC<{
const container: React.CSSProperties = useMemo(() => {
return {
- overflow: "hidden",
- position: "relative",
+ overflow: 'hidden',
+ position: 'relative',
...webcamLayout,
};
}, [webcamLayout]);
@@ -75,8 +75,8 @@ export const Webcam: React.FC<{
bRollType={currentScene.layout.bRollType}
>
<VideoWithBlur
- startFrom={startFrame}
- endAt={endAt}
+ trimBefore={startFrame}
+ trimAfter={trimAfter}
src={currentScene.cameras.webcam.src}
containerLayout={webcamLayout}
videoSize={currentScene.videos.webcam}