2016-05-16 127 views
5

我在HTML5頁面中使用以下代碼。當我在Android和PC(chrome)上運行我的頁面時,代碼工作正常,並且我得到正確的javascript alert();,但是當我在iPhone或iPad等ios設備上運行相同的頁面時,我沒有收到任何內容(沒有alert()所有)。getUserMedia iOS問題?

這是我的代碼:

navigator.getUserMedia = (navigator.getUserMedia || // use the proper vendor prefix 
         navigator.webkitGetUserMedia || 
         navigator.mozGetUserMedia || 
         navigator.msGetUserMedia); 

navigator.getUserMedia({video: true}, function() { 
    alert('camera is supported in your browser'); 
}, function() { 
    alert('camera is not supported in your browser!'); 
}); 

是沒有辦法,我失去了一些東西?

任何幫助,將不勝感激。

+1

[WebApp使用webRTC在iOS瀏覽器和Android Chrome瀏覽器中跨平臺視頻聊天](http://stackoverflow.com/questions/23374806/webapp-using-webrtc-for-cross-platform-videochat-in -ios-browser-and-android-chro) –

+0

[請不要在標題中加標籤](https://stackoverflow.com/help/tagging) – Liam

+0

'getUserMedia'是WebRTC的一部分,不支持Safari/Apple在這個時間點。請參閱:http://iswebrtcreadyyet.com/請參閱此問題以獲取更多信息:https://stackoverflow.com/questions/23374806/webapp-using-webrtc-for-cross-platform-videochat-in-ios-browser- and-android-chro/23391401#23391401 – nineteeneightyeight

回答

1

它將在2017年秋季工作,一旦iOS11發佈。

+0

你能顯示一篇文章或資料來源嗎? –