MediaDeviceInfo: How to detect and set orientation of a camera?
derwaldgeist opened this issue · 4 comments
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 :-)
Closing this to post it as a question in the Google Groups instead.
Reopened because @ibc asked me to open an issue for this :-)
Related #440
cc @derwaldgeist