Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

Add PWA support with wake lock, service worker, and accurate mobile recording documentation

Murtaza Nasird17b4d3cdb70
diff --git a/README.md b/README.md
index de2b6bc9..42236c7f 100644
--- a/README.md
+++ b/README.md
@@ -80,15 +80,14 @@ Complete documentation is available at **[murtaza-nasir.github.io/speakr](https:
- [Troubleshooting](https://murtaza-nasir.github.io/speakr/troubleshooting) - Common issues and solutions
- [FAQ](https://murtaza-nasir.github.io/speakr/faq) - Frequently asked questions
-## Latest Release (v0.5.6)
+## Latest Release (v0.5.7)
### Highlights
-- **Event Extraction** - Automatically identify calendar events from recordings and export to ICS
-- **Transcript Templates** - Create custom formats for transcript downloads
-- **Enhanced Export** - Flexible transcript export with template support
-- **UI Improvements** - Better mobile layouts and loading states
-- **Full Internationalization** - Complete multi-language interface
-- **Advanced Filtering** - Multi-tag selection with date presets
+- **GPT-5 Model Support** - Automatic detection and support for GPT-5 models with advanced parameters
+- **Custom Prompt Selection** - Choose between default, tag-based, or custom prompts when reprocessing summaries
+- **PWA Enhancements** - Service worker for wake lock to prevent screen sleep during recording
+- **Mobile Recording** - Warning banner and documentation about keeping app visible on mobile devices
+- **Navigation Warnings** - Prevent accidental data loss when leaving pages with unsaved recordings
## Screenshots
diff --git a/docs/index.md b/docs/index.md
index a6547b6f..92be0718 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -115,7 +115,8 @@ Speakr is a powerful self-hosted transcription platform that helps you capture,
!!! info "Version 0.5.7 - Latest Release"
- **GPT-5 Support** - Full support for OpenAI's GPT-5 model family with automatic parameter detection
- **Custom Summary Prompts on Reprocessing** - Experiment with different prompts when regenerating summaries
- - **Enhanced Model Configuration** - Comprehensive documentation for configuring AI models
+ - **PWA Enhancements** - Service worker for wake lock to prevent screen sleep on mobile
+ - **Mobile Recording** - Documentation and warnings about keeping app visible on mobile devices
- **Navigation Warnings** - Prevent data loss with warnings when leaving pages with unsaved work
Previous release (v0.5.6):
diff --git a/docs/user-guide/index.md b/docs/user-guide/index.md
index 01ef0c2d..2e048617 100644
--- a/docs/user-guide/index.md
+++ b/docs/user-guide/index.md
@@ -12,13 +12,19 @@ Welcome to the Speakr User Guide! This documentation will help you master every
<a href="first-steps" class="card-link">Learn the Interface →</a>
</div>
+ <div class="guide-card">
+ <div class="card-icon">📱</div>
+ <h3>Progressive Web App</h3>
+ <p>Install as a PWA for offline access and wake lock support during recording.</p>
+ <a href="pwa" class="card-link">Learn About PWA →</a>
+ </div>
+
<div class="guide-card">
<div class="card-icon">🎙️</div>
<h3>Recording & Uploading</h3>
<p>Upload audio files or record directly in your browser with live note-taking capabilities.</p>
<a href="recording" class="card-link">Start Recording →</a>
</div>
-
<div class="guide-card">
<div class="card-icon">📝</div>
<h3>Working with Transcripts</h3>
diff --git a/docs/user-guide/pwa.md b/docs/user-guide/pwa.md
new file mode 100644
index 00000000..b5dfe91d
--- /dev/null
+++ b/docs/user-guide/pwa.md
@@ -0,0 +1,340 @@
+# Progressive Web App (PWA)
+
+Speakr is a Progressive Web App that can be installed on your device for a more native-app like experience and wake lock support to prevent screen sleep during recording.
+
+## What is a PWA?
+
+A Progressive Web App combines the best of web and mobile apps:
+
+- **Installable** - Add to your home screen like a native app
+- **Fast loading** - Cached assets load instantly
+- **Wake lock** - Prevents screen from auto-sleeping during recording
+- **No app store** - Install directly from your browser
+- **Auto-updates** - Always get the latest version automatically
+
+## Installing Speakr as a PWA
+
+### On Android (Chrome/Edge)
+
+1. **Open Speakr** in Chrome or Edge browser
+2. Look for the **"Add to Home Screen"** prompt at the bottom of the screen
+3. Tap **"Add"** or **"Install"**
+4. Alternatively:
+ - Tap the three-dot menu (⋮) in the browser
+ - Select **"Add to Home screen"** or **"Install app"**
+ - Follow the prompts
+
+5. **Launch** the app from your home screen
+
+!!! tip "Banner Prompt"
+ If you don't see the install prompt, you may need to visit Speakr a few times first. The browser will offer installation after detecting regular usage.
+
+### On iOS (Safari)
+
+1. **Open Speakr** in Safari
+2. Tap the **Share** button (□↑) at the bottom of the screen
+3. Scroll down and tap **"Add to Home Screen"**
+4. Edit the name if desired and tap **"Add"**
+5. **Launch** the app from your home screen
+
+!!! note "iOS Limitations"
+ iOS has some restrictions on PWAs:
+ - Wake Lock API requires iOS 16.4+ (Safari 16.4+)
+ - Background execution is more limited than Android
+ - Some features work better on iOS 17+
+
+### On Desktop (Chrome/Edge/Brave)
+
+1. **Open Speakr** in your browser
+2. Look for the **install icon** (⊕) in the address bar
+3. Click it and select **"Install"**
+4. Alternatively:
+ - Click the three-dot menu
+ - Select **"Install Speakr"** or **"Add to applications"**
+
+5. **Launch** from your applications menu or desktop shortcut
+
+## PWA Features
+
+### Offline Support
+
+Once installed, Speakr caches essential files for offline use:
+
+- Application interface and UI
+- CSS stylesheets and fonts
+- JavaScript application code
+- Icons and images
+
+Note: API calls and file uploads require internet connection.
+
+!!! info "Offline Capabilities"
+ While you can access the app offline, transcription and AI features require an internet connection to your configured API endpoints.
+
+### Mobile Recording Features
+
+#### Wake Lock API
+Prevents your device screen from auto-sleeping while app is visible:
+
+- **Automatic activation** - Enabled when you start recording
+- **Keeps screen on** - Prevents screen from turning off while app is in foreground
+- **Auto-recovery** - Re-acquires if released during recording
+- **Battery consideration** - Only active during recording sessions
+
+#### Persistent Notifications
+Shows recording status in your notification tray (mobile only):
+
+- **Status indicator** - Visual reminder that recording is active
+- **One-tap return** - Tap notification to return to the app
+- **Silent** - No sound or vibration
+
+#### Page Visibility Detection
+Monitors when the app goes to background:
+
+- **Detects minimization** - Knows when app is backgrounded
+- **Smart recovery** - Re-activates wake lock when returning to app
+- **State awareness** - Tracks recording state across visibility changes
+
+### How Background Recording Works
+
+!!! danger "Critical Limitation: Keep App Visible on Mobile"
+ **Mobile browsers (Chrome, Safari, etc.) suspend audio recording when the app is minimized or the screen is locked.** This is a fundamental browser limitation that cannot be overcome with PWA features.
+
+ **What this means:**
+ - Recording **will pause** if you minimize the window
+ - Recording **will pause** if you lock your screen
+ - Recording **will pause** if you switch to another app
+ - Recording **continues** if you keep Speakr visible in foreground
+ - Wake lock **prevents screen from auto-sleeping** while Speakr is visible
+
+ **For long meetings on mobile**, you have two options:
+ 1. **Keep Speakr visible** - Don't minimize, lock screen, or switch apps
+ 2. **Use native recorder** - Use your phone's built-in voice recorder app, then upload the file to Speakr afterward
+
+**Why this happens:**
+
+Mobile browsers intentionally suspend web pages in the background to save battery. This affects:
+- JavaScript execution (timers, code)
+- MediaRecorder API (audio capture)
+- Audio context (audio processing)
+
+Native apps don't have this limitation because they use platform-specific APIs that run outside the browser.
+
+**Desktop browsers work differently:**
+- Recording continues when window is minimized
+- Can switch to other apps
+- Only stops when browser is completely closed
+
+**Starting a recording on mobile (with limitations):**
+
+1. Start recording (microphone or system audio)
+2. Wake lock prevents screen from auto-sleeping
+3. Notification appears in notification tray
+4. **Keep Speakr visible** in the foreground
+5. Do not minimize, lock screen, or switch apps
+
+**If you accidentally minimize:**
+
+- Recording audio will pause (silence)
+- Timer continues counting
+- When you return to app, recording resumes
+- Silent gap will be in the final recording
+
+## Permissions
+
+### Required Permissions
+
+#### Microphone Access
+- **When**: Starting a microphone recording
+- **Why**: Capture audio from your device's microphone
+- **Scope**: Only active during recording
+
+#### System Audio Access (Desktop)
+- **When**: Recording system audio or both mic + system
+- **Why**: Capture audio from browser tabs, applications
+- **Scope**: Only active during recording
+
+### Recommended Permissions
+
+#### Notification Permission (Mobile)
+- **When**: First recording on mobile device
+- **Why**: Show visual reminder that recording is active
+- **Impact**: Provides quick access to return to app
+- **Scope**: Only shown during active recordings
+
+!!! tip "Granting Permissions"
+ If you accidentally deny a permission, you can reset it in your browser/device settings:
+
+ - **Android Chrome**: Settings → Site settings → Speakr URL → Permissions
+ - **iOS Safari**: Settings → Safari → Speakr URL → Permissions
+ - **Desktop**: Click the lock icon (🔒) in the address bar → Permissions
+
+## Service Worker
+
+Speakr uses a service worker to provide PWA capabilities:
+
+### What it Does
+
+- **Caches static assets** - For offline access and faster loading
+- **Manages updates** - Automatically updates cached content
+- **Handles notifications** - Manages persistent recording notifications
+- **Background sync** - Foundation for future features like upload retry
+
+### Viewing Service Worker Status
+
+**Chrome DevTools:**
+
+1. Press F12 to open DevTools
+2. Go to **Application** tab
+3. Select **Service Workers** in the sidebar
+4. See registration status and version
+
+**Console Logs:**
+
+The service worker logs its activity to the browser console:
+
+```
+[Service Worker] Installing...
+[Service Worker] Caching static assets
+[Service Worker] Activating...
+[Service Worker] Script loaded
+```
+
+### Updating Service Worker
+
+The service worker automatically updates:
+
+- **Check interval**: Every 60 seconds while app is open
+- **Update process**: Downloads new version in background
+- **Activation**: Takes effect on next page reload
+
+To force an update:
+
+1. Close all Speakr tabs/windows
+2. Reopen Speakr
+3. New service worker activates automatically
+
+## Browser Compatibility
+
+### Mobile Browsers
+
+| Feature | Chrome Android | Safari iOS | Samsung Internet |
+|---------|----------------|------------|------------------|
+| PWA Install | ✅ Android 5+ | ✅ iOS 11.3+ | ✅ 4.0+ |
+| Service Worker | ✅ Chrome 40+ | ✅ iOS 11.3+ | ✅ 4.0+ |
+| Wake Lock | ✅ Chrome 84+ | ✅ iOS 16.4+ | ✅ 13.0+ |
+| Notifications | ✅ Chrome 42+ | ✅ iOS 16.4+ | ✅ 4.0+ |
+| Page Visibility | ✅ All versions | ✅ All versions | ✅ All versions |
+
+### Desktop Browsers
+
+| Feature | Chrome | Edge | Brave | Firefox | Safari |
+|---------|--------|------|-------|---------|--------|
+| PWA Install | ✅ 73+ | ✅ 79+ | ✅ All | ⚠️ Limited | ⚠️ Limited |
+| Service Worker | ✅ 40+ | ✅ 17+ | ✅ All | ✅ 44+ | ✅ 11.1+ |
+| Wake Lock | ✅ 84+ | ✅ 84+ | ✅ All | ❌ | ✅ 16.4+ |
+
+!!! info "Firefox & Safari Desktop"
+ Firefox and Safari have limited PWA install support on desktop but all core features work in the browser.
+
+## Troubleshooting
+
+### Recording Stops When Screen Locks
+
+**This is expected behavior on mobile browsers.** Recording will pause when you minimize the app or lock the screen.
+
+**Solutions:**
+
+1. **Keep app visible** - Don't minimize or lock screen during recording
+2. **Wake lock prevents auto-sleep** - Screen won't turn off automatically while recording
+3. **Use native recorder** - For long meetings, use your phone's built-in voice recorder
+4. **Desktop works differently** - Recording continues when minimized on desktop browsers
+
+### PWA Not Offered for Installation
+
+**Solutions:**
+
+1. **Visit the app multiple times** - Browser may require several visits
+2. **Check HTTPS** - PWA requires secure connection (https://)
+3. **Try different browser** - Use Chrome/Edge for best support
+4. **Clear browser cache** - Force refresh of manifest
+
+### Service Worker Not Registering
+
+**Check console for errors:**
+
+```javascript
+// Open browser console (F12)
+// Look for service worker errors
+```
+
+**Solutions:**
+
+1. **Verify HTTPS** - Service workers require secure context
+2. **Check browser support** - Update to latest browser version
+3. **Clear site data** - Browser settings → Clear site data
+4. **Hard reload** - Ctrl+Shift+R (Windows) or Cmd+Shift+R (Mac)
+
+### Offline Features Not Working
+
+**Verify:**
+
+1. Service worker is registered (check DevTools → Application)
+2. Assets are cached (check DevTools → Application → Cache Storage)
+3. You've visited the site at least once while online
+
+**Solutions:**
+
+- Reload the page while online
+- Clear cache and reload
+- Uninstall and reinstall PWA
+
+## Best Practices
+
+### For Mobile Recording
+
+1. **Keep app visible** - Don't minimize, lock screen, or switch apps
+2. **Keep phone plugged in** for long recordings
+3. **Close unnecessary apps** to free memory
+4. **Avoid taking calls** during recording (will pause)
+5. **For long meetings** - Consider using native recorder app instead
+
+### For Optimal Performance
+
+1. **Install as PWA** for better performance
+2. **Keep browser updated** for latest features
+3. **Clear old recordings** to free space
+4. **Monitor storage** in device settings
+
+### Privacy Considerations
+
+1. **Microphone access** - Only granted during recording
+2. **Notifications** - Only shown during recording (mobile)
+3. **Cached data** - Stored locally on your device
+4. **Service worker** - Can be unregistered in browser settings
+
+## Uninstalling the PWA
+
+### Android
+
+1. Long-press the app icon on home screen
+2. Select **"App info"** or drag to **"Remove"**
+3. Tap **"Uninstall"**
+
+### iOS
+
+1. Long-press the app icon
+2. Select **"Remove App"**
+3. Confirm **"Delete App"**
+
+### Desktop
+
+1. Open installed app
+2. Click three-dot menu
+3. Select **"Uninstall Speakr"**
+
+Alternatively, remove from:
+- **Chrome**: `chrome://apps` → Right-click app → Remove
+- **Edge**: `edge://apps` → Click ⋮ on app → Uninstall
+---
+
+Have questions about PWA features? Check the [FAQ](../faq.md) or [Troubleshooting Guide](../troubleshooting.md).
diff --git a/docs/user-guide/recording.md b/docs/user-guide/recording.md
index 37db4085..c9779d87 100644
--- a/docs/user-guide/recording.md
+++ b/docs/user-guide/recording.md
@@ -124,6 +124,32 @@ At the bottom of the modal, you have three options for proceeding. The "Upload"
## Best Practices for Quality Recordings
+### Mobile Recording Considerations
+
+!!! danger "Keep App Visible on Mobile Devices"
+ **Critical Limitation**: Mobile browsers (Chrome, Safari, etc.) will **pause audio recording** when you minimize the app or lock your screen. This is a fundamental browser limitation that cannot be overcome.
+
+ **To record successfully on mobile:**
+ - **Keep Speakr visible** in the foreground at all times
+ - **Don't minimize** the window or switch to other apps
+ - **Don't lock** your screen during recording
+ - Wake Lock will **prevent screen from auto-sleeping** while app is visible
+
+ **For long meetings on mobile:**
+ 1. **Option 1**: Keep Speakr open and visible (wake lock prevents screen sleep)
+ 2. **Option 2**: Use your phone's native voice recorder app, then upload the file to Speakr when done
+
+ **Desktop browsers don't have this limitation** - recording continues even when minimized.
+
+**Installing as a PWA** - For the best mobile experience, install Speakr as a Progressive Web App. This provides:
+
+- Wake Lock API to prevent screen from auto-sleeping while recording
+- Faster load times with offline caching
+- Native app-like experience
+- Persistent notification during recording
+
+See the [PWA Guide](pwa.md) for installation instructions and important limitations.
+
### Optimizing Audio Quality
The quality of your transcription starts with the quality of your recording. When using a microphone, find a quiet space with minimal echo and background noise. Soft furnishings and carpeted rooms generally provide better acoustics than empty rooms with hard surfaces. Position your microphone consistently, about 6-12 inches from your mouth, and speak at a steady volume.
diff --git a/static/js/app.js b/static/js/app.js
index 50bd60bc..48a477a1 100644
--- a/static/js/app.js
+++ b/static/js/app.js
@@ -2930,8 +2930,19 @@ document.addEventListener('DOMContentLoaded', async () => {
}
};
- // Show persistent notification during recording
+ // Detect if running on mobile device
+ const isMobileDevice = computed(() => {
+ return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
+ });
+
+ // Show persistent notification during recording (mobile only)
const showRecordingNotification = async () => {
+ // Only show notifications on mobile devices
+ if (!isMobileDevice.value) {
+ console.log('[Notification] Skipping notification on desktop');
+ return false;
+ }
+
if ('Notification' in window && 'serviceWorker' in navigator) {
try {
// Request notification permission if not already granted
@@ -2987,22 +2998,70 @@ document.addEventListener('DOMContentLoaded', async () => {
};
// Handle page visibility changes to maintain recording state
- const handleVisibilityChange = () => {
+ const handleVisibilityChange = async () => {
const wasVisible = isPageVisible.value;
isPageVisible.value = !document.hidden;
if (isRecording.value) {
if (isPageVisible.value && !wasVisible) {
// Page became visible again
- console.log('[Visibility] Page visible - recording continues');
+ console.log('[Visibility] Page visible - resuming recording if needed');
+
+ // Resume audio context if suspended
+ if (audioContext.value && audioContext.value.state === 'suspended') {
+ try {
+ await audioContext.value.resume();
+ console.log('[Visibility] Audio context resumed');
+ } catch (err) {
+ console.error('[Visibility] Failed to resume audio context:', err);
+ }
+ }
+
+ // Resume MediaRecorder if paused
+ if (mediaRecorder.value && mediaRecorder.value.state === 'paused') {
+ try {
+ mediaRecorder.value.resume();
+ console.log('[Visibility] MediaRecorder resumed');
+ } catch (err) {
+ console.error('[Visibility] Failed to resume MediaRecorder:', err);
+ }
+ }
// Re-acquire wake lock if it was lost
if (wakeLock.value === null) {
requestWakeLock();
}
+
+ // Hide notification when returning to foreground
+ hideRecordingNotification();
} else if (!isPageVisible.value && wasVisible) {
// Page became hidden
- console.log('[Visibility] Page hidden - maintaining recording state');
+ console.log('[Visibility] Page hidden - keeping recording active');
+
+ // Keep audio context running
+ if (audioContext.value && audioContext.value.state === 'suspended') {
+ try {
+ await audioContext.value.resume();
+ console.log('[Visibility] Audio context resumed in background');
+ } catch (err) {
+ console.error('[Visibility] Failed to resume audio context:', err);
+ }
+ }
+
+ // Ensure MediaRecorder is still recording
+ if (mediaRecorder.value) {
+ console.log('[Visibility] MediaRecorder state:', mediaRecorder.value.state);
+
+ // If paused, try to resume
+ if (mediaRecorder.value.state === 'paused') {
+ try {
+ mediaRecorder.value.resume();
+ console.log('[Visibility] MediaRecorder resumed from paused state');
+ } catch (err) {
+ console.error('[Visibility] Failed to resume MediaRecorder:', err);
+ }
+ }
+ }
// Show notification to keep process alive
showRecordingNotification();
@@ -3277,8 +3336,42 @@ document.addEventListener('DOMContentLoaded', async () => {
}
console.log(`Recording with estimated bitrate: ${actualBitrate.value} bps`);
-
- mediaRecorder.value.ondataavailable = event => audioChunks.value.push(event.data);
+
+ // Add state change monitoring
+ mediaRecorder.value.onpause = () => {
+ console.warn('[MediaRecorder] Recording PAUSED - attempting to resume');
+ // Automatically resume if paused (shouldn't happen in normal operation)
+ setTimeout(() => {
+ if (mediaRecorder.value && mediaRecorder.value.state === 'paused' && isRecording.value) {
+ try {
+ mediaRecorder.value.resume();
+ console.log('[MediaRecorder] Auto-resumed from paused state');
+ } catch (err) {
+ console.error('[MediaRecorder] Failed to auto-resume:', err);
+ }
+ }
+ }, 100);
+ };
+
+ mediaRecorder.value.onresume = () => {
+ console.log('[MediaRecorder] Recording RESUMED');
+ };
+
+ mediaRecorder.value.onerror = (event) => {
+ console.error('[MediaRecorder] Error occurred:', event.error);
+ };
+
+ mediaRecorder.value.ondataavailable = event => {
+ if (event.data && event.data.size > 0) {
+ audioChunks.value.push(event.data);
+ // Only log every 10th chunk to reduce console noise
+ if (audioChunks.value.length % 10 === 0) {
+ console.log(`[MediaRecorder] ${audioChunks.value.length} chunks received (${(audioChunks.value.reduce((sum, chunk) => sum + chunk.size, 0) / 1024).toFixed(1)} KB total)`);
+ }
+ } else {
+ console.warn('[MediaRecorder] Received empty data chunk');
+ }
+ };
mediaRecorder.value.onstop = () => {
const audioBlob = new Blob(audioChunks.value, { type: 'audio/webm' });
audioBlobURL.value = URL.createObjectURL(audioBlob);
@@ -3329,17 +3422,52 @@ document.addEventListener('DOMContentLoaded', async () => {
}
// Start recording and timer
- mediaRecorder.value.start();
+ // Use timeslice to force regular data emission - helps prevent pausing in background
+ // Request data every 1 second (1000ms)
+ mediaRecorder.value.start(1000);
+ console.log('[MediaRecorder] Started with 1-second timeslice for background resilience');
isRecording.value = true;
recordingTime.value = 0;
- recordingInterval.value = setInterval(() => recordingTime.value++, 1000);
+ recordingInterval.value = setInterval(() => {
+ recordingTime.value++;
+
+ // Keep audio context alive (check every second)
+ if (audioContext.value && audioContext.value.state === 'suspended') {
+ audioContext.value.resume().then(() => {
+ console.log('[Audio Context] Resumed from suspended state');
+ }).catch(err => {
+ console.error('[Audio Context] Failed to resume:', err);
+ });
+ }
- // Start size monitoring
- startSizeMonitoring();
+ // Check MediaRecorder state
+ if (mediaRecorder.value) {
+ if (mediaRecorder.value.state === 'paused') {
+ console.warn('[MediaRecorder] Detected paused state during recording');
+ mediaRecorder.value.resume();
+ }
+
+ // Every 30 seconds, check if we're still receiving audio
+ if (recordingTime.value % 30 === 0) {
+ console.log(`[Recording] ${recordingTime.value}s - State: ${mediaRecorder.value.state}, Chunks: ${audioChunks.value.length}`);
+
+ // Check if audio tracks are still active
+ activeStreams.value.forEach((stream, idx) => {
+ const audioTracks = stream.getAudioTracks();
+ audioTracks.forEach((track, trackIdx) => {
+ console.log(`[Stream ${idx}] Track ${trackIdx}: ${track.label} - enabled: ${track.enabled}, muted: ${track.muted}, readyState: ${track.readyState}`);
+ });
+ });
+ }
+ }
+ }, 1000);
- // Switch to recording view FIRST (before async operations)
+ // Switch to recording view FIRST (immediately show UI)
currentView.value = 'recording';
+ // Start size monitoring
+ startSizeMonitoring();
+
// Start visualizer(s)
drawVisualizers();
@@ -5191,7 +5319,9 @@ document.addEventListener('DOMContentLoaded', async () => {
const originalTime = recordingAudio.currentTime;
recordingAudio.currentTime = 1e101;
recordingAudio.addEventListener('timeupdate', function resetTime() {
- recordingAudio.currentTime = originalTime;
+ if (Number.isFinite(originalTime)) {
+ recordingAudio.currentTime = originalTime;
+ }
recordingAudio.removeEventListener('timeupdate', resetTime);
}, { once: true });
}
@@ -5628,8 +5758,8 @@ document.addEventListener('DOMContentLoaded', async () => {
// UI State
browser,
- isSidebarCollapsed, searchTipsExpanded, isUserMenuOpen, isDarkMode, currentColorScheme,
- showColorSchemeModal, windowWidth, isMobileScreen,
+ isSidebarCollapsed, searchTipsExpanded, isUserMenuOpen, isDarkMode, currentColorScheme,
+ showColorSchemeModal, windowWidth, isMobileScreen, isMobileDevice,
mobileTab, isMetadataExpanded,
// i18n State
diff --git a/templates/index.html b/templates/index.html
index c279adbe..584ba963 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -636,9 +636,9 @@
</div>
<!-- Recording View -->
- <div v-else-if="currentView === 'recording'" class="flex-1 flex flex-col p-4 md:p-8 bg-[var(--bg-primary)] min-h-0 overflow-y-auto">
- <div class="flex-1 flex flex-col max-w-4xl w-full mx-auto bg-[var(--bg-secondary)] rounded-xl border border-[var(--border-primary)] min-h-0">
- <!-- Top: Visualizer and Status -->
+ <div v-else-if="currentView === 'recording'" class="flex-1 flex flex-col p-4 md:p-8 bg-[var(--bg-primary)] min-h-0">
+ <div class="flex-1 flex flex-col max-w-4xl w-full mx-auto bg-[var(--bg-secondary)] rounded-xl border border-[var(--border-primary)] min-h-0 overflow-hidden">
+ <!-- Top: Visualizer and Status (Fixed) -->
<div class="flex-shrink-0 p-4 md:p-6 text-center bg-[var(--bg-tertiary)] border-b border-[var(--border-primary)]">
<div v-if="isRecording" class="w-full mx-auto mb-4">
<!-- Dual visualizer for 'both' mode -->
@@ -671,6 +671,18 @@
</audio>
</div>
</div>
+ <!-- Mobile Background Recording Warning -->
+ <div v-if="isRecording && isMobileDevice"
+ class="mb-4 p-3 bg-amber-50 dark:bg-amber-900 dark:bg-opacity-20 border border-amber-300 dark:border-amber-700 rounded-lg">
+ <div class="flex items-start gap-2 text-left">
+ <i class="fas fa-exclamation-triangle text-amber-600 dark:text-amber-400 mt-0.5 flex-shrink-0"></i>
+ <div class="text-xs text-amber-800 dark:text-amber-200">
+ <strong class="block mb-1">Keep this app visible!</strong>
+ <span>Recording will pause if you minimize the window or lock your screen. For long meetings, keep Speakr in the foreground or use a native recording app and upload the file when done.</span>
+ </div>
+ </div>
+ </div>
+
<div>
<div class="text-2xl font-mono text-[var(--text-accent)]">${formatTime(recordingTime)}</div>
<p class="text-sm text-[var(--text-muted)]">${ isRecording ? 'Recording in progress...' : 'Recording finished' }</p>
@@ -692,23 +704,24 @@
</div>
</div>
</div>
-
- <!-- Middle: Notepad -->
- <div class="flex-1 p-4 md:p-6 min-h-0 overflow-hidden flex flex-col">
- <label for="recordingNotes" class="block text-sm font-medium text-[var(--text-secondary)] mb-2 flex-shrink-0">
- <i class="fas fa-pencil-alt mr-1"></i>
- Recording Notes (Markdown)
- </label>
- <div class="flex-1 min-h-0 recording-notes-editor">
- <textarea ref="recordingNotesEditor" v-model="recordingNotes"
- class="w-full h-full bg-[var(--bg-input)] border border-[var(--border-secondary)] rounded-lg p-3 text-sm focus:outline-none focus:ring-2 focus:ring-[var(--ring-focus)] resize-none"
- :placeholder="t('form.notesPlaceholder')"
- rows="10"></textarea>
+
+ <!-- Scrollable Content Area: Notes + Actions -->
+ <div class="flex-1 min-h-0 overflow-y-auto flex flex-col">
+ <!-- Middle: Notepad - Takes available space -->
+ <div class="flex-1 p-4 md:p-6 flex flex-col" style="min-height: 300px;">
+ <label for="recordingNotes" class="block text-sm font-medium text-[var(--text-secondary)] mb-2 flex-shrink-0">
+ <i class="fas fa-pencil-alt mr-1"></i>
+ Recording Notes (Markdown)
+ </label>
+ <div class="flex-1 recording-notes-editor" style="min-height: 250px;">
+ <textarea ref="recordingNotesEditor" v-model="recordingNotes"
+ class="w-full h-full bg-[var(--bg-input)] border border-[var(--border-secondary)] rounded-lg p-3 text-sm focus:outline-none focus:ring-2 focus:ring-[var(--ring-focus)] resize-none"
+ :placeholder="t('form.notesPlaceholder')"></textarea>
+ </div>
</div>
- </div>
-
- <!-- Bottom: Action Buttons -->
- <div class="flex-shrink-0 p-4 md:p-6 bg-[var(--bg-tertiary)] border-t border-[var(--border-primary)]">
+
+ <!-- Bottom: Action Buttons -->
+ <div class="flex-shrink-0 p-4 md:p-6 bg-[var(--bg-tertiary)] border-t border-[var(--border-primary)]">
<div v-if="isRecording" class="text-center">
<button @click="stopRecording"
class="px-8 py-3 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors animate-pulse">
@@ -867,6 +880,7 @@
</div>
</div>
</div>
+ </div>
</div>
</div>