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

pearplayer

v2.5.10

Published

<h1 align="center"> <img src="fig/pear.png" height="110"></img> <br> <a href="https://demo.webrtc.win/player">PearPlayer.js</a> <br> <br> </h1>

Downloads

18

Readme

English

PearPlayer(梨享播放器)[Demo] 是完全用JavaScript写的开源HTML5流媒体播放框架,实现了融合HTTP(含HTTPS、HTTP2)和WebRTC的多协议、多源、低延迟、高带宽利用率的无插件Web客户端流媒体加速能力。基于H5的MSE(Media Source Extension)技术将来自多个源节点的Buffer分块喂给播放器,再加上精心设计的算法可实现最优的调度策略及对各种异常情况的处理,PearPlayer由此能在保证用户流畅视频体验的前提下最大化P2P率。

PearPlayer multisources

通过<script>标签将pear-player.min.js导入到HTML即可使用。参考以下代码示例,也可查看/examples/player-test.htmlget-started了解使用方法。

特性

  • P2P能力基于WebRTC,无须安装任何插件
  • 多协议(HTTP、HTTPS、WebRTC)、多源
  • 自研的调度算法,在保证用户流畅视频体验的前提下最大化P2P率
  • 默认无需填参数(内部根据视频码率等作自适应),高级使用模式下可自行调整算法和参数
  • 默认不会无限制缓冲,尽可能为CP用户节省带宽/流量
  • 支持Chrome、Firefox、Opera、IE、Edge等主流浏览器,即将支持Safari、腾讯微信、X5/TBS(可多源传输,播放问题待不久后由MSE支持完善)
  • 可选接入低成本、高可用的Pear Fog CDN
  • 协议默认通过TLS/DTLS全加密,无DPI特征;并可通过Pear Fog组件的动态端口映射进一步消除统计学特征
  • 像使用HTML5 <video>标签一样简单,并易与video.js等流行播放框架集成
  • 具备Browser P2P能力(基于WebTorrent)

bitmap

快速开始

将以下代码拷贝到HTML5代码中,打开网页,见证奇迹的时刻到了!

<script src="https://cdn.jsdelivr.net/npm/pearplayer@latest"></script>
<video id="video" controls></video>
<script>
  var player = new PearPlayer('#video', { src: 'https://qq.webrtc.win/tv/Pear-Demo-Yosemite_National_Park.mp4' });
</script>

使用方法

导入js文件并绑定video标签

首先通过script标签导入pear-player.min.js:

<script src="./dist/pear-player.min.js"></script>

或使用CDN:

<script src="https://cdn.jsdelivr.net/npm/pearplayer@latest"></script>

假设用video标签播放以下视频,HTML如下:

<video id="pearvideo" src="https://qq.webrtc.win/tv/Pear-Demo-Yosemite_National_Park.mp4" controls>

只需以下几行代码,即可将PearPlayer绑定到video标签:

<script>
  /**
  * 第一个参数为video标签的id或class
  * opts是可选的参数配置
  */
  if (PearPlayer.isMSESupported()) {
    var player = new PearPlayer('#pearvideo', opts);
  }
</script>

恭喜您,您的播放器已经具备P2P能力了,而且无须任何插件!

如何为自己的视频加速?

示例中的视频是已经分发过的,那么如何为任意视频加速呢?很简单,只需在视频分发系统中添加您的视频URL,即可利用Pear的海量节点为您的视频加速!具体教程请点击这里(目前新注册用户可以免费分发3个大小不超过100MB的MP4或TS格式的文件,视频名字需添加Pear-Demo前缀,如Pear-Demo-movie.mp4

谁在使用我们的产品?

PearPlayer 文档

致谢

特别感谢以下项目,为本项目提供了部分灵感以及API设计参考:

演讲与媒体报道

License

MIT. Copyright (c) Pear Limited

帮助与支持

E-mail: [email protected];用户QQ群:373594967CP/CDN接入、OEM与其他商务合作