This is a React Native application built with Expo for video editing. It allows users to trim videos, add text overlays, and save their edits. The app leverages various React Native libraries and custom hooks for video manipulation and user interface management.
-
Video Playback:
- Play and pause videos
- Scrub through the video timeline
-
Text Overlays:
- Add text overlays to the video
- Edit existing text overlays (position and content)
- Delete text overlays
- Text overlays are displayed in real-time but only saved permanently when "Save Effects" is clicked
-
Video Trimming:
- Set start and end points for trimming
- Preview trimmed video
- Trimmed version is created but only saved and displayed after clicking "Save Effects"
-
Thumbnail Generation:
- Generate thumbnails for specific video frames
- Display thumbnails on the timeline
-
Save Effects:
- Click "Save Effects" to permanently apply all edits (text overlays and trimming)
- Edited video is exported only after saving effects
-
Responsive Design:
- Adapts to different screen orientations and sizes
-
Real-time Preview:
- See text overlays and trimming effects in real-time as you edit
- Changes are temporary until "Save Effects" is clicked
-
Undo/Redo Functionality:
- Ability to undo and redo edits (to be implemented)
- When you add a text overlay, it will immediately appear on the video preview.
- You can edit, move, or delete these overlays as needed.
- These changes are temporary and for preview purposes only.
- To permanently save the text overlays, you must click the "Save Effects" button.
- When you use the trim function, you'll see a preview of the trimmed video.
- The original video file remains unchanged at this stage.
- The trim points are remembered by the app but not yet applied to the video file.
- Clicking "Save Effects" will apply the trim to the video and create a new, trimmed video file.
- The "Save Effects" button is crucial for finalizing your edits.
- Clicking this button will:
- Permanently apply all text overlays to the video.
- Create a new video file with the applied trim points.
- Combine all effects into a final, edited video.
- After saving effects, the new edited video will be displayed and available for further editing or export.
Always remember to click "Save Effects" before exiting the editor or if you want to make your changes permanent. Unsaved edits will be lost if you close the app or start editing a new video.
- Expo: Framework and platform for universal React applications
- React Native: Core framework for building the mobile app
- FFmpeg: For video processing tasks (via
ffmpeg-kit-react-native
) - react-native-video: For video playback functionality
- react-native-create-thumbnail: For generating video thumbnails
- @expo/vector-icons: For using icons in the UI
- react-native-reanimated: For smooth animations (used in timeline)
- expo-router: For navigation within the app
ControlPanel
: Main control interface for the video editorTimeline
: Displays video timeline and allows scrubbingTextOverlay
: Manages text overlays on the videoTrimInputModal
: Interface for inputting trim times
useVideoPlayer
: Manages overall video player state and actionsuseVideoActions
: Handles video-specific actions (trim, save)useTimeline
: Manages timeline state and interactions
FFmpegUtils
: Provides utility functions for video processing using FFmpeg
To set up this Expo project:
-
Prerequisites:
- Node.js (v14 or later)
- npm or yarn
- Expo CLI (
npm install -g expo-cli
)
-
Clone the repository:
git clone https://github.com/lironsfadia/VideoPlayer.git cd VideoPlayer
-
Install dependencies:
npm install
or if you're using yarn:
yarn install
-
Set up FFmpeg:
- Follow the setup instructions for
ffmpeg-kit-react-native
in their documentation: Add this line to podfile: pod 'ffmpeg-kit-react-native', :subspecs => ['https'], :podspec => '../node_modules/ffmpeg-kit-react-native/ffmpeg-kit-react-native.podspec'
- Follow the setup instructions for
-
Run the project:
npx expo prebuild npx expo start -c npx expo run:ios --device
NOTE - This project was tested only on a real iOS device.