Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A JavaScript library based on hls.js to implement video traffic delivery over P2P streaming in web browsers HTML page.

License

NotificationsYou must be signed in to change notification settings

augok/p2p-hls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

P2P hls is a JavaScript library based on hls.js to implement video traffic delivery over P2P in web browsers.

It allows creating Peer-to-Peer network (also called P2P CDN or P2PTV) for traffic sharing between users (peers) that are watching the same video stream live or VOD over HLS.

Powered by hls.js, it can play HLS on any platform with many popular HTML5 players.

It significantly reduces traditional CDN traffic and cost while delivering video streams to more users.

Save Your Bandwidth using WebRTC.

Useful Demo

Homepage

https://webp2p.augok.com

Free!! Use directly!

Problems caused by CDN have been fixed!!!

https://webp2p.augok.com/player/?url=

Example

https://webp2p.augok.com/p2pdemo/?url=https://m3u8.link.address/video.m3u8

Quick Start

Project upgrade uses module loading.

Support the latest version of hls.js.

Then there's a free, CDN hosted version of hls.js that anyone can use. Add these tags to your document's<head>:

<scriptsrc="https://unpkg.com/hls.js@1.5.15/dist/hls.min.js"></script>

Example by DPlayer

<scriptsrc="https://unpkg.com/hls.js@1.5.15/dist/hls.min.js"></script><!-- unpkg : use the latest version of DPlayer.js --><scriptsrc="https://unpkg.com/dplayer/dist/DPlayer.min.js"></script>
import{P2Phls}from"https://unpkg.com/webp2p-hls@latest/p2phls.js";// url is link address.varp2phls=newP2Phls(url);varplayer=newDPlayer({container:document.getElementById('video'),autoplay:true,preload:'auto',video:{url:url,type:'customHls',customType:{'customHls':function(video,player){varhls=p2phls.getHlsPlayer();hls.loadSource(video.src);hls.attachMedia(video);}}}});

API

isHls()

Determine whether to support Hls.

// p2phls is new P2Phls(url) objectp2phls.isHls()// return true or false

Event

bytechange

Monitor traffic download btye.

// p2phls is new P2Phls(url) objectp2phls.on('bytechange',function(data){varhttpMb=data.http;// http traffic download btyesvarp2pMb=data.p2p;// p2p traffic download btyes});

peers

Monitor P2P peers connections.

// p2phls is new P2Phls(url) objectp2phls.on('peers',function(num,peer){num;//peers numpeer;// peer detail object});

See p2pdemo for more...

Contact Us

Telegram: @augok009

About

A JavaScript library based on hls.js to implement video traffic delivery over P2P streaming in web browsers HTML page.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp