-
Notifications
You must be signed in to change notification settings - Fork 133
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
Update NativeCamera to support MediaStreamTrack API #1158
Update NativeCamera to support MediaStreamTrack API #1158
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of little things and stuff I don't understand, but overall, it looks fine. I probably need a second pass.
… definitions otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bunch of minor stuff, but overall looks good.
Co-authored-by: Gary Hsu <[email protected]>
…rez/BabylonNative into small-tweak-to-native-camera
The main goal of this PR is to update the NativeCamera implementation to fulfill more of the MediaStreamTrack WebAPI and in particular the capabilities and constraints portion of the spec. The capabilities and constraints API allows the client (Babylon Native in this case) to declare which capabilities the camera device supports (torch, zoom, focus mode, etc.). At the same time the consumer can pass in constraints, both at instantiation and during playback, to update the configuration of the camera.
This is a snippet of how the consumer would use this code:
The major changes I've made to achieve the above flow are:
navigator.mediaDevices.getUserMedia()
is called.isNative=true
property which causes Babylon.JS to assign the result ofnavigator.mediaDevices.getUserMedia()
to the Video elements.src
property.