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 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-h5-video

v1.0.4

Published

html5 video component for react.js app

Readme

[WIP] don't use in production

preview demo

##features:

  • simple & easy
  • custom video overlay content( any html content on top of video )

##TODO

  • UI for Fullscreen mode
  • ~~subtitle tracks~~
  • network error notification
  • loading spinner
  • custom menu for mouse right click
  • register any event listener on parent component
  • playback rate change
  • select defferient resulution
  • use without browserify
  • complete tests

##install

npm install --save react-h5-video

load in the stylesheet,(in order to make it easier for developers to customize video player's style, css is not written in js)

<link rel="stylesheet" type="text/css" href="node_modules/react-h5-video/lib/react-h5-video.css">

basic usage

import React from "react";
import Video from "react-h5-video";

class MyAewsomeApp extends React.Component{
	render(){
		var sources = [ "./video/video.mp4","./video/video.webm","./video/video.ogv" ]
		return(
			<Video sources={sources} poster="./video/poster.png" >
				<h3 className="video-logo pull-right"><a href="http://glexe.com" target="_blank">LOGO</a></h3>
				<p>Any HTML content</p>
			</Video>
		)
	}
}

##props

Video.propTypes = {
	metaDataLoaded: 		React.PropTypes.func,// video's meta data loaded callback
	

	// properties
	sources:		React.PropTypes.array,
	subtitles:		React.PropTypes.array, // [{src:"foo.vtt", label:"English",lang:"en" }]
	autoPlay: 		React.PropTypes.bool,
	controls:		React.PropTypes.bool,
	autoHideControls:		React.PropTypes.bool,
	controlPanelStyle:		React.PropTypes.oneOf(["overlay","fixed"]),
	preload:		React.PropTypes.oneOf(["auto","none","metadata"]), 
	loop:		React.PropTypes.bool,
	mute:		React.PropTypes.bool,
	poster:		React.PropTypes.string,
	width:		React.PropTypes.string,
	height:		React.PropTypes.string,
	volume:		React.PropTypes.number,
	seekDisabled: React.PropTypes.bool,
}
// here are all some default props
Video.defaultProps = {
	autoPlay:		false,
	loop:		false,
	controls:		true,
	autoHideControls:		true,
	volume:		1.0,
	mute:		false,
	controlPanelStyle:		"overlay",
	preload:		"auto",
	seekDisabled: false,
}

###video meta data loaded callback onece the meta data is loaded, you can get the info of this video(width,height,duration...etc), then you can use the returnd api to perform basic actions

The returned api has these properties:

class App extends React.Component{
	loaded(api){
		this.videoApi = api;
		// console.log( api.$video.duration ) 
		// to toggle play state, just call this.videoApi.togglePlay()
	}
	render(){
		return(
			<Video sources={sources}  metaDataLoaded={this.loaded}/>
		)
	}
}

registerProgressEventListener

class App extends React.Component{
	loaded(api){
		api.registerProgressEventListener((percent) => {
			console.log("Video has now played ", percent, " percent")
		})
	}
	render(){
		return(
			<Video sources={sources}  metaDataLoaded={this.loaded}/>
		)
	}
}