2016-07-16 84 views
0

在html5中,我希望能够从手机摄像头获取实时馈送,并将其显示在页面顶部的叠加层上,它可以是另一个div标签。但同时,能够使用https://github.com/exif-js/exif-js从实时馈送的图像帧中提取exif数据。如何将手机摄像头流式传输到html页面上,并且能够获得exif数据?

有谁知道这是可能的吗?

感谢

+0

你可以试试[rtchub(https://rtchub.com),但它仅仅是有可能适用于Android的 – user2231308

+0

(除没有来自摄像机的exif数据),但是需求列表对于SO来说并不是一个好问题。 – jib

+0

@jib这怎么可能?我不认为你有机会获得手机的现场摄像头(至少现在在ios上) – FirePanther

回答

0

试试这个

@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(); 
          }) 
    } 
} 

https://stackoverflow.com/a/40381774/3785349

相关问题