cdnbye
Version:
Save Your Bandwidth using WebRTC.
52 lines (44 loc) ⢠1.44 kB
HTML
<html>
<head>
<meta charset="UTF-8">
<title>CDNBye JWPlayer Demo</title>
<!-- CDNBye Plugin -->
<script src="//cdn.jsdelivr.net/npm/cdnbye@latest"></script>
<!-- JW Player Builds -->
<script src="//ssl.p.jwpcdn.com/player/v/8.0.11/jwplayer.js"></script>
<!-- JWPlayer Hlsjs Provider -->
<script src="//cdn.jsdelivr.net/npm/cdnbye@latest/dist/jwplayer.hlsjs.provider.min.js"></script>
</head>
<body>
<header></header>
<center>
<div id="demoplayer"></div>
</center>
<script>
jwplayer.key = "uoW6qHjBL3KNudxKVnwa3rt5LlTakbko9e6aQ6VUyKQ=";
jwplayer('demoplayer').setup({
file: 'https://video-dev.github.io/streams/x36xhzz/url_2/193039199_mp4_h264_aac_ld_7.m3u8',
width: 512,
height: 288,
autostart: true,
hlsjsConfig: {
debug: false,
// Other hlsjsConfig options provided by hls.js
p2pConfig: {
logLevel: true,
live: false, // set to true in live mode
wsSignalerAddr: 'wss://opensignal.cdnbye.com',
// Other p2pConfig options provided by CDNBye
}
},
});
jwplayer().on('play', function () {
jwplayer().hls.p2pEngine.on('stats', function ({totalHTTPDownloaded, totalP2PDownloaded}) {
// get totalHTTPDownloaded and totalP2PDownloaded here
})
})
</script>
</body>
</html>
ā