fix(webapp): autoplay client live feed video

This commit is contained in:
2026-04-06 16:50:00 +01:00
parent 798fffa2a1
commit 92b25a8bac
2 changed files with 6 additions and 1 deletions

View File

@@ -530,7 +530,10 @@ const attachClientStreamToElement = () => {
if (clientVideoElement.srcObject !== stream) { if (clientVideoElement.srcObject !== stream) {
clientVideoElement.srcObject = stream; clientVideoElement.srcObject = stream;
} }
void clientVideoElement.play().catch(() => {}); clientVideoElement.muted = true;
void clientVideoElement.play().catch((error) => {
addActivity('Stream', `Autoplay blocked for ${activeStreamSessionId}: ${error?.name || 'play_failed'}`);
});
}; };
const startCameraPreview = async (cameraInputId = getAppState().selectedCameraInputId) => { const startCameraPreview = async (cameraInputId = getAppState().selectedCameraInputId) => {

View File

@@ -216,6 +216,8 @@
<video <video
id="clientStreamVideo" id="clientStreamVideo"
class="absolute inset-0 h-full w-full object-contain {$appState.clientStreamMode === 'video' ? '' : 'hidden'}" class="absolute inset-0 h-full w-full object-contain {$appState.clientStreamMode === 'video' ? '' : 'hidden'}"
autoplay
muted
playsinline playsinline
bind:this={clientVideoElement} bind:this={clientVideoElement}
></video> ></video>