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

Increase throttle interval in ToggleVideoButton component #336

Merged
merged 3 commits into from
Oct 21, 2020

Conversation

timmydoza
Copy link
Contributor

@timmydoza timmydoza commented Oct 21, 2020

Contributing to Twilio

All third party contributors acknowledge that any contributions they provide will be made under the same open source license that the open source project is provided under.

  • I acknowledge that all my contributions will be made under the project's license.

Pull Request Details

JIRA link(s):

  • NA

Description

This PR increases the throttle interval in the ToggleVideoButton component. This should help to solve the issue described in #262

Burndown

Before review

  • Updated CHANGELOG.md if necessary
  • Added unit tests if necessary
  • Updated affected documentation
  • Verified locally with npm test
  • Manually sanity tested running locally
  • Included screenshot as PR comment (if needed)
  • Ready for review

Before merge

  • Got one or more +1s
  • Re-tested if necessary

@timmydoza timmydoza linked an issue Oct 21, 2020 that may be closed by this pull request
Copy link
Collaborator

@charliesantos charliesantos left a comment

Choose a reason for hiding this comment

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

Maybe there's a cleaner way to solve this. Is there a way to check if the video has been turned on/off successfully then update the state? That way, we don't have to rely on throttling button clicks.

@timmydoza
Copy link
Contributor Author

Maybe there's a cleaner way to solve this. Is there a way to check if the video has been turned on/off successfully then update the state? That way, we don't have to rely on throttling button clicks.

There is a check in useLocalVideoToggle that prevents anything from happening while a camera track is being acquired and published. So nothing will break even if track acquisition & publishing takes longer than the 500ms throttle interval in the button.

https://github.com/twilio/twilio-video-app-react/blob/master/src/hooks/useLocalVideoToggle/useLocalVideoToggle.tsx#L18

Still, for some reason, issues can arise when you repeatedly hit the Mute Video button quickly for a few minutes. Increasing the throttle interval is only meant to prevent this rare edge case.

@timmydoza timmydoza merged commit 7207826 into master Oct 21, 2020
@timmydoza timmydoza deleted the adjust-video-button-throttle branch October 21, 2020 19:55
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.

Multiple video tracks
2 participants