Skip to content

Update configuration change section #89

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

Merged
merged 3 commits into from
Mar 16, 2023

Conversation

beaufortfrancois
Copy link
Contributor

@beaufortfrancois beaufortfrancois commented Mar 2, 2023

Based on #83 and #80 discussions, this PR improves the status quo of the configuration change section with this changes:

  • Fire the configurationchange event only if capabilities and settings differ
  • Add a JavaScript example
  • Define the configurationchange event handler event type

Preview | Diff

Copy link
Member

@jan-ivar jan-ivar left a comment

Choose a reason for hiding this comment

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

Thanks for adding more algorithms! Unfortunately, it raises some questions which I've filed as #90.

@beaufortfrancois
Copy link
Contributor Author

Your feedback has been addressed.

@beaufortfrancois
Copy link
Contributor Author

Shall we merge?

@jan-ivar
Copy link
Member

Editors can integrate once @eladalon1983 has looked at it.

applyBlurInSoftwareInstead(!backgroundBlur);
}
});</pre>
</div>
Copy link
Member

Choose a reason for hiding this comment

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

nit: It's weird to see the </pre> as less indented than the </div>. The following indentation seems preferrable imho:

    <h3>Example</h3>
    <div>
      <p>This example shows how to monitor external background blur changes.</p>
      <pre class="example">
       const stream = await navigator.mediaDevices.getUserMedia({video: true});
       const [track] = stream.getVideoTracks();
       let {backgroundBlur} = track.getSettings();
       applyBlurInSoftwareInstead(!backgroundBlur);

       track.addEventListener("configurationchange", () => {
         if (backgroundBlur != track.getSettings().backgroundBlur) {
           backgroundBlur = track.getSettings().backgroundBlur;
           applyBlurInSoftwareInstead(!backgroundBlur);
         }
       });
      </pre>
    </div>
  </section>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3e48bd2

@jan-ivar jan-ivar merged commit 22cea51 into w3c:main Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants