Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

swarmcloud-hls-sw

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swarmcloud-hls-sw - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

7

demo/sw.js

@@ -1,6 +0,7 @@

// self.importScripts('https://cdn.jsdelivr.net/npm/swarmcloud-hls-sw@latest/dist/hls-proxy.js')
self.importScripts('../dist/hls-proxy.js')
self.importScripts('https://cdn.jsdelivr.net/npm/swarmcloud-hls-sw@latest/dist/hls-proxy.js')
const proxy = new HlsProxy({
// logLevel: 'debug',
// mediaFileLoadTimeout: 4500, // ms
// logLevel: 'error',
// hlsMediaFiles: ['ts', 'mp4', 'm4s'],
});

@@ -7,0 +8,0 @@

{
"name": "swarmcloud-hls-sw",
"version": "0.1.0",
"version": "0.1.1",
"description": "Let your viewers become your unlimitedly scalable CDN.",
"main": "./dist/ios-p2p-engine.min.js",
"scripts": {
"git-push": "git add demo && git add package.json && git add README.md && git add Readme_zh.md && git commit -m 'release 0.1.0' && git push origin master",
"git-push": "git add demo && git add package.json && git add README.md && git add Readme_zh.md && git commit -m 'release 0.1.1' && git push -u origin main",
"git-pull": "git pull origin master",

@@ -9,0 +9,0 @@ "publish": "npm publish"

@@ -9,1 +9,27 @@ **[English](README.md) | 简体中文**

</p>
iOS的Safari浏览器虽然可以支持原生播放HLS,但整个过程对开发者是透明的。Safari从2017年起就支持 WebRTC,但到目前为止还不支持 MEDIA SOURCE EXTENSIONS,而这个API对实现客户端P2P至关重要。
幸运的是,我们可以通过另一种方式来实现对HTTP流量的本地代理,从而间接实现P2P功能,这个用于实现本地代理的技术就是"ServiceWorkers",本项目基于ServiceWorkers和WebRTC在Safari浏览器实现了HLS的P2P能力。
## 浏览器支持情况
由于WebRTC已成为HTML5标准,目前大部分主流浏览器都已经支持。CDNBye的浏览器兼容性取决于WebRTC和hls.js。需要注意的是iOS版Safari由于不支持MediaSource API,因此也不支持hls.js(不过Safari原生支持HLS播放)。
兼容性|Chrome | Firefox | macOS Safari| Opera | Edge | iOS Safari | IE |
:-: | :-: | :-: | :-: | :-: | :-:| :-:| :-:
WebRTC Datachannel | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ❌ |
Service Worker | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ❌ |
SwarmCloud | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ❌ |
## 使用方法
请参考[在线文档](https://swarmcloud.net/cn/views/ios-web/usage.html)
## 相关项目
- [hlsjs-p2p-engine](https://gitee.com/cdnbye/hlsjs-p2p-engine) - HLS协议的Web端P2P流媒体方案。
- [dashjs-p2p-engine](https://github.com/cdnbye/dashjs-p2p-engine) - MPEG-dash协议的Web端P2P流媒体方案。
## FAQ
我们收集了一些[常见问题](https://www.cdnbye.com/cn/views/FAQ.html)。在报告issue之前请先查看一下。
## 联系我们
邮箱:service@cdnbye.com

@@ -9,1 +9,31 @@ **English | [简体中文](Readme_zh.md)**

</p>
What has been the actual problem with iOS and Safari? Of course, Safari can also play an HLS stream. But the whole thing happens under the hood. WebRTC has been supported by iOS and Safari since 2017, but MEDIA SOURCE EXTENSIONS still cannot be used. These extensions are indispensable for integrating the P2P client of browser-based eCDN solutions.
Without the MEDIA SOURCE EXTENSIONS, it appears that no user data can be intercepted at the XHR object or the fetch API, and creating a cluster for peer-to-peer streaming is almost impossible. Luckily there is another way to intercept HTTP traffic while streaming on an iOS device. Even if iOS restricts the possibilities to make adjustments in the browser’s background to make it perfectly cooperating with your own coding and software, there is a way iOS allows developers to insert some web applications inside of Safari. This standard is called “ServiceWorker”. With these ServiceWorkers, you can implement your own software inside of your browser. The ServiceWorkers only give limited freedom, but it’s enough to make a P2P mesh network possible.
## Browser Support
WebRTC has already been incorporated into the HTML5 standard and it is broadly deployed in modern browsers. The compatibility of SwarmCloud depends on the browser support of WebRTC and Service Worker.
Compatibility|Chrome | Firefox | macOS Safari | Opera | Edge | iOS Safari | IE |
:-: | :-: | :-: | :-: | :-: | :-:| :-:| :-:
WebRTC Datachannel | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ❌ |
Service Worker | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ❌ |
SwarmCloud | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ❌ |
## Usage
Please see [documentation](https://swarmcloud.net/en/views/ios-web/usage.html)
## Related Projects
- [hlsjs-p2p-engine](https://github.com/cdnbye/hlsjs-p2p-engine) - Web Video Delivery Technology with No Plugins for hls.js.
- [dashjs-p2p-engine](https://github.com/cdnbye/dashjs-p2p-engine) - Web Video Delivery Technology with No Plugins for MPEG-dash.
## FAQ
We have collected some [frequently asked questions](https://www.hdtvcloud.com/en/views/FAQ.html). Before reporting an issue, please search if the FAQ has the answer to your problem.
## Contact Us
Email: service@cdnbye.com
<br>
Telegram: @cdnbye
<br>
Skype: live:86755838

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc