2016-07-16 20 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

相關問題