diff --git a/plugins/love-assets/lang/en.json b/plugins/love-assets/lang/en.json index 39558831c4..6af863eea2 100644 --- a/plugins/love-assets/lang/en.json +++ b/plugins/love-assets/lang/en.json @@ -57,6 +57,8 @@ "LeaveRoomConfirmation": "Are you sure you want to leave the room?", "ServiceNotConfigured": "Service is not configured", "FullscreenMode": "Full-screen mode", - "ExitingFullscreenMode": "Exiting fullscreen mode" + "ExitingFullscreenMode": "Exiting fullscreen mode", + "Select": "Select", + "ChooseShare": "Choose what to share" } } diff --git a/plugins/love-assets/lang/es.json b/plugins/love-assets/lang/es.json index 8ae187c5f3..37f69e9e5f 100644 --- a/plugins/love-assets/lang/es.json +++ b/plugins/love-assets/lang/es.json @@ -57,6 +57,8 @@ "LeaveRoomConfirmation": "¿Estás seguro de que quieres salir de la sala?", "ServiceNotConfigured": "El servicio no está configurado", "FullscreenMode": "Modo de pantalla completa", - "ExitingFullscreenMode": "Salir del modo de pantalla completa" + "ExitingFullscreenMode": "Salir del modo de pantalla completa", + "Select": "Seleccionar", + "ChooseShare": "Elija qué compartir" } } diff --git a/plugins/love-assets/lang/pt.json b/plugins/love-assets/lang/pt.json index 41c640b8ca..8185e1f011 100644 --- a/plugins/love-assets/lang/pt.json +++ b/plugins/love-assets/lang/pt.json @@ -57,6 +57,8 @@ "LeaveRoomConfirmation": "Tem certeza de que deseja sair da sala?", "ServiceNotConfigured": "O serviço não está configurado", "FullscreenMode": "Modo de ecrã inteiro", - "ExitingFullscreenMode": "Saindo do modo de tela cheia" + "ExitingFullscreenMode": "Saindo do modo de tela cheia", + "Select": "Seleccione", + "ChooseShare": "Escolha o que partilhar" } } diff --git a/plugins/love-assets/lang/ru.json b/plugins/love-assets/lang/ru.json index b7f0c161fe..530d9bacda 100644 --- a/plugins/love-assets/lang/ru.json +++ b/plugins/love-assets/lang/ru.json @@ -57,6 +57,8 @@ "LeaveRoomConfirmation": "Вы уверены, что хотите покинуть комнату?", "ServiceNotConfigured": "Сервис не настроен", "FullscreenMode": "Полноэкранный режим", - "ExitingFullscreenMode": "Выход из полноэкранного режима" + "ExitingFullscreenMode": "Выход из полноэкранного режима", + "Select": "Выбрать", + "ChooseShare": "Выберите, чем вы хотите поделиться" } } diff --git a/plugins/love-resources/src/components/SelectScreenSourcePopup.svelte b/plugins/love-resources/src/components/SelectScreenSourcePopup.svelte new file mode 100644 index 0000000000..5a721db2b6 --- /dev/null +++ b/plugins/love-resources/src/components/SelectScreenSourcePopup.svelte @@ -0,0 +1,89 @@ + + + { + dispatch('update', selectedSourceId) + }} + okLabel={love.string.Select} + canSave={selectedSourceId !== undefined} + on:close={() => dispatch('close')} +> +
+ {#each sources as source} + + + {/each} +
+
+ + diff --git a/plugins/love-resources/src/index.ts b/plugins/love-resources/src/index.ts index c21edbb675..37018fb045 100644 --- a/plugins/love-resources/src/index.ts +++ b/plugins/love-resources/src/index.ts @@ -3,14 +3,18 @@ import ControlExt from './components/ControlExt.svelte' import Main from './components/Main.svelte' import Settings from './components/Settings.svelte' import WorkbenchExtension from './components/WorkbenchExtension.svelte' +import SelectScreenSourcePopup from './components/SelectScreenSourcePopup.svelte' import { toggleMic, toggleVideo } from './utils' +export { setCustomCreateScreenTracks } from './utils' + export default async (): Promise => ({ component: { Main, ControlExt, Settings, - WorkbenchExtension + WorkbenchExtension, + SelectScreenSourcePopup }, actionImpl: { ToggleMic: toggleMic, diff --git a/plugins/love-resources/src/plugin.ts b/plugins/love-resources/src/plugin.ts index 5d684c5b9d..91a66f57d6 100644 --- a/plugins/love-resources/src/plugin.ts +++ b/plugins/love-resources/src/plugin.ts @@ -70,6 +70,8 @@ export default mergeIds(loveId, love, { FullscreenMode: '' as IntlString, ExitingFullscreenMode: '' as IntlString, Invite: '' as IntlString, - KnockAction: '' as IntlString + KnockAction: '' as IntlString, + Select: '' as IntlString, + ChooseShare: '' as IntlString } }) diff --git a/plugins/love-resources/src/utils.ts b/plugins/love-resources/src/utils.ts index 4e9fc02295..b1bf4857d1 100644 --- a/plugins/love-resources/src/utils.ts +++ b/plugins/love-resources/src/utils.ts @@ -22,6 +22,7 @@ import { ConnectionState, Room as LKRoom, LocalAudioTrack, + type LocalTrack, LocalVideoTrack, RoomEvent, Track, @@ -95,6 +96,10 @@ export const lk: LKRoom = new LKRoom({ } }) +export function setCustomCreateScreenTracks (value: () => Promise>>): void { + lk.localParticipant.createScreenTracks = value +} + async function prepare (): Promise { const wsURL = getMetadata(love.metadata.WebSocketURL) if (wsURL !== undefined) { diff --git a/plugins/love/src/index.ts b/plugins/love/src/index.ts index a657b144a6..cf45cd32f8 100644 --- a/plugins/love/src/index.ts +++ b/plugins/love/src/index.ts @@ -4,10 +4,11 @@ import { Drive } from '@hcengineering/drive' import { NotificationType } from '@hcengineering/notification' import { Asset, IntlString, Metadata, Plugin, plugin } from '@hcengineering/platform' import { Preference } from '@hcengineering/preference' +import { AnyComponent } from '@hcengineering/ui/src/types' import { Action } from '@hcengineering/view' export const loveId = 'love' as Plugin - +export type { ScreenSource } from './utils' export const GRID_WIDTH = 15 export enum RoomAccess { @@ -146,6 +147,9 @@ const love = plugin(loveId, { space: { Rooms: '' as Ref, Drive: '' as Ref + }, + component: { + SelectScreenSourcePopup: '' as AnyComponent } }) diff --git a/plugins/love/src/utils.ts b/plugins/love/src/utils.ts index 8c13f3606e..b7fb1c6d97 100644 --- a/plugins/love/src/utils.ts +++ b/plugins/love/src/utils.ts @@ -173,3 +173,10 @@ export function checkIntersection (rooms: Slot[], width: number, height: number, } return false } + +export interface ScreenSource { + id: string + name: string + thumbnailURL: string + appIconURL: string +}