From 22866ac8a1307c41be2c5aa2241934bcb9884469 Mon Sep 17 00:00:00 2001 From: Sergiy Date: Tue, 24 Sep 2024 20:08:51 +0300 Subject: [PATCH 01/12] OV-396: + constants --- frontend/src/remotion/composition/constants/constants.js | 7 +++++++ .../src/remotion/composition/constants/fps.constant.js | 4 ++++ .../composition/constants/height-landscape.constant.js | 4 ++++ .../src/remotion/composition/constants/height-portrait.js | 4 ++++ .../constants/minimal-duration-in-frames.constant.js | 4 ++++ .../composition/constants/width-landscape.constant.js | 4 ++++ .../composition/constants/width-portrait.constant.js | 4 ++++ 7 files changed, 31 insertions(+) create mode 100644 frontend/src/remotion/composition/constants/constants.js create mode 100644 frontend/src/remotion/composition/constants/fps.constant.js create mode 100644 frontend/src/remotion/composition/constants/height-landscape.constant.js create mode 100644 frontend/src/remotion/composition/constants/height-portrait.js create mode 100644 frontend/src/remotion/composition/constants/minimal-duration-in-frames.constant.js create mode 100644 frontend/src/remotion/composition/constants/width-landscape.constant.js create mode 100644 frontend/src/remotion/composition/constants/width-portrait.constant.js diff --git a/frontend/src/remotion/composition/constants/constants.js b/frontend/src/remotion/composition/constants/constants.js new file mode 100644 index 000000000..9c34e384d --- /dev/null +++ b/frontend/src/remotion/composition/constants/constants.js @@ -0,0 +1,7 @@ +// Using .js extension to avoid TypeScript issues with Remotion's rendering process. +export { FPS } from './fps.constant.js'; +export { LANDSCAPE_HEIGHT } from './height-landscape.constant.js'; +export { PORTRAIT_HEIGHT } from './height-portrait.js'; +export { MINIMAL_DURATION_IN_FRAMES } from './minimal-duration-in-frames.constant.js'; +export { LANDSCAPE_WIDTH } from './width-landscape.constant.js'; +export { PORTRAIT_WIDTH } from './width-portrait.constant.js'; diff --git a/frontend/src/remotion/composition/constants/fps.constant.js b/frontend/src/remotion/composition/constants/fps.constant.js new file mode 100644 index 000000000..cd4d7b7df --- /dev/null +++ b/frontend/src/remotion/composition/constants/fps.constant.js @@ -0,0 +1,4 @@ +// Using .js extension to avoid TypeScript issues with Remotion's rendering process. +const FPS = 30; + +export { FPS }; diff --git a/frontend/src/remotion/composition/constants/height-landscape.constant.js b/frontend/src/remotion/composition/constants/height-landscape.constant.js new file mode 100644 index 000000000..817edff85 --- /dev/null +++ b/frontend/src/remotion/composition/constants/height-landscape.constant.js @@ -0,0 +1,4 @@ +// Using .js extension to avoid TypeScript issues with Remotion's rendering process. +const LANDSCAPE_HEIGHT = 1080; + +export { LANDSCAPE_HEIGHT }; diff --git a/frontend/src/remotion/composition/constants/height-portrait.js b/frontend/src/remotion/composition/constants/height-portrait.js new file mode 100644 index 000000000..c4a6b8f4b --- /dev/null +++ b/frontend/src/remotion/composition/constants/height-portrait.js @@ -0,0 +1,4 @@ +// Using .js extension to avoid TypeScript issues with Remotion's rendering process. +const PORTRAIT_HEIGHT = 1920; + +export { PORTRAIT_HEIGHT }; diff --git a/frontend/src/remotion/composition/constants/minimal-duration-in-frames.constant.js b/frontend/src/remotion/composition/constants/minimal-duration-in-frames.constant.js new file mode 100644 index 000000000..8af30ecc1 --- /dev/null +++ b/frontend/src/remotion/composition/constants/minimal-duration-in-frames.constant.js @@ -0,0 +1,4 @@ +// Using .js extension to avoid TypeScript issues with Remotion's rendering process. +const MINIMAL_DURATION_IN_FRAMES = 100; + +export { MINIMAL_DURATION_IN_FRAMES }; diff --git a/frontend/src/remotion/composition/constants/width-landscape.constant.js b/frontend/src/remotion/composition/constants/width-landscape.constant.js new file mode 100644 index 000000000..e9ff7f89a --- /dev/null +++ b/frontend/src/remotion/composition/constants/width-landscape.constant.js @@ -0,0 +1,4 @@ +// Using .js extension to avoid TypeScript issues with Remotion's rendering process. +const LANDSCAPE_WIDTH = 1920; + +export { LANDSCAPE_WIDTH }; diff --git a/frontend/src/remotion/composition/constants/width-portrait.constant.js b/frontend/src/remotion/composition/constants/width-portrait.constant.js new file mode 100644 index 000000000..fc2464213 --- /dev/null +++ b/frontend/src/remotion/composition/constants/width-portrait.constant.js @@ -0,0 +1,4 @@ +// Using .js extension to avoid TypeScript issues with Remotion's rendering process. +const PORTRAIT_WIDTH = 1080; + +export { PORTRAIT_WIDTH }; From 702097529ee3ebe355f597cddfeb80ab47afd037 Mon Sep 17 00:00:00 2001 From: Sergiy Date: Tue, 24 Sep 2024 20:09:10 +0300 Subject: [PATCH 02/12] OV-396: + enums --- frontend/src/remotion/composition/enums/enums.js | 2 ++ .../remotion/composition/enums/video-orientation.enum.js | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 frontend/src/remotion/composition/enums/enums.js create mode 100644 frontend/src/remotion/composition/enums/video-orientation.enum.js diff --git a/frontend/src/remotion/composition/enums/enums.js b/frontend/src/remotion/composition/enums/enums.js new file mode 100644 index 000000000..2805ecd1c --- /dev/null +++ b/frontend/src/remotion/composition/enums/enums.js @@ -0,0 +1,2 @@ +// Using .js extension to avoid TypeScript issues with Remotion's rendering process. +export { videoOrientation } from './video-orientation.enum.js'; diff --git a/frontend/src/remotion/composition/enums/video-orientation.enum.js b/frontend/src/remotion/composition/enums/video-orientation.enum.js new file mode 100644 index 000000000..7b20d3fda --- /dev/null +++ b/frontend/src/remotion/composition/enums/video-orientation.enum.js @@ -0,0 +1,7 @@ +// Using .js extension to avoid TypeScript issues with Remotion's rendering process. +const videoOrientation = { + LANDSCAPE: 'landscape', + PORTRAIT: 'portrait', +}; + +export { videoOrientation }; From 1a0d31aed46f8ae46259888fd14a5fc575becd0e Mon Sep 17 00:00:00 2001 From: Sergiy Date: Tue, 24 Sep 2024 20:12:47 +0300 Subject: [PATCH 03/12] OV-396: * remotion composition --- frontend/src/remotion/composition/main.jsx | 11 +++++--- .../remotion/composition/styles.module.css | 11 +++++++- frontend/src/remotion/root.jsx | 27 +++++++++++++++---- 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/frontend/src/remotion/composition/main.jsx b/frontend/src/remotion/composition/main.jsx index 3fdc704ab..e7da6035b 100644 --- a/frontend/src/remotion/composition/main.jsx +++ b/frontend/src/remotion/composition/main.jsx @@ -1,9 +1,9 @@ // Using .js extension to avoid TypeScript issues with Remotion's rendering process. import { AbsoluteFill, Video, Series } from 'remotion'; - +import { videoOrientation as videoOrientationValue } from './enums/enums.js'; import styles from './styles.module.css'; -const Main = ({ scenes }) => { +const Main = ({ scenes, videoOrientation }) => { return ( @@ -14,7 +14,12 @@ const Main = ({ scenes }) => { durationInFrames={scene.durationInFrames} >