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 🙏

© 2025 – Pkg Stats / Ryan Hefner

widro-player

v1.1.3

Published

A nice video player

Readme

Setup

Create the Video


You can create the video tag in this way:

<video id="testVideo" src="https://www.youtube.com/watch?v=L-bV7f7GC1I" width="500px" height="600px"></video>
  • The id attribute will be used to transform the video tag in a Widro player
  • The src attribute is used to set the video to play (can also be a link to a YouTube video)
  • Set width and height if you want, Widro will use them

Import Widro


You can import Widro's source files from an hosted link or by copying the widro.js file in your project folder. For example:

<!-- Import Widro from hosted link -->
<script src="https://widro.netlify.com/dist/widro.js"></script>

<!-- Import Widro from a file in your project -->
<script src="./path/widro.js"></script>

Use Widro


Instantiate the Widro class by doing this:

const player = new Widro("#testVideo");

Where #testVideo is the selector to the video tag element

Import css files


The last step is to import the Widro's css files for styling the player. Also here, like how you imported the widro source file you can use to methods, using an hosted link or by copying the css files in your project folder.

<!-- Import css files from hosted link -->
<link rel="stylesheet" href="https://widro.netlify.com/dist/widro.css"></link>
<link rel="stylesheet" href="https://widro.netlify.com/dist/themes/default/default-theme.css"></link>

<!-- Import Widro from a file in your project -->
<link rel="stylesheet" href="./path/widro.css"></link>
<link rel="stylesheet" href="./path/default-theme.css"></link>

Extra setup

Node.js


You can also use Widro with Node.js, it's easy to load Widro with:

npm install widro

React


Not released yet, but it's under development a React component for the Widro player.

Examples

If you want to see how Widro look like you can find a Demo here, or you can copy this example below and test it yourself:

<html>
	<head>
		<title>Widro test</title>

		<!-- Include Widro source file -->
		<script src="https://widro.netlify.com/dist/widro.js"></script>

		<!-- Include Widro css file -->
		<link rel="stylesheet" href="https://widro.netlify.com/dist/widro.css"></link>
		<link rel="stylesheet" href="https://widro.netlify.com/dist/themes/default/default-theme.css"></link>

		<script>
			// Wait until the content of the page is loaded
			document.addEventListener("DOMContentLoaded", () => {
				// Create the Widro player
				const player = new Widro("#testVideo");
			});
		</script>
	</head>
	<body>
		<video id="testVideo" src="http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_60fps_normal.mp4" width="500px" height="600px">
	</body>
</html>

Methods

List of the methods you can use on the Widro player:

| Method | Parameters | Description | | ------------------------------- | :------------------------------------------------------------------------------------------------------------------ | ----------- | | changeVideo(src) | - src: the source of the new video | | | togglePlay() | | | | toggleFullScreen() | | | | toggleMute() | | | | isFullScreen() | | | | requestFullScreen() | | | | exitFullScreen() | | | | on(event, callback) | - event: the event to listen- callback: the function to call when the event is fired | | | once(event, callback) | - event: the event to listen- callback: the function to call when the event is fired | | | off(event, callback) | - event: the event to remove- callback: the function to remove | | | onKey(key, callback, options) | - key: the key to listen- callback: the function to call when the key is pressed/released- options: - | | | isMuted() | | | | getCurrentTime() | | | | getDuration() | | | | getVolume() | | | | setVolume() | | | | seek(time) | - time: the time to set | | | isYouTube() | | | | isHTML5() | | | | isReady() | | | | isPlaying() | | | | getBufferingTime() | | |

About Widro

Build with

  • Native Javascript ES6
  • Native CSS

License

MIT license