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

media-player-lite

v1.0.2

Published

Stabler and Lighter

Downloads

22

Readme

media-player-lite

A video/audio player for your web page based on xgplayer.

Install

npm install media-player-lite

Usage

There are two functions provided to create a MediaPlayer:

import { initPlayer } from 'media-player-lite'

const player = initPlayer(e, urlList, width, height, poster='')
player.play()

Parameters

  • e: the selector (Object, required)
  • urlList: the playlist (Array, required)
  • width: width of the player (Number, required)
  • height: height of the player (Number, required)
  • poster: the poster url of the video player (String, default='')

Alternatively, one can use this

import { initPlayerConfig } from 'media-player-lite'

const player = initPlayerConfig(e, urlList, config)
player.play()

where the user-defined config is effective over the default ones.

Parameters

  • e: the selector (Object, required)
  • urlList: the playlist (Array, required)
  • config: the configuration (Object, default={})

Plugins

What is here?

A lot of default plugins are removed. The ones that we kept are:

  • controls
  • definition
  • enter
  • error
  • loading
  • pc
  • play
  • poster
  • progress
  • replay
  • start
  • volume
  • progresspreview

Besides the ones that we inherited from xgplayer, these are the ones that are completely new:

  • faster: To play the video at 2x speed or to reset the speed to 1x when you click on it again.
  • slower: To play the video at 0.5x speed or to reset the speed to 1x when you click on it again.
  • play after: This seems to be very similar to what xgplayer have: playNext. However, we are using a very different way to implement this. The playlist is no longer a configuration but an element of MediaPlayer. The first element in the playlist is the one that gets to play first. There is also an indexer to record which video/url is playing right now, and what is before/after it. When you reach to the last video in the list, it refreshes the current video.
  • play before: To play the video before on the playlist. When you are playing the first video in the list, it refreshes the current video.

What if I want more?

As always, like what xgplayer believes, you can always customize your own plugin or modify what we have right now. However, if you do need many other functionalities, maybe it will be easier for you to look up other packages than adding them manually.

License

MIT license