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-video-play

v2.0.3

Published

React video player for TypeScript and JavaScript like youtube

Downloads

118

Readme

react-video-play

React video player for TypeScript and JavaScript like youtube

react-video-play

Demo react-video-play

How to install

npm i react-video-play --save

How to import

For TypeScript usage there is an index.d.ts in node_modules folder

import {ReactVideoPlay, VideoSourceType} from 'react-video-play';

or

var ReactVideoPlay =  require('react-video-play');
var VideoSourceType =  require('react-video-play').VideoSourceType;

How to use

CSS

Use css and images. There is a public folder in node_modules/react-video-play

node_modules/react-video-play/public/css/react-video-play.css

TSX / JSX

    <ReactVideoPlay
        sources={src}
        poster="http://lorempixel.com/900/450/people/"
        advComponent={<UIVideoAdvTest/>}
        enableSlider={true}
        sliderSlides={slides}
        autoplay={true}
        muted={true}
    />

Options

  • sources (Source[], required) - video source's interfaces for TypeScript implementations
    interface Source {
    	name: string,
    	default?: boolean,
    	source: VideoSource[]
    }

    enum VideoSourceType{
        video_mp4,
        video_webm,
        video_ogg
    }

    interface VideoSource {
        source: string,
        type: VideoSourceType,
        codecs?: string
    }

Source example

    import {VideoSourceType} from 'react-video-play';
    // or const VideoSourceType =  require('react-video-play').VideoSourceType;

    let src = [
        {
            name: '1080p',
            source: [{
                source: 'http://easyhtml5video.com/assets/video/new/Penguins_of_Madagascar.mp4',
                type: VideoSourceType.video_mp4
            }, {
                source: 'http://easyhtml5video.com/assets/video/new/Penguins_of_Madagascar.webm',
                type: VideoSourceType.video_webm
            }, {
                source: 'http://easyhtml5video.com/assets/video/new/Penguins_of_Madagascar.ogv',
                type: VideoSourceType.video_ogg
            }]
        }, {
            name: '720p',
            default: true,
            source: [{
                source: 'http://easyhtml5video.com/assets/video/new/Penguins_of_Madagascar.mp4',
                type: VideoSourceType.video_mp4
            }, {
                source: 'http://easyhtml5video.com/assets/video/new/Penguins_of_Madagascar.webm',
                type: VideoSourceType.video_webm
            }, {
                source: 'http://easyhtml5video.com/assets/video/new/Penguins_of_Madagascar.ogv',
                type: VideoSourceType.video_ogg
            }, {
                source: 'http://easyhtml5video.com/assets/video/new/Penguins_of_Madagascar.m4v',
                type: VideoSourceType.video_mp4
            }]
         }
    ];
  • enableSlider (boolean, default: false) - enable preview slider
  • hideSliderInMobile (boolean, default: true) - hide slider in mobile devices
  • sliderSlides (VideoSliderSlide[], required if enableSlider installed true) - slides
    interface VideoSliderSlide {
    	img: string,
    	link: string
    }

sliderSlides example

    slides: [
        {
            img: "http://lorempixel.com/100/75/people/",
            link: "http://video.egorov.pw",
        },
        {
            img: "http://lorempixel.com/100/75/city/",
            link: "http://video.egorov.pw",
        }
    ]
  • enableAdv (boolean, default: true) - enable ADV, it will be shown whenever player pause
  • advComponent (JSX.Element, required if enableAdv installed true) - React component for ADV
  • poster (string, default: none) - show preview video image
  • width (number, default: none) - video container width
  • height (number, default: none) - video container height
  • controls (boolean, default: true) - controls
  • autoplay (boolean, default: false) - autoplay video after start
  • muted (boolean, default: false) - muted by default
  • showSourceName (boolean, default: false) - prefer source name to HQ icon
  • ambiLight (boolean, default: false) - switch on Philips ambilight
  • loaderColor (string, default: "#fff") - default loader color

For development

just use:

$ yarn or $ npm i
$ npm run dev

open your browser http://localhost:3000

For Build

$ npm run production