fix(audio-share): Show button only when supported by browser.

Show the audio share button only when its supported. For example, mobile browsers do not support getDisplayMedia yet.
This commit is contained in:
Jaya Allamsetty 2021-04-21 16:21:33 -04:00 committed by Jaya Allamsetty
parent d014a52ab3
commit 477d94497b
1 changed files with 4 additions and 1 deletions

View File

@ -972,6 +972,7 @@ class Toolbox extends Component<Props> {
*/ */
_renderOverflowMenuContent(additionalButtons: Array<React$Element<any>>) { _renderOverflowMenuContent(additionalButtons: Array<React$Element<any>>) {
const { const {
_desktopSharingEnabled,
_feedbackConfigured, _feedbackConfigured,
_fullScreen, _fullScreen,
_isMobile, _isMobile,
@ -1036,7 +1037,9 @@ class Toolbox extends Component<Props> {
&& <SharedVideoButton && <SharedVideoButton
key = 'sharedvideo' key = 'sharedvideo'
showLabel = { true } />, showLabel = { true } />,
this._shouldShowButton('shareaudio') && isScreenAudioSupported() this._shouldShowButton('shareaudio')
&& _desktopSharingEnabled
&& isScreenAudioSupported()
&& <OverflowMenuItem && <OverflowMenuItem
accessibilityLabel = { t('toolbar.accessibilityLabel.shareaudio') } accessibilityLabel = { t('toolbar.accessibilityLabel.shareaudio') }
icon = { IconShareAudio } icon = { IconShareAudio }