A video player built with React and TypeScript that features Picture-in-Picture (PIP) mode with custom media controls. This project leverages media-chrome to handle player interactions and transitions between inline and floating video modes, making it user-friendly and interactive.
- Vite
- React
- TypeScript
- Tailwind CSS
- Framer Motion
- Automatically switches between inline and Picture-in-Picture mode based on scroll position.
- Play, pause, mute, fullscreen, and time tracking powered by
media-chrome
. - Integrated animations using Framer Motion and Tailwind CSS.
- When out of view, the video floats at the bottom right corner.
- The player intelligently toggles between inline and floating modes based on user interaction.
To run the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/your-username/picture-in-picture-player.git cd picture-in-picture-player
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open the app:
Visit
http://localhost:5173
to see the app in action.
├── public/ # Public assets (e.g., videos)
├── src/
│ ├── components/ # React components
│ │ ├── VideoPlayer.tsx
│ │ ├── VideoDescription.tsx
│ │ ├── DynamicContent.tsx
│ ├── App.tsx # Main application component
│ ├── index.css # Tailwind CSS file
│ ├── main.tsx # Entry point
├── package.json # Project configuration and dependencies
└── tsconfig.json # TypeScript configuration