From 1b3be7749aa83c79121eb3d59198c76e076d7c65 Mon Sep 17 00:00:00 2001 From: snowinszu <86755838@qq.com> Date: Tue, 1 Dec 2020 15:22:22 +0800 Subject: [PATCH 1/5] Add CBPlayer --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 68a3e00..d6d0912 100644 --- a/README.md +++ b/README.md @@ -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? From 17568bd4266b9034d463c99bb2622cfa4a1ff66e Mon Sep 17 00:00:00 2001 From: snowinszu <86755838@qq.com> Date: Tue, 1 Dec 2020 15:32:14 +0800 Subject: [PATCH 2/5] Add cdnbye demo --- docs/zh/guide.md | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/docs/zh/guide.md b/docs/zh/guide.md index 9165e58..897258c 100644 --- a/docs/zh/guide.md +++ b/docs/zh/guide.md @@ -687,24 +687,34 @@ DPlayer 可以通过 `customType` 参数与任何 MSE 库一起使用 ```html
- + ``` ```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 + } }); - }, - }, + hls.loadSource(video.src); + hls.attachMedia(video); + } + } }, }); ``` From 59699fc3bbb4b97cd72590816f66a345423b51dd Mon Sep 17 00:00:00 2001 From: snowinszu <86755838@qq.com> Date: Tue, 1 Dec 2020 15:34:41 +0800 Subject: [PATCH 3/5] Update guide.md --- docs/zh/guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/guide.md b/docs/zh/guide.md index 897258c..6ab5643 100644 --- a/docs/zh/guide.md +++ b/docs/zh/guide.md @@ -683,7 +683,7 @@ const dp = new DPlayer({ ### 配合其他 MSE 库使用 -DPlayer 可以通过 `customType` 参数与任何 MSE 库一起使用 +DPlayer 可以通过 `customType` 参数与任何 MSE 库一起使用,例如支持P2P插件: ```html From e14cd11417c32d5d4fdc46335ec88ea528c9d1f7 Mon Sep 17 00:00:00 2001 From: snowinszu <86755838@qq.com> Date: Tue, 1 Dec 2020 15:36:56 +0800 Subject: [PATCH 4/5] Update guide.md --- docs/guide.md | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/docs/guide.md b/docs/guide.md index f113182..0b9d366 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -703,24 +703,34 @@ DPlayer can work with any MSE library via `customType` option. ```html - + ``` ```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); + } + } }, }); ``` From a00480ef073056328667876122a6746e5229c44b Mon Sep 17 00:00:00 2001 From: snowinszu <86755838@qq.com> Date: Tue, 1 Dec 2020 15:38:10 +0800 Subject: [PATCH 5/5] Update guide.md --- docs/zh/guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/guide.md b/docs/zh/guide.md index 6ab5643..bad09b9 100644 --- a/docs/zh/guide.md +++ b/docs/zh/guide.md @@ -708,7 +708,7 @@ const dp = new DPlayer({ // Other hlsjsConfig options provided by hls.js p2pConfig: { live: false, // 如果是直播设为true - // Other p2pConfig options provided by CDNBye + // Other p2pConfig options provided by CDNBye http://www.cdnbye.com/cn/ } }); hls.loadSource(video.src);