Skip to content

Commit

Permalink
✨Issue #9 Added fetch of devices and constraints data on creation of …
Browse files Browse the repository at this point in the history
…mediaDevices
  • Loading branch information
maverickmishra committed Nov 13, 2017
1 parent ed01a37 commit efaec7f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion www/mediadevices.js
Expand Up @@ -95,5 +95,6 @@ mediaDevices.getUserMedia = function (constraints) {
}
});
};

mediaDevices.getSupportedConstraints();
mediaDevices.enumerateDevices();
module.exports = mediaDevices;

1 comment on commit efaec7f

@macdonst
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maverickmishra that's not what I meant on slack. Take a look at the MediaStreakTrack constructor:

https://github.com/phonegap/phonegap-plugin-media-stream/blob/issue3/www/mediastreamtrack.js

I'm called cordova.exec here to pre-populate the settings values. So in mediaDevices constructor you can call:

exec(success, null, 'Stream', 'getSupportedConstraints', []);
exec(success, null, 'Stream', 'enumerateDevices', []);

and have the success method pre-populate constraints and devices.

Please sign in to comment.