hunts Posted March 11, 2017 Share Posted March 11, 2017 Hello, how can I get the back camera to work here? https://www.babylonjs-playground.com/#1R77YT%232 Quote Link to comment Share on other sites More sharing options...
c75 Posted March 12, 2017 Share Posted March 12, 2017 I think you should modify CreateFromWebCam function and add to navigator.getUserMedia ID of your cam https://github.com/BabylonJS/Babylon.js/blob/5dfa40ab8ccfb1ea31af53f72b5e4f66de8c759e/src/Materials/Textures/babylon.videoTexture.ts#L98 if (navigator.getUserMedia) { navigator.getUserMedia({ video: { deviceId: {exact: VIDEO_SOURCE}, // <<<<<<<<<<< width: { min: (constraints && constraints.minWidth) || 256, ... replace VIDEO_SOURCE with your camera ID. You can get devices list using navigator.mediaDevices.enumerateDevices function Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 13, 2017 Share Posted March 13, 2017 This should work directly. (It works for me on CHrome and Firefox). Do you have any error on the console? hunts 1 Quote Link to comment Share on other sites More sharing options...
c75 Posted March 14, 2017 Share Posted March 14, 2017 15 hours ago, Deltakosh said: This should work directly. (It works for me on CHrome and Firefox). Do you have any error on the console? it's run the FRONT camera default on android in chrome for me, and to switch to another camera - video device ID must be added to getUserMedia constraints, but `CreateFromWebCam` does not have this param hunts 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 14, 2017 Share Posted March 14, 2017 Oh ok...Do you want to submit a PR? (I can do it else but not now ) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.