简体   繁体   English

将网络摄像机流式传输到Angular项目中的浏览器

[英]Streaming network camera into browser in a Angular Project

Can Please any one help with my requirement I have an camera connected in network simply an IP Camera I need to display it in the browser.Simply live feed to the browser 可以请我帮忙的任何人吗?我有一个连接在网络中的摄像机,只是一个IP摄像机,我需要在浏览器中显示它。

Some Inferences.. 一些推论

Can I directly use rtsp://admin:Admin-123@192.168.0.252:554 URL in video tag tried but not working 我可以直接在视频标签中使用rtsp:// admin:Admin-123@192.168.0.252:554 URL尝试但不起作用

Does streaming a feed requires a server so many examples using wss is it necessary probably no idea on wss 流提要是否需要服务器,所以使用wss的示例很多,是否有可能对wss没什么了解

Does this require a node or java to convert the format or stream it to browser 这是否需要节点或Java转换格式或将其流式传输到浏览器

If possible can ping some tutorials links or something which can be helpful 如果可能的话,可以ping一些教程链接或一些有用的东西

include the video directive like this:

<video #video width="640" height="480" autoplay></video>

then in your component:

@ViewChild('video') video:any; 
// note that "#video" is the name of the template variable in the video element

ngAfterViewInit() {
  let _video=this.video.nativeElement;
  if(navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
    navigator.mediaDevices.getUserMedia({ video: true })
                          .then(stream => {
                            _video.src = window.URL.createObjectURL(stream);
                            _video.play();
                          })
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM