video.html 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="x-ua-compatible" content="IE=edge" >
  6. <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/>
  7. <title>视频播放器</title>
  8. <link href="https://cdn.yfhl.net/static/video/video-js.css" rel="stylesheet" />
  9. </head>
  10. <body style="margin: 0">
  11. <script src="https://cdn.yfhl.net/static/video/jquery.min.js"></script>
  12. <script src="https://cdn.yfhl.net/static/video/video.min.js"></script>
  13. <script src="/player/query.js"></script>
  14. <script>
  15. $(function(){
  16. // 获得播放路径
  17. const source = getParam('source');
  18. const url = decodeURIComponent(source);
  19. // 添加内容
  20. $('body').append('<video id="my-player" class="video-js">\n' +
  21. ' <source src="'+url+'" type="video/mp4">\n' +
  22. '</video>\n');
  23. // 进行初始化
  24. videojs('my-player', {
  25. controls: true,
  26. autoplay: false,
  27. preload: 'auto',
  28. fluid: true
  29. });
  30. })
  31. </script>
  32. </body>