Will and When will Mobile Browers support getUserMedia?

独自空忆成欢 提交于 2019-12-07 14:24:27

问题


I have written a web app using the 'bleeding edge' HTML5/WebRTC API's (See code below). This works on Chrome v20 (with MediaStream flag enabled) and latest FF Nightly build 17.0a1 (with “media.navigator.enabled” pref created and set to true). I havent yet got it working on Opera.

However, my question is, will this work on future mobile versions of these browers? and If so when?

if(navigator.webkitGetUserMedia){   
   //For WebKit (Chrome/ Safari)
   navigator.webkitGetUserMedia({video: true, audio: false}, function(localMediaStream)      {
          $("#video").attr("src",window.webkitURL.createObjectURL(localMediaStream)); 
    }, function(e) {
      console.log(e);
    });
}else if(navigator.mozGetUserMedia){
  //For Firefox
  navigator.mozGetUserMedia({video: true}, function(localMediaStream) {
  var video = document.querySelector('video');  
  video.src = localMediaStream;
  video.play();
    },  function(e) {
      console.log(e);
    });
}else if(navigator.getUserMedia){
    //For Opera
    navigator.getUserMedia({audio: false, video: true}, function(localMediaStream) {
    $("#video").attr("src", localMediaStream);                                  
    },  function(e) {
      console.log(e);
    });
}

回答1:


Currently Opera Mobile 12.0 only support getUserMedia API - however I'm expecting that other mobile clients 'll start supporting it at the beginning of the 2013.

Updated at 3:57 am - Wednesday, 21 May 2014 (UTC)

Now, all major three browsers are supporting WebRTC (getUserMedia + PeerConnection + RTCDataChannel) on android:

  1. Firefox - its a Google App Store link
  2. Chrome - its a Google App Store link
  3. Opera - its a Google App Store link

You can use cross-walk project and compile your HTML into cross-platform apk files and it will work! It supports All WebRTC features i.e. getUserMedia + PeerConnection + RTCDataChannel.



来源:https://stackoverflow.com/questions/11572859/will-and-when-will-mobile-browers-support-getusermedia

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!