Skip to content

Conversation

eronnen
Copy link

@eronnen eronnen commented Aug 20, 2023

Description

Add a stop button to the getdisplaymedia demo

Purpose

  • Demonstrate how to stop screen sharing from JavaScript
  • Helps to stop screen sharing easily in automated tests

chrome_PsUcBGULUv

if (displaySurface !== 'default') {
options.video = {displaySurface};
startStopButton.addEventListener('click', () => {
if (startStopButton.textContent === 'Start') {

Choose a reason for hiding this comment

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

textContent is a state of dom. Wouldn't it be better make this decision based on explicitly defined boolean variable?

Copy link
Author

Choose a reason for hiding this comment

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

💯
added a displayMediaStarted boolean

…reen sharing started in order to demonstrate stopping screen share from javascript
@eronnen eronnen force-pushed the add-getdisplaymedia-sample-stop-javascript branch from 9c02ebd to 00c3b80 Compare October 17, 2023 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants