feat: implement video controls and pop-out functionality in Video component

This commit is contained in:
2026-02-27 22:12:47 +11:00
parent 58966aec19
commit f8af51b75c
7 changed files with 811 additions and 33 deletions

View File

@@ -206,6 +206,18 @@ function MessageNotifications() {
? getDirectRoomPath(roomId, eventId)
: getHomeRoomPath(roomId, eventId);
// Check if running in Electron
const isElectron = 'electron' in window;
const hasElectronNotification = (window as any).electron?.notification?.show;
console.log('Notification check:', {
isElectron,
hasElectronNotification,
isTauri: isTauri(),
username,
messageBody
});
if (isTauri()) {
sendNotification({
title: roomName,
@@ -215,11 +227,29 @@ function MessageNotifications() {
if (!window.closed) navigate(roomPath);
},
});
} else if (isElectron && hasElectronNotification) {
// Use Electron desktop notifications
const notificationTitle = `${username} - Paarrot`;
const notificationBody = messageBody || 'New message';
console.log('Sending Electron notification:', { title: notificationTitle, body: notificationBody });
(window as any).electron.notification.show({
title: notificationTitle,
body: notificationBody,
icon: roomAvatar,
}).catch((err: any) => console.error('Electron notification error:', err));
} else {
const noti = new window.Notification(roomName, {
// Fallback to web Notification API - also use custom format
const notificationTitle = `${username} - Paarrot`;
const notificationBody = messageBody || 'New message';
console.log('Sending web notification:', { title: notificationTitle, body: notificationBody });
const noti = new window.Notification(notificationTitle, {
icon: roomAvatar,
badge: roomAvatar,
body,
body: notificationBody,
silent: true,
});