diff --git a/resources/js/meet-room.js b/resources/js/meet-room.js index 2c1e3d2..fdf1d8d 100644 --- a/resources/js/meet-room.js +++ b/resources/js/meet-room.js @@ -1,7 +1,17 @@ import Alpine from 'alpinejs'; import { ConnectionState, Room, RoomEvent, Track } from 'livekit-client'; +function readMeetBootState() { + const el = document.getElementById('meet-config'); + + return { + isRecording: el?.dataset.recordingActive === '1', + isLocked: el?.dataset.locked === '1', + }; +} + function meetRoom() { + const boot = readMeetBootState(); // LiveKit Room must stay outside Alpine's reactive proxy — wrapping it breaks // structuredClone inside the SDK during connect and media setup. let room = null; @@ -12,8 +22,8 @@ function meetRoom() { isMuted: true, isVideoOff: true, isScreenSharing: false, - isRecording: false, - isLocked: false, + isRecording: boot.isRecording, + isLocked: boot.isLocked, isHost: false, watermark: false, liveCaptions: false, @@ -686,16 +696,21 @@ function meetRoom() { }, async openShare() { - if (navigator.share && this.joinUrl) { + const useNativeShare = navigator.share + && this.joinUrl + && window.matchMedia('(max-width: 767px)').matches; + + if (useNativeShare) { 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; + // User cancelled or native share failed — fall through to copy-link panel. } } @@ -703,6 +718,7 @@ function meetRoom() { this.shareCopied = false; this.participantsOpen = false; this.chatOpen = false; + this.featuresOpen = false; }, async copyJoinLink() { diff --git a/resources/views/meet/room/show.blade.php b/resources/views/meet/room/show.blade.php index 406f6ee..4440413 100644 --- a/resources/views/meet/room/show.blade.php +++ b/resources/views/meet/room/show.blade.php @@ -79,14 +79,14 @@