npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-simple-video-player

v1.0.0

Published

A simple, material design video player component for React

Downloads

58

Readme

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

Prop | Description | default ---- | ----------- | ------- url*| Url of the video file to play | poster | Url of the image to use as poster for the video | width | Width of the video player | 640 height | Height of the video player | 360 autosize | If 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 height | false autoplay | If set to true, the video will automatically play | false loop | If set to true, the video will loop | false aspectRatio | The 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.