1 Star 1 Fork 172

野生程序员 / PearPlayer.js

forked from Pear / PearPlayer.js 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
README_EN.md 6.78 KB
一键复制 编辑 原始数据 按行查看 历史
gooni 提交于 2018-08-03 13:30 . update readme_en


PearPlayer.js

A multi-protocol, multi-source and hybrid P2P-CDN streaming media player

. npm jsdelivr License


English

PearPlayer (梨享播放器) [Demo] is a streaming media player framework written completely with HTML5 and JavaScript. Combining HTTP (including HTTPS, HTTP2) and WebRTC, PearPlayer accelerates media streaming on the Web. It supports multiple protocols, multiple sources, and achieves low latency and high bandwidth utilization. With the help of H5 MSE (Media Source Extension) technology, it receives buffers from multiple source nodes and delivers to the player. Finely designed algorithms are adopted to achieve the best scheduling effect and to handle abnormal situations. Thus, PearPlayer can provide end-users with wonderful video watching experience while maximizing the P2P ratio at the same time.

PearPlayer

multisources

Simply import pear-player.min.js to HTML via the <script> tag. Refer to code examples below, or consult /examples/player-test.html or get-started for usages.

Features

  • Plugin-free thanks to the P2P ability based on WebRTC
  • Multi-protocol (HTTP, HTTPS, WebRTC) and multi-source
  • Customized algorithms that provide users with wonderful video watching experience while maximizing the P2P ratio at the same time.
  • Parameter-free by default (dynamic adaptive internally according to bitrate, etc.). Clients can fill in their preferred parameters in advanced mode.
  • Buffers are limited to save bandwidth/traffic for CP users.
  • Support Chrome, Firefox, Opera, IE, Edge and other mainstream browsers; will support Safari, Tencent WeChat and X5/TBS (multi-source transmission is enabled; media playback issues will be well resolved when MSE is supported)
  • Optional access to low cost, high availability Pear Fog CDN
  • Fully encrypted via TLS/DTLS by default, no DPI features; statistical characteristics can be further eliminated using dynamic port mapping of Pear Fog Suite.
  • As easy as using HTML5 <video> tag; easy to integrate with popular player frameworks like video.js
  • With Browser-to-Browser P2P ability (based on WebTorrent)

bitmap

Quick Start

Please copy the following codes into Web HTML5 code, and then open the webpage. Now, it's time to witness the miracle.

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

Usages

Import js file and bind to video tag

First import the <script> tag to pear-player.min.js:

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

or use CDN:

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

If use video tag to play the following video, HTML is like below:

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

PearPlayer can be bound to the video tag using only the codes below:

<script>
  /**
  * The first parameter is ID or CLASS of the video tag
  * Opts means the optional parameter configurations
  */
  if (PearPlayer.isMSESupported()) {
    var player = new PearPlayer('#pearvideo', opts);
  }
</script>

Congratulations! NOW your player has P2P ability and no plug-ins!

How to accelerate your videos?

The video above has already been dispatched. So how to speed up other videos? Just add your video URL into Pear Fog Content Delivery Operating System. And then you can feel free to use Pear's massive fog nodes to accelerate your videos! Please click here for detailed guide. (Currently, newly-registered users can distribute three MP4/TS files, each under 100MB, free of charge. Prefix Pear-Demo- prefix needs to be added in front of the video file name, such as Pear-Demo-movie.mp4)

Who's using PearPlayer today?

PearPlayer Documents

Acknowledgement

Special thanks goes to the following projects that provide some inspirations and API design references:

Speech and Media Reports

License

MIT. Copyright (c) Pear Limited and snowinszu.

Help and Support

E-mail: service@pear.hk; User QQ group:373594967; CP/CDN, OEM and other business cooperations

JavaScript
1
https://gitee.com/fykyx521/PearPlayer.js.git
git@gitee.com:fykyx521/PearPlayer.js.git
fykyx521
PearPlayer.js
PearPlayer.js
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891