{children}
20 |
21 | );
22 | }
23 |
--------------------------------------------------------------------------------
/tailwind.config.ts:
--------------------------------------------------------------------------------
1 | import type { Config } from "tailwindcss";
2 |
3 | const config: Config = {
4 | content: [
5 | "./pages/**/*.{js,ts,jsx,tsx,mdx}",
6 | "./components/**/*.{js,ts,jsx,tsx,mdx}",
7 | "./app/**/*.{js,ts,jsx,tsx,mdx}",
8 | ],
9 | theme: {
10 | extend: {
11 | backgroundImage: {
12 | "gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
13 | "gradient-conic":
14 | "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
15 | },
16 | },
17 | },
18 | plugins: [],
19 | };
20 | export default config;
21 |
--------------------------------------------------------------------------------
/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "lib": ["dom", "dom.iterable", "esnext"],
4 | "allowJs": true,
5 | "skipLibCheck": true,
6 | "strict": true,
7 | "noEmit": true,
8 | "esModuleInterop": true,
9 | "module": "esnext",
10 | "moduleResolution": "bundler",
11 | "resolveJsonModule": true,
12 | "isolatedModules": true,
13 | "jsx": "preserve",
14 | "incremental": true,
15 | "plugins": [
16 | {
17 | "name": "next"
18 | }
19 | ],
20 | "paths": {
21 | "@/*": ["./*"]
22 | }
23 | },
24 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
25 | "exclude": ["node_modules"]
26 | }
27 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "a-react-video-editor",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "next dev",
7 | "build": "next build",
8 | "start": "next start",
9 | "lint": "next lint"
10 | },
11 | "dependencies": {
12 | "@remotion/player": "^4.0.208",
13 | "lucide-react": "^0.438.0",
14 | "next": "14.2.7",
15 | "react": "^18.3.1",
16 | "react-dom": "^18",
17 | "remotion": "^4.0.208"
18 | },
19 | "devDependencies": {
20 | "@types/node": "^20",
21 | "@types/react": "^18",
22 | "@types/react-dom": "^18",
23 | "eslint": "^8",
24 | "eslint-config-next": "14.2.7",
25 | "postcss": "^8",
26 | "tailwindcss": "^3.4.1",
27 | "typescript": "^5"
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/types/types.ts:
--------------------------------------------------------------------------------
1 | export interface Clip {
2 | id: string;
3 | start: number;
4 | duration: number;
5 | src: string;
6 | row: number;
7 | }
8 |
9 | export interface TextOverlay {
10 | id: string;
11 | start: number;
12 | duration: number;
13 | text: string;
14 | row: number;
15 | }
16 |
17 | export interface Sound {
18 | id: string;
19 | start: number;
20 | duration: number;
21 | content: string;
22 | row: number;
23 | file: string; // Add this line
24 | }
25 |
26 | export interface PexelsMedia {
27 | id: number;
28 | width: number;
29 | height: number;
30 | url: string;
31 | image?: string;
32 | duration?: number;
33 | video_files?: { link: string; quality: string }[];
34 | }
35 |
36 | export interface Effect {
37 | id: string;
38 | type: string;
39 | start: number;
40 | duration: number;
41 | row: number;
42 | }
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 [Your Name or Your Organization's Name]
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/components/banner.tsx:
--------------------------------------------------------------------------------
1 | import { Sparkles } from "lucide-react";
2 |
3 | export default function Banner() {
4 | return (
5 |
9 |
10 |
11 |
12 |
13 | Sparkles icon
14 |
15 |
16 | Upgrade to the Pro version of{" "}
17 |
22 | React Video Editor
23 | {" "}
24 | for advanced features and support!
25 |
26 |
27 |
28 |
29 | );
30 | }
31 |
--------------------------------------------------------------------------------
/public/next.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # React Video Editor (Open Source Edition)
2 |
3 | > **Important Notice:**
4 | > The active repository for this project has been moved to
5 | > 👉 **[reactvideoeditor/free-react-video-editor](https://github.com/reactvideoeditor/free-react-video-editor)** 👈
6 | > Please visit the new repository for the **latest updates**, **contributions**, and **issues**.
7 |
8 | ---
9 |
10 | A free, open-source basic video editor example that runs directly in your web browser. This project serves as a foundation for video editing capabilities and is a simplified version of the full-featured [React Video Editor](https://www.reactvideoeditor.com/).
11 |
12 | Built with:
13 | - [Next.js](https://nextjs.org/) - React framework for server-side rendering and static site generation
14 | - [Tailwind CSS](https://tailwindcss.com/) - Utility-first CSS framework
15 | - [Remotion](https://www.remotion.dev/) - Framework for programmatically creating videos
16 | - [React](https://reactjs.org/) - JavaScript library for building user interfaces
17 |
18 | ## Demo
19 |
20 | Try out the live demo: [React Video Editor (Open Source Edition)](https://www.reactvideoeditor.com/open-source)
21 |
22 | ## About the Project
23 |
24 | This React Video Editor serves as a foundational tool for understanding and interacting with the core building blocks of Remotion. It offers a user-friendly, browser-based interface that allows users to compose videos by arranging clips and adding text overlays seamlessly. While the current version provides a smooth and interactive experience, it's designed to be a stepping stone toward building a fully-fledged video editor
25 |
26 | Key features include:
27 |
28 | - Arranging video clips on a timeline
29 | - Adding static text overlays to videos
30 | - Real-time preview of composition
31 |
32 | While this open-source version provides basic video composition functionality, it does not include advanced editing features. For a more comprehensive video editing solution, check out the [pro version](https://www.reactvideoeditor.com/) which offers additional capabilities and integration options for React applications.
33 |
34 | **Important Note:** This project uses the Remotion video player. If you intend to use this project, please be aware that you may need a Remotion license depending on your use case. Check out the [Remotion Licensing](https://www.remotion.dev/docs/licensing) page for more information and ensure you comply with their licensing terms.
35 |
36 | ## Getting Started
37 |
38 | To get started with this project, follow these steps:
39 |
40 | 1. Clone the repository to your local machine.
41 |
42 | 2. Install the dependencies:
43 |
44 | ```bash
45 | npm install
46 | ```
47 |
48 | 3. Run the development server:
49 |
50 | ```bash
51 | npm run dev
52 | ```
53 |
54 | 4. Open [http://localhost:3000](http://localhost:3000) in your browser to see the video editor in action.
55 |
56 | You can start editing the project by modifying the files in the `app` directory. The page will auto-update as you make changes.
57 |
58 |
59 | ## License
60 |
61 | This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
62 |
--------------------------------------------------------------------------------
/components/react-video-editor.tsx:
--------------------------------------------------------------------------------
1 | "use client";
2 |
3 | import React, { useState, useRef, useCallback, useMemo, useEffect } from "react";
4 | import { Player, PlayerRef } from "@remotion/player";
5 | import { Sequence, Video, interpolate, useCurrentFrame } from "remotion";
6 | import { LetterText, Plus, Text } from "lucide-react";
7 |
8 | import { Clip, TextOverlay } from "@/types/types";
9 |
10 | /**
11 | * TimelineMarker Component
12 | * Renders a marker on the timeline to indicate the current frame position
13 | */
14 | const TimelineMarker: React.FC<{
15 | currentFrame: number;
16 | totalDuration: number;
17 | }> = React.memo(({ currentFrame, totalDuration }) => {
18 | const markerPosition = useMemo(() => {
19 | return `${(currentFrame / totalDuration) * 100}%`;
20 | }, [currentFrame, totalDuration]);
21 |
22 | return (
23 |