New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-simple-video-player

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-simple-video-player

A simple, material design video player component for React

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
9
-57.14%
Maintainers
1
Weekly downloads
 
Created
Source

react-simple-video-player

A simple, material design video player component for React.

Video player screenshot

Install

yarn add react-simple-video-player or npm install --save react-simple-video-player

Usage

Basic example

import VideoPlayer from 'react-simple-video-player';

const App = () => (
  <VideoPlayer url="/video.mp4" />
);

Advanced example

import VideoPlayer from 'react-simple-video-player';

const App = () => (
  <VideoPlayer
    url="/video.mp4"
    poster="/myPoster.png"
    width={400}
    height={300}
    autoplay
  />
);

Props

* = Required

PropDescriptiondefault
url*Url of the video file to play
posterUrl of the image to use as poster for the video
widthWidth of the video player640
heightHeight of the video player360
autosizeIf set to true, the video player will become 100% of the parent width and 100% of the parent height (if the parent does not have a height, the video player will automatically become the right height). autosize overrides the given width and heightfalse
autoplayIf set to true, the video will automatically playfalse
loopIf set to true, the video will loopfalse
aspectRatioThe aspect ratio of the video (see explanation below).16:9

Usage of the aspectRatio prop

The aspectRatio prop can be used to automatically give the video player the correct height for the given width (or the correct width for the given height).

For example, in the following scenario:

<VideoPlayer url="/video.mp4" width={400} aspectRatio="4:3" />

the video player would automatically become 300px high.

In the following scenario:

<VideoPlayer url="/video.mp4" height={300} aspectRatio="4:3" />

the video player would automatically become 400px wide.

In the following scenario:

<VideoPlayer url="/video.mp4" aspectRatio="4:3" />

the video player would automatically become 480px high (since the width defaults to 640px).

Notice that when an invalid aspectRatio is given, it'll be ignored.

Notes

react-simple-video-player is built on top of react-player.

This project does not aim to provide a customisable video player.

Please use react-player when you need customisability.

Keywords

video player

FAQs

Package last updated on 03 Feb 2018

Did you know?

Socket

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.

Install

Related posts