Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
react-vp
Advanced tools
Readme
A React component for easily playing videos on mobile and desktop devices. Comes with video controls and customization for audio slider and video seekbar to match the theme of your website.
npm install react-vp --save
import React, { Component } from 'react'
import ReactVideoPlayer from 'react-vp'
class App extends Component {
render () {
return <ReactVideoPlayer
className={'video-container'}
mobileClassName={'video-container-mobile'}
videoPath='assets/videos/video.mp4'
videoThumbnail='assets/videos/thumbnail.png'
isMobile={this.props.config.isMobile}
colors={{
audioThumb: 'rgb(0, 125, 255)',
audioSlider: '#ccc',
videoThumb: 'rgb(0, 125, 255)',
seekbarPlayed: 'rgb(0, 125, 255)',
seekbarProgress: '#ccc',
seekbarBackground: 'rgb(58, 61, 80)'
}}
/>
}
}
Demo page: https://mellocloud.com/react-video-player
Prop | Description | Required |
---|---|---|
className | Css class for the video container, this will be applied to the desktop version of the video player. | no |
mobileClassName | Css class for the video container, this will be applied to the mobile version of the video player. | no |
videoPath | Path to the video you want to play. | yes |
videoThumbnail | Path to the video thumbnail. | yes |
isMobile | This is a bool, how you determine if the user is on desktop or mobile is up to you or you can put false if its only for desktop. | yes |
colors | This is an object with colors so you can customize your video player to match your theme. By default its blue and grayish | no |
let offset = seekbar.getBoundingClientRect().left //used to move the seekbar thumb.
CSS modules, how to hash CSS classnames so that they don't interfere with existing CSS classes when bringing this into your project.
npm link, how to test npm packages before releasing them.
Last but not least I learned a ton about videos on the web including Media Events, Fullscreen API, and Media Source Extensions. If you are interested in learning more about video players here is a great tutorial series from Google chrome developers youtube channel https://www.youtube.com/watch?v=--KA2VrPDao&t=8s
FAQs
A React component for easily playing videos on mobile and desktop devices. Comes with video controls and customization for audio slider and video seekbar to match the theme of your website.
The npm package react-vp receives a total of 31 weekly downloads. As such, react-vp popularity was classified as not popular.
We found that react-vp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.