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

@iframe-player/provider

v0.1.6

Published

iframe player provider

Downloads

41

Readme

iframe-player-provider

浏览器支持

IE9+

安装

在浏览器中使用:

<body>

  <!-- 引入源文件 -->
  <script src="path/to/index.iife.min.js"></script>

  <script>
    var player = new IframePlayerProvider({
      // config
    });
  </script>
</body>

使用 npm:

npm install @iframe-player/provide --save

使用 yarn:

yarn add @iframe-player/provide

在 Node.js 中:

// ESModule
import IframePlayerProvider from '@iframe-player/provider';

// CommonJS
var IframePlayerProvider = require('@iframe-player/provider/index.cjs.js');

初始化 & 配置

引入后, 需要初始化 IframePlayerProvider

var player = new IframePlayerProvider(config);

config 是一个必填的 object 对象,具体配置如下:

var config = {
  // video 元素
  $video: $video,

  // 父级页面的window对象
  targetWindow: window.parent,

	// video 元素 controls属性相关规则:
	// 1. 优先取决于配置项:controls=true ,video 增加 controls 属性;controls=false ,video 移除 controls 属性;
	// 2. 其次取决于 url search params:controls=0,移除 controls属性;
	// 3. 不满足以上情况,不做处理。
	controls: true,

  // 利用actions配置,能够覆盖插件原本的行为
  // 这个配置会覆盖 index.ts: playerActions 对象对应的方法
  // 如果没有自定义插件行为的需要,可以忽略这项配置
  actions: {
    getDuration() {
      // 将 getDuration 原本的逻辑复制过来,保证基础的交互行为
      this.postVideoMessage({
        eventType: "reply-get-duration",
        value: { seconds: this.config.$video.duration }
      });
      // 加入你的代码
    }
  }
};

更新日志

2021-09-11

  • 增加对 video 元素 controls 属性的控制支持
  • 优化内部命名