(Translated by https://www.hiragana.jp/)
Added deviceId parameter to the scene - it will set what camera to us… by alfallouji · Pull Request #346 · jeromeetienne/AR.js · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added deviceId parameter to the scene - it will set what camera to us… #346

Merged
merged 1 commit into from
Sep 21, 2018

Conversation

alfallouji
Copy link

@alfallouji alfallouji commented May 13, 2018

…e based on its deviceId

What kind of change does this PR introduce?

This is a new feature - allows to define the deviceId to use for the camera.

** Can it be referenced to an Issue? If so what is the issue # ?**
Might be useful for this issue : #178

How can we test it?

You can use this feature by defining the deviceid as a parameter in the scene, like this :
<a-scene embedded arjs="detectionMode: mono_and_matrix; matrixCodeType: 3x3; sourceType: webcam; trackingMethod: best; debugUIEnabled: false; deviceId: 10d9f755ccab290ef5dbd4a1bb27cca11e61677ab0b4356f302e098ef6144813;" antialias="true">

In order to get the deviceId, you can use getUserMedia.

Summary

Does this PR introduce a breaking change?
It doesn't. The previous behaviour to select what camera to pick up is the default one. The deviceId parameter is optional.

Other information

@alfallouji alfallouji closed this May 13, 2018
@alfallouji alfallouji changed the base branch from master to dev May 13, 2018 13:32
@alfallouji alfallouji reopened this May 13, 2018
@alfallouji alfallouji closed this May 13, 2018
@alfallouji alfallouji reopened this May 13, 2018
@jeromeetienne
Copy link
Owner

looks good to me. anybody can test it ?

@mnutsch
Copy link

mnutsch commented Jul 11, 2018

I tested this.
It did not seem to work in either the Chrome browser or the Edge browser.
I added a GET variable to the URL with the name "deviceId". I set the value to the deviceId of a camera connected to the computer.
AR.js still opened with the default camera.
Perhaps more instructions should be added on how to use this feature.

@alfallouji
Copy link
Author

I just noticed that the code sample on how to test it got hidden (forgot to put it between code markdown) ! You need to provide the deviceId in the scene tag, like this :

<a-scene embedded arjs="detectionMode: mono_and_matrix; matrixCodeType: 3x3; sourceType: webcam; trackingMethod: best; debugUIEnabled: false; deviceId: 10d9f755ccab290ef5dbd4a1bb27cca11e61677ab0b4356f302e098ef6144813;" antialias="true">

@mnutsch
Copy link

mnutsch commented Aug 19, 2018

I tested this with the added instructions and I confirmed that this change works as described.

@nicolocarpignoli nicolocarpignoli merged commit fefefb2 into jeromeetienne:dev Sep 21, 2018
nicolocarpignoli added a commit that referenced this pull request Feb 3, 2020
Added deviceId parameter to the scene - it will set what camera to us…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants