Advertisement
M3uking

1

Jun 4th, 2019
3,139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6.     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no">
  7.     <title>CDNBye TCPlayer Demo</title>
  8.     <meta name="format-detection" content="telephone=no">
  9.     <meta name="apple-mobile-web-app-capable" content="yes">
  10.     <meta name="apple-mobile-web-app-status-bar-style" content="black">
  11.     <meta name="msapplication-tap-highlight" content="no">
  12.     <style>
  13.         body {
  14.             margin: 0;
  15.             padding: 0;
  16.         }
  17.     </style>
  18. </head>
  19. <body>
  20. <div id="video-container" style="margin: 0px auto;">
  21. </div>
  22. <p id="version"></p>
  23. <h3>download info:</h3>
  24. <p id="info"></p>
  25. <script src="//cdn.jsdelivr.net/npm/cdnbye@latest"></script>
  26. <script src="//imgcache.qq.com/open/qcloud/video/vcplayer/TcPlayer-2.2.3.js"></script>
  27. <script>
  28.     document.querySelector('#version').innerText = `hls.js version: ${Hls.version}  cdnbye version: ${Hls.engineVersion}`;
  29.     var options = {
  30.         m3u8: 'https://video-dev.github.io/streams/x36xhzz/url_2/193039199_mp4_h264_aac_ld_7.m3u8' ,
  31.         autoplay: true,
  32.         live: false,
  33.         width: '480',
  34.         height: '320',
  35.         hlsConfig: {
  36.             debug: false,
  37.             // Other hlsjsConfig options provided by hls.js
  38.             p2pConfig: {
  39.                 logLevel: true,
  40.                 live: false,        // set to true in live mode
  41.                 getStats: function (totalP2PDownloaded, totalP2PUploaded, totalHTTPDownloaded) {
  42.                     var total = totalHTTPDownloaded + totalP2PDownloaded;
  43.                     document.querySelector('#info').innerText = `p2p ratio: ${Math.round(totalP2PDownloaded/total*100)}%, saved traffic: ${totalP2PDownloaded}KB, uploaded: ${totalP2PUploaded}KB`;
  44.                 },
  45.                 // Other p2pConfig options provided by CDNBye
  46.             }
  47.         }
  48.     };
  49.     var player = new TcPlayer('video-container', options);
  50.     window.qcplayer = player;
  51. </script>
  52. </body>
  53. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement