<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> #container { width: 50%; height:500px; margin-left:10px; margin: 20px auto; z-index: -1; } </style> </head> <body> <div id="container"> <div style="margin:1px">名称:摄像头名称</div> <br/> </div> <script type="text/javascript" src="../../../../public/kmedia/kmedia.js"></script> <script type="text/javascript" src="./vedio.js"></script> </body> <script> 'use strict'; // window.Kservice = { // stunService: '106.14.0.45:3478', // websocketUrl: 'ws://10.255.228.236:8081' // }; var kmedia = new KMedia({ selector: '#container', mediaUrl: './static/demo.mp4', mediaType: 'video', // serviceUrl: './config.json', // 注意播放类型修改为实时流模式 playType: 'liveStreaming', // playType: 'nonLiveStreaming', // playType: 'file', progressDisplayTime: false, // fileEncrypt: 'aes128', theme: 'blue', autoplay: true, tools: ['rewind', 'backward', 'play', 'forward', 'fastForward', 'timings', 'playbackRate', 'definition', 'backplay', 'ptz', 'videoClip', 'videoRecorder', 'digitalZoom', 'screenSplit', 'snapshot', 'multiShot', 'imgControl', 'loop', 'drawArea', 'volume', 'requestFullscreen', 'definition'], restore: false, loading: { beforeStream: '初始化中', beforePicture: '视频加载中', timeout: '视频加载已超时' }, mediaInfo: { file: { }, liveStreaming: { websocketUrl: 'ws://59.212.10.165:8081', devId: '46540100001320001164' }, nonLiveStreaming: { } }, onload: function () { kmedia.muted(true) kmedia.play() } }); //KMedia.scenario() //new KMedia(config); </script> </html>