Get user media (video and audio) with javascript in mobile app

Hello,


I am trying to use a javascript sdk, from a certain provider, that at some point he says that i must get the media stream of the user, by using the standard javascript way:

navigator.mediaDevices.getUserMedia({audio:true, video_true})
.then(function(stream) {
  /* use the stream */
})
.catch(function(err) {
  /* handle the error */
});

The problem is that this does not work in mobile and i don't understand why. Even if i give all possible permissions to the app through the forge plugin "Android Permissions Plugin".


Can anyone can help me, even if it just to say that this is definetly not possible in mobile because off...


Best regards,


Rui Gomes

BTW, just tried with the "Phonegap Media Stream" cordova plugin and did not work also. 


Here is my simple wrapper of this plugin.

Rui Gomes wrote:

Hello,


I am trying to use a javascript sdk, from a certain provider, that at some point he says that i must get the media stream of the user, by using the standard javascript way:

navigator.mediaDevices.getUserMedia({audio:true, video_true})
.then(function(stream) {
  /* use the stream */
})
.catch(function(err) {
  /* handle the error */
});

The problem is that this does not work in mobile and i don't understand why. Even if i give all possible permissions to the app through the forge plugin "Android Permissions Plugin".


Can anyone can help me, even if it just to say that this is definetly not possible in mobile because off...


Best regards,


Rui Gomes

Hi Rui,

are you able to resolve this issue. I am also facing the same issue.


Thanks

Dileep


Hi Dileep, try to take a look here https://www.outsystems.com/forge/component-overview/6891/camera-reactive  .

I use a similar code to getMediaDevice using only HTML5. This project works on reactive and mobile applications and doesn't require Cordova. Maybe you can found any difference from your code to figure it out. 


Regards

Fabio


Fábio Fantato wrote:

Hi Dileep, try to take a look here https://www.outsystems.com/forge/component-overview/6891/camera-reactive  .

I use a similar code to getMediaDevice using only HTML5. This project works on reactive and mobile applications and doesn't require Cordova. Maybe you can found any difference from your code to figure it out. 


Regards

Fabio


Thanks Fabio for the reply!. I will check that.

But right now my requirement, I need to launch  phone video using the above  external JS code, but I am not able to launch that.


Thanks,

Dileep Verma