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

jtest-npm-me-plugins

v1.0.6

Published

## 概述

Downloads

34

Readme

Mediaelement 插件

概述

Mediaelement插件是基于Mediaelement播放器的定制化插件,功能涵盖内容插入(视频广告、HTML页面、进度标记等)、播放控制(倍速、跳过、循环、停止等)、辅助功能和一些其他实用功能(清晰度、播放源切换、预览、画中画、投屏等)。

体验demo

安装

下载并引入主播放器和特性插件js文件,特性插件文件需放在主播放器文件mediaelement-and-player.min.js之后引入:

<!-- 引入播放器文件 -->
<script src="/path/to/mediaelement-and-player.min.js"></script>
<!-- 按需引入插件文件,以snapshot插件为例 -->
<script src="/path/to/snapshot/snapshot.min.js"></script>
<!-- 如果需要国际化,引入插件国际化相关文件,默认为中文时不需要引入 -->
<script src="/path/to/snapshot/snapshot-i18n.js"></script>

分别引入主播放器和特性插件的css样式表


<!-- 引入主播放器样式表 -->
<link rel="stylesheet" href="/path/to/mediaelementplayer.min.css">
<!-- 引入插件样式表 -->
<link rel="stylesheet" href="/path/to/snapshot/snapshot.min.css">

使用

初始化播放器:new MediaElementPlayer(mediaEl,options)mediaEl为视频/音频元素,options为配置项,包含播放器配置、插件及其API配置,options对象中包含features属性用于配置播放器的功能插件列表,与插件的关键字对应。(features配置的排序会影响功能按钮在播放器控制区内的排列顺序)


var player = new MediaElementPlayer(document.querySelector('video'), {

  features:['play', 'playpause', 'volume', 'progress', 'snapshot', 'fullscreen'],

  snapType:'jpeg',
  snapQuality: 0.5,
  snapShot: true,
      
  snapSuccess: function(snap){
    console.log(snap.url);
  },

  snapError: function(){
    console.log('you can not take snapshot while the player loading!');
  }
       
 });

插件

辅助功能/a11y

广告/ads

隔空播放/airplay

上下文菜单/contextmenu

循环/loop

进度标记/markers

进度插入HTML/markersrolls

画中画/pictureinpicture

播放列表/playlist

插入HTML/postroll

预览/preview

清晰度/quality

跳过/jumpforward

回跳/skipback

截图/snapshot

播放源选择/sourcechooser

倍速/speed

停止/stop

弹幕/barrage

播放控制/playcontrolpanel