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

MediaDeviceInfo: How to detect and set orientation of a camera? #155

Closed
derwaldgeist opened this issue Apr 11, 2016 · 4 comments
Closed
Assignees
Milestone

Comments

@derwaldgeist
Copy link
Contributor

The MediaDeviceInfo result object contains a property called facing, but this is fixed to '':
https://github.com/eface2face/cordova-plugin-iosrtc/blob/master/dist/cordova-plugin-iosrtc.js#L81

This property would be quite useful to detect which camera is facing to the user, and in fact the Swift code detects this:
https://github.com/eface2face/cordova-plugin-iosrtc/blob/master/src/PluginEnumerateDevices.swift#L25

So I wondered why this isn't passed to the JS code. As I can see in the docs, the facing state is marked as deprecated, and in the specs the MediaDeviceInfo dictionary does not specifiy such a facing property:
http://w3c.github.io/mediacapture-main/#idl-def-MediaDeviceInfo

Yet, this raises the question what would be the standard-compliant way of detecting the orientation of a camera? In the specs, I could only find a way to set the facing mode constraints for a media track:
http://w3c.github.io/mediacapture-main/#idl-def-MediaTrackSupportedConstraints

I am also wondering if there is a way to switch the camera after a connection has been established? As far as I understand the docs, the device can only be specified in getUserMedia(), which AFAIK has to be called before a connection is set-up. Would I have to close the connection and re-establish it in this case?

Thanks in advance for your insights on this :-)

@derwaldgeist derwaldgeist changed the title MediaDeviceInfo: Property "facing" is always empty MediaDeviceInfo: How to detect orientation of a camera? Apr 11, 2016
@derwaldgeist derwaldgeist changed the title MediaDeviceInfo: How to detect orientation of a camera? MediaDeviceInfo: How to detect and set orientation of a camera? Apr 11, 2016
@derwaldgeist
Copy link
Contributor Author

Closing this to post it as a question in the Google Groups instead.

@derwaldgeist
Copy link
Contributor Author

Reopened because @ibc asked me to open an issue for this :-)

@derwaldgeist derwaldgeist reopened this Apr 13, 2016
@ibc ibc closed this as completed in ede3e85 Apr 14, 2016
@hthetiot hthetiot modified the milestones: 6.0.x, 6.0.4 Nov 18, 2019
@hthetiot
Copy link
Contributor

Related #440
cc @derwaldgeist

@hthetiot
Copy link
Contributor

merged #446 on master will test master then release 6.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants