liveStreaming_shexiangtou.html 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. <div style="margin:1px">名称:摄像头名称</div>
  19. <br/>
  20. </div>
  21. <script type="text/javascript" src="../../../../public/kmedia/kmedia.js"></script>
  22. <script type="text/javascript" src="./vedio.js"></script>
  23. </body>
  24. <script>
  25. 'use strict';
  26. // window.Kservice = {
  27. // stunService: '106.14.0.45:3478',
  28. // websocketUrl: 'ws://10.255.228.236:8081'
  29. // };
  30. var kmedia = new KMedia({
  31. selector: '#container',
  32. mediaUrl: './static/demo.mp4',
  33. mediaType: 'video',
  34. // serviceUrl: './config.json',
  35. // 注意播放类型修改为实时流模式
  36. playType: 'liveStreaming',
  37. // playType: 'nonLiveStreaming',
  38. // playType: 'file',
  39. progressDisplayTime: false,
  40. // fileEncrypt: 'aes128',
  41. theme: 'blue',
  42. autoplay: true,
  43. tools: ['rewind', 'backward', 'play', 'forward', 'fastForward', 'timings', 'playbackRate', 'definition', 'backplay', 'ptz', 'videoClip', 'videoRecorder', 'digitalZoom', 'screenSplit', 'snapshot', 'multiShot', 'imgControl', 'loop', 'drawArea', 'volume', 'requestFullscreen', 'definition'],
  44. restore: false,
  45. loading: {
  46. beforeStream: '初始化中',
  47. beforePicture: '视频加载中',
  48. timeout: '视频加载已超时'
  49. },
  50. mediaInfo: {
  51. file: {
  52. },
  53. liveStreaming: {
  54. websocketUrl: 'ws://59.212.10.165:8081',
  55. devId: '46540100001320001164'
  56. },
  57. nonLiveStreaming: {
  58. }
  59. },
  60. onload: function () {
  61. kmedia.muted(true)
  62. kmedia.play()
  63. }
  64. });
  65. //KMedia.scenario()
  66. //new KMedia(config);
  67. </script>
  68. </html>