swarmcloud-hls-sw
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
8
39
1
25472
12