Skip to content

Repository files navigation

CamCut - Browser-Based Video Editor & Player

Version Vite TypeScript Tailwind CSS PWA

A free, browser-based Progressive Web App (PWA) for Play , Trim and Edit Videos or create Vine style clips (short clip). client side so everything runs locally in your browser.

CamCut Screenshot

๐ŸŽฌ Features

Video Editing

  • Upload or Select: Choose from a library of trending clips or upload your own video
  • Precise Trimming: Frame-accurate video trimming with timeline controls
  • Text Overlays: Six short-form-ready text styles (Comic, Neon, Retro, Bold, Elegant, Outline)
  • Real-time Preview: See your edits instantly in the browser
  • Local Export: Download your finished clips without watermarks

Video Player

  • Full-Featured Player: Play, pause, seek, volume control, and fullscreen
  • Keyboard Shortcuts: Space/K to play/pause, arrow keys to seek, M to mute, F for fullscreen
  • Offline Support: Play videos stored locally even when offline
  • File Handling: Open video files directly from your system (Windows File Handling API)

Progressive Web App (PWA)

  • Installable: Install as a native app on desktop and mobile
  • Offline Capable: Works offline with cached resources and IndexedDB storage
  • Fast Loading: Optimized caching strategies for quick access
  • App Shortcuts: Quick access to Studio and Gallery from installed app

Privacy & Security

  • 100% Local Processing: All video processing happens in your browser
  • No Server Uploads: Your videos never leave your device
  • No Signup Required: Start creating immediately
  • No Tracking: Privacy-first approach

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18+ and pnpm (or npm/yarn)
  • Modern browser with support for:
    • Web APIs (File API, IndexedDB, Service Workers)
    • Video codecs (MP4, WebM, etc.)

Installation

  1. Clone the repository:
git clone https://github.com/alihd-tech/CamCut.git
cd CamCut
  1. Install dependencies:
pnpm install
  1. Start the development server:
pnpm dev
  1. Open your browser and navigate to http://localhost:5173

Building for Production

pnpm build

The production build will be in the dist directory, ready to be deployed to any static hosting service.

Preview Production Build

pnpm preview

๐Ÿ“ Project Structure

CanCut/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/          # React components
โ”‚   โ”‚   โ”œโ”€โ”€ VideoPlayer.tsx  # Full-featured video player
โ”‚   โ”‚   โ”œโ”€โ”€ Studio.tsx       # Main video editor
โ”‚   โ”‚   โ”œโ”€โ”€ VideoTrimmer.tsx # Video trimming interface
โ”‚   โ”‚   โ”œโ”€โ”€ TextEditor.tsx   # Text overlay editor
โ”‚   โ”‚   โ”œโ”€โ”€ VideoPreview.tsx # Preview and export
โ”‚   โ”‚   โ”œโ”€โ”€ Gallery.tsx      # Video gallery
โ”‚   โ”‚   โ”œโ”€โ”€ LocalVideos.tsx  # Local video storage viewer
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ contexts/            # React contexts
โ”‚   โ”‚   โ””โ”€โ”€ SettingsContext.tsx
โ”‚   โ”œโ”€โ”€ hooks/               # Custom React hooks
โ”‚   โ”‚   โ”œโ”€โ”€ useOfflineStatus.ts
โ”‚   โ”‚   โ””โ”€โ”€ useVideoEditor.ts
โ”‚   โ”œโ”€โ”€ lib/                 # Utility libraries
โ”‚   โ”‚   โ””โ”€โ”€ api.ts
โ”‚   โ”œโ”€โ”€ router.tsx           # Client-side routing
โ”‚   โ”œโ”€โ”€ types/               # TypeScript type definitions
โ”‚   โ”‚   โ””โ”€โ”€ video.ts
โ”‚   โ”œโ”€โ”€ utils/               # Utility functions
โ”‚   โ”‚   โ””โ”€โ”€ videoStorage.ts  # IndexedDB video storage
โ”‚   โ”œโ”€โ”€ App.tsx              # Main app component
โ”‚   โ””โ”€โ”€ main.tsx             # Entry point
โ”œโ”€โ”€ public/                  # Static assets
โ”‚   โ”œโ”€โ”€ videos/             # Sample video clips
โ”‚   โ”œโ”€โ”€ manifest.json        # PWA manifest
โ”‚   โ””โ”€โ”€ sw.js               # Service worker
โ”œโ”€โ”€ dist/                    # Production build output
โ”œโ”€โ”€ vite.config.ts           # Vite configuration
โ”œโ”€โ”€ tailwind.config.js       # Tailwind CSS configuration
โ””โ”€โ”€ package.json

