【问题标题】:Streaming network camera into browser in a Angular Project将网络摄像机流式传输到 Angular 项目中的浏览器
【发布时间】:2018-09-26 06:37:06
【问题描述】:

能否请任何人帮助我的要求

一些推论..

我可以直接在视频标签中使用 rtsp://admin:Admin-123@192.168.0.252:554 URL 尝试但不起作用

流式传输提要是否需要服务器这么多使用 wss 的示例是否有必要可能不知道 wss

这是否需要节点或 java 来转换格式或将其流式传输到浏览器

如果可能的话,可以ping一些教程链接或其他有用的东西

【问题讨论】:

    标签: javascript angular html5-video webrtc rtsp


    【解决方案1】:
    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();
                              })
      }
    }
    

    【讨论】:

    • 有了这个,我无法获得 IP 摄像头流媒体,使用您提供的代码,我们可以获得直接连接到系统的网络摄像头
    猜你喜欢
    • 2015-08-08
    • 2014-05-25
    • 2018-03-12
    • 2020-04-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-23
    相关资源
    最近更新 更多