|
|
@ -42,6 +42,8 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
initVideo(rtsp_url) { |
|
|
|
const linkSrc = process.env.NODE_ENV === 'production' ? window.g.ApiWebRtcServerUrl : process.env.VUE_APP_WEBRTCSTREAMER_API |
|
|
|
this.camera_ip = linkSrc |
|
|
|
// video:需要绑定的video控件ID |
|
|
|
// 127.0.0.1:8000:启动webrtc-streamer的设备IP和端口,默认8000 |
|
|
|
// rtsp://admin:Hn123456.108@192.168.108.242:554/Streaming/Channels/102 |
|
|
@ -49,7 +51,9 @@ export default { |
|
|
|
this.webRtcServer = new WebRtcStreamer('video', location.protocol + '//' + this.camera_ip) |
|
|
|
// 需要查看的rtsp地址,根据自己的摄像头传入对应的rtsp地址即可。注意:视频编码格式必须是H264的,否则无法正常显示,编码格式可在摄像头的后台更改 |
|
|
|
// this.webRtcServer.connect('rtsp://' + this.hkConfig.username + ':' + this.hkConfig.password + '@' + this.hkConfig.ip + ':' + this.hkConfig.port + '/Streaming/Channels/102') |
|
|
|
this.webRtcServer.connect('rtsp://admin:1111@192.168.99.133:554/h264/ch1/main/av_stream') |
|
|
|
// this.webRtcServer.connect('rtsp://admin:1111@192.168.99.133:554/h264/ch1/main/av_stream') |
|
|
|
this.webRtcServer.connect('rtsp://admin:Hn123456.108@192.168.108.248:554/Streaming/Channels/1402') |
|
|
|
// this.webRtcServer.connect(rtsp_url) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|