Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cdnbye to readme #1122

Merged
merged 5 commits into from
Dec 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ Feel free to submit yours in [`Let me know!`](https://github.com/MoePlayer/DPlay
### Other

- [DPlayer-Lite](https://github.com/kn007/DPlayer-Lite): lite version
- [hlsjs-p2p-engine](https://github.com/cdnbye/hlsjs-p2p-engine)
- [hlsjs-p2p-engine](https://github.com/cdnbye/hlsjs-p2p-engine): Let your viewers become your unlimitedly scalable CDN
- [CBPlayer](https://github.com/cdnbye/CBPlayer): Dplayer with CDNBye P2P plugin built in, supporting HLS, MP4 and MPEG-DASH P2P streaming.
- Feel free to submit yours in [`Let me know!`](https://github.com/MoePlayer/DPlayer/issues/31)

## Who use DPlayer?
Expand Down
28 changes: 19 additions & 9 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -703,24 +703,34 @@ DPlayer can work with any MSE library via `customType` option.

```html
<div id="dplayer"></div>
<script src="pearplayer.js"></script>
<script src="https://cdn.jsdelivr.net/npm/cdnbye@latest"></script>
<script src="DPlayer.min.js"></script>
```

```js
var type = 'normal';
if(Hls.isSupported() && Hls.WEBRTC_SUPPORT) {
type = 'customHls';
}
const dp = new DPlayer({
container: document.getElementById('dplayer'),
video: {
url: 'https://qq.webrtc.win/tv/Pear-Demo-Yosemite_National_Park.mp4',
type: 'pearplayer',
url: 'demo.m3u8',
type: type,
customType: {
pearplayer: function (video, player) {
new PearPlayer(video, {
src: video.src,
autoplay: player.options.autoplay,
'customHls': function (video, player) {
const hls = new Hls({
debug: false,
// Other hlsjsConfig options provided by hls.js
p2pConfig: {
live: false,
// Other p2pConfig options provided by CDNBye http://www.cdnbye.com/en/
}
});
},
},
hls.loadSource(video.src);
hls.attachMedia(video);
}
}
},
});
```
Expand Down
30 changes: 20 additions & 10 deletions docs/zh/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -683,28 +683,38 @@ const dp = new DPlayer({

### 配合其他 MSE 库使用

DPlayer 可以通过 `customType` 参数与任何 MSE 库一起使用
DPlayer 可以通过 `customType` 参数与任何 MSE 库一起使用,例如支持P2P插件:

```html
<div id="dplayer"></div>
<script src="pearplayer.js"></script>
<script src="https://cdn.jsdelivr.net/npm/cdnbye@latest"></script>
<script src="DPlayer.min.js"></script>
```

```js
var type = 'normal';
if(Hls.isSupported() && Hls.WEBRTC_SUPPORT) {
type = 'customHls';
}
const dp = new DPlayer({
container: document.getElementById('dplayer'),
video: {
url: 'https://qq.webrtc.win/tv/Pear-Demo-Yosemite_National_Park.mp4',
type: 'pearplayer',
url: 'demo.m3u8',
type: type,
customType: {
pearplayer: function (video, player) {
new PearPlayer(video, {
src: video.src,
autoplay: player.options.autoplay,
'customHls': function (video, player) {
const hls = new Hls({
debug: false,
// Other hlsjsConfig options provided by hls.js
p2pConfig: {
live: false, // 如果是直播设为true
// Other p2pConfig options provided by CDNBye http://www.cdnbye.com/cn/
}
});
},
},
hls.loadSource(video.src);
hls.attachMedia(video);
}
}
},
});
```
Expand Down