diff --git a/resources/js/meet-room.js b/resources/js/meet-room.js index 316fd54..14772bc 100644 --- a/resources/js/meet-room.js +++ b/resources/js/meet-room.js @@ -29,6 +29,11 @@ function meetRoom() { qaInput: '', chatOpen: false, chatInput: '', + shareOpen: false, + shareCopied: false, + joinUrl: '', + passcode: '', + roomTitle: '', connectionStatus: 'Connecting…', participants: [], floatingReactions: [], @@ -66,6 +71,10 @@ function meetRoom() { csrf: el.dataset.csrf, }; + this.joinUrl = el.dataset.joinUrl || ''; + this.passcode = el.dataset.passcode || ''; + this.roomTitle = el.dataset.roomTitle || ''; + this.isHost = el.dataset.isHost === '1'; this.canPublish = el.dataset.canPublish !== '0'; this.isWebinar = el.dataset.isWebinar === '1'; @@ -541,6 +550,38 @@ function meetRoom() { }); }, + async openShare() { + if (navigator.share && this.joinUrl) { + try { + await navigator.share({ + title: this.roomTitle || 'Ladill Meet', + text: 'Join my meeting on Ladill Meet', + url: this.joinUrl, + }); + return; + } catch (e) { + if (e?.name === 'AbortError') return; + } + } + + this.shareOpen = true; + this.shareCopied = false; + }, + + async copyJoinLink() { + if (!this.joinUrl) return; + + try { + await navigator.clipboard.writeText(this.joinUrl); + this.shareCopied = true; + setTimeout(() => { + this.shareCopied = false; + }, 2000); + } catch (e) { + console.error(e); + } + }, + async sendChat() { const body = this.chatInput.trim(); if (!body) return; diff --git a/resources/views/meet/room/show.blade.php b/resources/views/meet/room/show.blade.php index bd29cee..f44a456 100644 --- a/resources/views/meet/room/show.blade.php +++ b/resources/views/meet/room/show.blade.php @@ -41,6 +41,9 @@ data-files-upload-url="{{ route('meet.room.files.upload', $session) }}" data-whiteboard-url="{{ route('meet.room.whiteboard.show', $session) }}" data-whiteboard-save-url="{{ route('meet.room.whiteboard.save', $session) }}" + data-join-url="{{ $room->joinUrl() }}" + data-room-title="{{ $room->title }}" + data-passcode="{{ $room->passcode ?? '' }}" data-csrf="{{ csrf_token() }}" hidden> @@ -50,19 +53,48 @@ @endif -
Invite others
+Share this link so people can join the meeting.
++ Passcode: +
+