stop videos from autoplaying on desktop

This commit is contained in:
Henry Hiles 2026-11-12 00:10:06 -05:00
commit cd28745025
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -138,6 +138,9 @@ class const VideoPlayer(
.downloadMedia(.new(mxc: uri, encrypted: encrypted)); .downloadMedia(.new(mxc: uri, encrypted: encrypted));
if (!context.mounted) return; if (!context.mounted) return;
await controller.setupDataSource(.file(video.path)); await controller.setupDataSource(.file(video.path));
// better_player's mpv backend (Linux and Windows) starts playing as
// soon as it loads a file, despite autoPlay being off
await controller.pause();
if (context.mounted) loaded.value = true; if (context.mounted) loaded.value = true;
}); });