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

Issue9 #19

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Issue9 #19

wants to merge 4 commits into from

Conversation

maverickmishra
Copy link
Member

Fetch data about devices and constraints when mediaDevices is created.

Description

This change pre-fetches the data provided by the mediaDevices.enumerateDevices() and mediaDevices.getSupportedConstraints when the mediaDevices object is created

Related Issue

Issue #9

Motivation and Context

This change pre-fetches the data provided by the mediaDevices.enumerateDevices() and mediaDevices.getSupportedConstraints when the mediaDevices object is created. This ends the delay in fetching this data later on when a user requests for it.

How Has This Been Tested?

Tested with pre existing tests.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

if (!flagConstraints) {
return this._supportedConstraints;
} else {
exec(successConstraints, null, 'Stream', 'getSupportedConstraints', []);
Copy link
Member

Choose a reason for hiding this comment

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

@maverickmishra they only thing that needs to be changes is after the exec call we'll need to:

return this._supportedConstraints;

This will return the default constraints as per the spec. Without a return statement here the function will return an undefined.

Copy link
Member Author

Choose a reason for hiding this comment

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

Had missed it for mediaDevices.enumerateDevices() as well. Fixed it now

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

Successfully merging this pull request may close these issues.

None yet

2 participants