mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-19 22:07:32 +00:00
UBERF-10759 Allow to share screen from media panel (#8926)
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / uitest-workspaces (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / uitest-workspaces (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
parent
467267a67a
commit
2ba46c2d34
@ -16,18 +16,29 @@
|
||||
import { tooltip, eventToHTMLElement, showPopup } from '@hcengineering/ui'
|
||||
|
||||
import love from '../plugin'
|
||||
import { isSharingEnabled } from '../utils'
|
||||
import { isConnected, isSharingEnabled, isShareWithSound, screenSharing, setShare } from '../utils'
|
||||
|
||||
import SharingStatePopup from './SharingStatePopup.svelte'
|
||||
import IconShare from './icons/Share.svelte'
|
||||
|
||||
let disabled: boolean = false
|
||||
let pressed: boolean = false
|
||||
function handleClick (ev: MouseEvent): void {
|
||||
|
||||
function handleShowPopup (ev: MouseEvent): void {
|
||||
pressed = true
|
||||
showPopup(SharingStatePopup, {}, eventToHTMLElement(ev), () => {
|
||||
pressed = false
|
||||
})
|
||||
}
|
||||
|
||||
function handleShare (): void {
|
||||
if (disabled) return
|
||||
|
||||
const audio = $isShareWithSound
|
||||
void setShare(true, audio)
|
||||
}
|
||||
|
||||
$: disabled = !$screenSharing && !$isConnected
|
||||
</script>
|
||||
|
||||
{#if $isSharingEnabled}
|
||||
@ -35,7 +46,17 @@
|
||||
class="hulyStatusBarButton mini positive positiveContent"
|
||||
class:pressed
|
||||
use:tooltip={{ label: love.string.Sharing, direction: 'bottom' }}
|
||||
on:click={handleClick}
|
||||
on:click={handleShowPopup}
|
||||
>
|
||||
<IconShare size={'small'} />
|
||||
</button>
|
||||
{:else}
|
||||
<button
|
||||
class="hulyStatusBarButton mini disabled"
|
||||
class:pressed
|
||||
{disabled}
|
||||
use:tooltip={{ label: love.string.Share, direction: 'bottom' }}
|
||||
on:click={handleShare}
|
||||
>
|
||||
<IconShare size={'small'} />
|
||||
</button>
|
||||
|
Loading…
Reference in New Issue
Block a user