feat: add video auto play setting (#20416)

* feat: add auto play setting to mobile

* feat: add auto play video setting to web

* address review comments

* fix setting id

---------

Co-authored-by: Saschl <noreply@saschl.com>
This commit is contained in:
Saschl 2025-10-15 17:24:47 +02:00 committed by GitHub
parent 7d0228a159
commit 9b5855f848
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 41 additions and 5 deletions

View file

@ -7,6 +7,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/domain/models/asset/base_asset.model.dart';
import 'package:immich_mobile/domain/models/setting.model.dart';
import 'package:immich_mobile/domain/models/store.model.dart';
import 'package:immich_mobile/domain/services/setting.service.dart';
import 'package:immich_mobile/entities/store.entity.dart';
import 'package:immich_mobile/infrastructure/repositories/storage.repository.dart';
import 'package:immich_mobile/presentation/widgets/asset_viewer/asset_viewer.state.dart';
@ -218,7 +219,10 @@ class NativeVideoViewer extends HookConsumerWidget {
}
try {
await videoController.play();
final autoPlayVideo = AppSetting.get(Setting.autoPlayVideo);
if (autoPlayVideo) {
await videoController.play();
}
await videoController.setVolume(0.9);
} catch (error) {
log.severe('Error playing video: $error');