liveStreaming_guangdian.html 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title></title>
  6. <style type="text/css">
  7. #container {
  8. width: 50%;
  9. height:500px;
  10. margin-left:10px;
  11. margin: 20px auto;
  12. z-index: -1;
  13. }
  14. </style>
  15. </head>
  16. <body>
  17. <div id="container">
  18. <br/>
  19. </div>
  20. <script type="text/javascript" src="../../../../public/kmedia/kmedia.js"></script>
  21. <script type="text/javascript" src="./vedio.js"></script>
  22. </body>
  23. <script>
  24. 'use strict';
  25. // window.Kservice = {
  26. // stunService: '106.14.0.45:3478',
  27. // websocketUrl: 'ws://10.255.228.236:8081'
  28. // };
  29. var kmedia = new KMedia({
  30. selector: '#container',
  31. mediaUrl: './static/demo.mp4',
  32. mediaType: 'video',
  33. // serviceUrl: './config.json',
  34. // 注意播放类型修改为实时流模式
  35. playType: 'liveStreaming',
  36. // playType: 'nonLiveStreaming',
  37. // playType: 'file',
  38. progressDisplayTime: false,
  39. // fileEncrypt: 'aes128',
  40. theme: 'blue',
  41. autoplay: true,
  42. tools: ['rewind', 'backward', 'play', 'forward', 'fastForward', 'timings', 'playbackRate', 'definition', 'backplay', 'ptz', 'videoClip', 'videoRecorder', 'digitalZoom', 'screenSplit', 'snapshot', 'multiShot', 'imgControl', 'loop', 'drawArea', 'volume', 'requestFullscreen', 'definition'],
  43. restore: false,
  44. loading: {
  45. beforeStream: '初始化中',
  46. beforePicture: '视频加载中',
  47. timeout: '视频加载已超时'
  48. },
  49. mediaInfo: {
  50. file: {
  51. },
  52. liveStreaming: {
  53. websocketUrl: 'ws://59.212.10.165:8081',
  54. devId: '46540100001320001153'
  55. },
  56. nonLiveStreaming: {
  57. }
  58. },
  59. onload: function () {
  60. kmedia.muted(true)
  61. kmedia.play()
  62. }
  63. });
  64. //KMedia.scenario()
  65. //new KMedia(config);
  66. </script>
  67. </html>