-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
134 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
import './stylesheets/video.css'; | ||
import './views/bbbLiveView.html'; | ||
import './views/videoFlexTabBbb.html'; | ||
import './views/videoFlexTabBbb'; | ||
import './tabBar'; | ||
import './actionLink'; | ||
import '../lib/messageType'; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import React, { FC, useEffect } from 'react'; | ||
import { Box, Button, ButtonGroup } from '@rocket.chat/fuselage'; | ||
import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; | ||
|
||
import { useTranslation } from '../../../../../contexts/TranslationContext'; | ||
import VerticalBar from '../../../../../components/VerticalBar'; | ||
import { useTabBarClose } from '../../../providers/ToolboxProvider'; | ||
import { useSetting } from '../../../../../contexts/SettingsContext'; | ||
import { useRoom } from '../../../providers/RoomProvider'; | ||
import { usePermission } from '../../../../../contexts/AuthorizationContext'; | ||
import { IRoom } from '../../../../../../definition/IRoom'; | ||
import { useMethod } from '../../../../../contexts/ServerContext'; | ||
import { popout } from '../../../../../../app/ui-utils/client'; | ||
|
||
|
||
export const CallBBB: FC <{ | ||
startCall: () => void; | ||
endCall: () => void; | ||
handleClose: () => void; | ||
canManageCall: boolean; | ||
live: boolean; | ||
openNewWindow: boolean; | ||
}> = ({ | ||
handleClose, | ||
canManageCall, | ||
live, | ||
startCall, | ||
endCall, | ||
openNewWindow, | ||
}) => { | ||
const t = useTranslation(); | ||
return <> | ||
<VerticalBar.Header> | ||
<VerticalBar.Icon name='phone'/> | ||
<VerticalBar.Text>{t('Call')}</VerticalBar.Text> | ||
{handleClose && <VerticalBar.Close onClick={handleClose}/>} | ||
</VerticalBar.Header> | ||
<VerticalBar.ScrollableContent> | ||
{ openNewWindow ? <> | ||
<Box fontScale='p2'>{t('Video_Conference')}</Box> | ||
<Box fontScale='p1' color='neutral-700'>{t('Opened_in_a_new_window')}</Box> | ||
</> : null } | ||
<ButtonGroup stretch> | ||
{ live && <Button primary onClick={startCall}>{t('BBB_Join_Meeting')}</Button> } | ||
{ live && canManageCall && <Button danger onClick={endCall}>{t('BBB_End_Meeting')}</Button> } | ||
{ !live && canManageCall && <Button primary onClick={startCall} >{t('BBB_Start_Meeting')}</Button> } | ||
{ !live && !canManageCall && <Button primary>{t('BBB_You_have_no_permission_to_start_a_call')}</Button> } | ||
</ButtonGroup> | ||
</VerticalBar.ScrollableContent> | ||
</>; | ||
}; | ||
|
||
|
||
const D: FC<{ rid: IRoom['_id'] }> = ({ rid }) => { | ||
const handleClose = useTabBarClose(); | ||
const openNewWindow = !!useSetting('bigbluebutton_Open_New_Window'); | ||
const hasCallManagement = usePermission('call-management', rid); | ||
const room = useRoom(); | ||
const join = useMethod('bbbJoin'); | ||
const end = useMethod('bbbEnd'); | ||
|
||
const endCall = useMutableCallback(() => { | ||
end({ rid }); | ||
}); | ||
|
||
const startCall = useMutableCallback(async () => { | ||
const result = await join({ rid }); | ||
if (!result) { | ||
return; | ||
} | ||
if (openNewWindow) { | ||
return window.open(result.url); | ||
} | ||
popout.open({ | ||
content: 'bbbLiveView', | ||
data: { | ||
source: result.url, | ||
streamingOptions: result, | ||
canOpenExternal: true, | ||
showVideoControls: false, | ||
}, | ||
onCloseCallback: () => false, | ||
}); | ||
}); | ||
|
||
useEffect(() => { | ||
if (room?.streamingOptions?.type !== 'call' || popout.context) { | ||
return; | ||
} | ||
startCall(); | ||
return (): void => { | ||
popout.close(); | ||
}; | ||
}, [room?.streamingOptions?.type, startCall]); | ||
|
||
const canManageCall = room?.t === 'd' || hasCallManagement; | ||
|
||
return <CallBBB handleClose={handleClose} openNewWindow={openNewWindow} live={room?.streamingOptions?.type === 'call'} endCall={endCall} startCall={startCall} canManageCall={canManageCall} />; | ||
}; | ||
|
||
export default D; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import CallBBB from './CallBBB'; | ||
|
||
export default CallBBB; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters