adyz / video-player

HTML5 custom video player

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTML5 Custom React Video Player

Simple Video Player with custom controls, modeled after YouTube. Uses React Hooks, MobX and Typescript.

Screenshot:

Screenshot

Click here for a DEMO of the player online

Implemented Features

  • State management using MobX
  • Material Design System via Material-UI React library
  • Keyboard control of video
  • Progress bar (with expected seek time preview on hover and ability to drag & hold)
  • Play / Pause Button
  • Mute / Un-mute Sound Button (with Slider)
  • Settings Button (used to change playback speed)
  • Full Screen Button
  • Controls and Mouse cursor hide automatically after 4s after mouse movement stops during playback

Implemented Animations and Visual Effects

  • Progress Bar expands vertically on hover
  • Volume slider expands horizontally on hover
  • Control buttons increase in size on full-screen
  • Brief pause / play feedback icon transition is shown in the center of the video
  • Playback of timeline red bar is smoothed using requestAnimationFrame instead of video "timeupdate" event
  • A preview of the peeked time is shown for the timeline as well, using a gray bar behind the main red one
  • A dark backdrop is enabled when dragging the timeline thumb (i.e. when manually changing the current time position)

Future Improvements

  • Add Tooltips
  • Add Jest unit testing
  • Add ESLint best-practice rules including security

Available Scripts

In the project directory, you can run:

yarn start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

yarn build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

Note

This project was bootstrapped with Create React App.

About

HTML5 custom video player

License:MIT License


Languages

Language:TypeScript 91.4%Language:HTML 8.6%