{"id":15724208,"url":"https://github.com/augok/p2p-hls","last_synced_at":"2025-08-09T19:12:20.315Z","repository":{"id":65965942,"uuid":"602451773","full_name":"augok/p2p-hls","owner":"augok","description":"A JavaScript library based on hls.js to implement video traffic delivery over P2P streaming in web browsers HTML page.","archived":false,"fork":false,"pushed_at":"2024-09-27T08:15:40.000Z","size":417,"stargazers_count":17,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-28T22:06:19.298Z","etag":null,"topics":["dplayer","hls","hlsjs","p2p","p2p-network","video","web","webp2p","webrtc"],"latest_commit_sha":null,"homepage":"https://webp2p.augok.com/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/augok.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-16T08:37:07.000Z","updated_at":"2025-05-31T17:34:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"2d7ed9c3-09a3-4d7f-82ff-72a3d44118f5","html_url":"https://github.com/augok/p2p-hls","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/augok/p2p-hls","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/augok%2Fp2p-hls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/augok%2Fp2p-hls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/augok%2Fp2p-hls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/augok%2Fp2p-hls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/augok","download_url":"https://codeload.github.com/augok/p2p-hls/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/augok%2Fp2p-hls/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269623863,"owners_count":24448911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dplayer","hls","hlsjs","p2p","p2p-network","video","web","webp2p","webrtc"],"created_at":"2024-10-03T22:15:32.443Z","updated_at":"2025-08-09T19:12:18.799Z","avatar_url":"https://github.com/augok.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# P2P-hls\r\n\r\n**P2P hls** is a JavaScript library based on hls.js to implement video traffic delivery over P2P in web browsers.\r\n\r\nIt 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.\r\n\r\nPowered by hls.js, it can play HLS on any platform with many popular HTML5 players.\r\n\r\nIt significantly reduces traditional CDN traffic and cost while delivering video streams to more users.\r\n\r\n**Save Your Bandwidth using WebRTC.**\r\n\r\n## Useful Demo\r\n\r\n- [Demo](https://webp2p.augok.com/p2pdemo/)\r\n\r\n**Homepage**\r\n\r\nhttps://webp2p.augok.com\r\n\r\n**Free!! Use directly!**\r\n\r\nProblems caused by CDN have been fixed!!!\r\n\r\nhttps://webp2p.augok.com/player/?url=\r\n\r\n**Example**\r\n\r\nhttps://webp2p.augok.com/p2pdemo/?url=https://m3u8.link.address/video.m3u8\r\n\r\n\r\n## Quick Start\r\n\r\nProject upgrade uses module loading.\r\n\r\nSupport the latest version of hls.js.\r\n\r\nThen there's a free, CDN hosted version of hls.js that anyone can use. Add these tags to your document's `\u003chead\u003e`:\r\n\r\n```html\r\n\u003cscript src=\"https://unpkg.com/hls.js@1.5.15/dist/hls.min.js\"\u003e\u003c/script\u003e\r\n```\r\n\r\n## Example by DPlayer\r\n\r\n```html\r\n\u003cscript src=\"https://unpkg.com/hls.js@1.5.15/dist/hls.min.js\"\u003e\u003c/script\u003e\r\n\u003c!-- unpkg : use the latest version of DPlayer.js --\u003e\r\n\u003cscript src=\"https://unpkg.com/dplayer/dist/DPlayer.min.js\"\u003e\u003c/script\u003e\r\n```\r\n\r\n```js\r\nimport { P2Phls } from \"https://unpkg.com/webp2p-hls@latest/p2phls.js\";\r\n// url is link address.\r\nvar p2phls = new P2Phls(url);\r\n\r\nvar player = new DPlayer({\r\n    container: document.getElementById('video'),\r\n    autoplay: true,\r\n    preload: 'auto',\r\n    video: {\r\n        url: url,\r\n        type: 'customHls',\r\n        customType: {\r\n            'customHls': function(video, player) {\r\n                var hls = p2phls.getHlsPlayer();\r\n                hls.loadSource(video.src);\r\n                hls.attachMedia(video);\r\n            }\r\n        }\r\n    }\r\n});\r\n```\r\n\r\n## API\r\n\r\n**isHls()**\r\n\r\nDetermine whether to support Hls.\r\n\r\n```js\r\n// p2phls is new P2Phls(url) object\r\np2phls.isHls()\r\n// return true or false\r\n```\r\n\r\n## Event\r\n\r\n**bytechange**\r\n\r\nMonitor traffic download btye.\r\n\r\n```js\r\n// p2phls is new P2Phls(url) object\r\np2phls.on('bytechange', function(data){\r\n    var httpMb = data.http; // http traffic download btyes\r\n    var p2pMb = data.p2p; // p2p traffic download btyes\r\n});\r\n```\r\n\r\n**peers**\r\n\r\nMonitor P2P peers connections.\r\n\r\n```js\r\n// p2phls is new P2Phls(url) object\r\np2phls.on('peers', function(num,peer){\r\n    num; //peers num\r\n    peer; // peer detail object\r\n});\r\n```\r\n\r\n**[See p2pdemo for more...](https://webp2p.augok.com)**\r\n\r\n## Contact Us\r\n\r\nTelegram: @augok009\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faugok%2Fp2p-hls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faugok%2Fp2p-hls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faugok%2Fp2p-hls/lists"}