๐Ÿ› ๏ธ Technology Stack

  • Framework: React 18.3.1 with TypeScript
  • Build Tool: Vite 5.4.2
  • Styling: Tailwind CSS 3.4.1
  • Icons: Lucide React
  • Animations: Framer Motion
  • File Upload: React Dropzone
  • PWA: Vite Plugin PWA with Workbox
  • Routing: Custom hash-based router

๐Ÿ“ฑ PWA Features

Installation

  • Desktop: Look for the install prompt in your browser's address bar
  • Mobile: Use "Add to Home Screen" from the browser menu
  • Windows: Can be installed from Microsoft Edge

Offline Functionality

  • Videos uploaded are stored in IndexedDB for offline access
  • App shell and static assets are cached
  • Service worker handles caching strategies:
    • Videos: CacheFirst (30 days)
    • API: NetworkFirst (5 minutes)
    • Static assets: StaleWhileRevalidate
    • HTML: NetworkFirst (1 day)

File Handling (Windows)

  • Supports opening video files directly from File Explorer
  • Registered file types: MP4, MKV, WebM, MOV, AVI, M4V, 3GP, FLV, WMV, OGV, MPEG, MPG

๐ŸŽจ Video Editor Workflow

  1. Select Source: Choose from library or upload your own video
  2. Trim: Set in/out points on the timeline (3-6 seconds for short-form)
  3. Add Text: Type your caption and choose a style
  4. Preview & Export: Review your clip and download

๐ŸŽฎ Video Player Controls

Mouse/Touch

  • Click video to play/pause
  • Double-click for fullscreen
  • Use control bar for seek, volume, and playback speed

Keyboard Shortcuts

  • Space or K: Play/pause
  • โ† / โ†’: Seek backward/forward 5 seconds
  • M: Mute/unmute
  • F: Toggle fullscreen
  • 0-9: Seek to percentage (0% to 90%)

โš™๏ธ Configuration

Settings

  • Duration Preference: Choose between short-form (3-6s) or long-form (30+s)
  • Theme: Light/dark mode support
  • Storage Management: View and manage stored videos

Environment Variables

The app uses Vite's environment variables. See vite.config.ts for configuration.

๐Ÿงช Development

Available Scripts

  • pnpm dev - Start development server
  • pnpm build - Build for production
  • pnpm preview - Preview production build
  • pnpm lint - Run ESLint
  • pnpm typecheck - Run TypeScript type checking

Code Style

  • ESLint for code linting
  • TypeScript for type safety
  • Prettier (if configured) for code formatting

๐ŸŒ Browser Support

  • Chrome/Edge: Full support (recommended)
  • Firefox: Full support
  • Safari: Limited PWA support (iOS 11.3+)
  • Opera: Full support

๐Ÿ“ฆ Deployment

Static Hosting

The app can be deployed to any static hosting service:

  • Vercel: Connect your repository
  • Netlify: Drag and drop the dist folder
  • GitHub Pages: Use GitHub Actions
  • Cloudflare Pages: Connect repository
  • AWS S3 + CloudFront: Upload dist folder

Requirements

  • HTTPS required for PWA features (Service Workers)
  • Proper MIME types for video files
  • CORS headers if using external APIs

๐Ÿ”’ Privacy & Security

  • All video processing happens client-side
  • No data is sent to external servers (except API calls if configured)
  • Videos stored in IndexedDB remain on your device
  • No analytics or tracking by default

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Live Demo

About

Video Player and Editor PWA - Install To Use Offline (Browser-Based and on-device)

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Contributors

Languages