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); + } + } }, }); ```