mirror of
https://github.com/immich-app/immich.git
synced 2025-05-31 04:05:39 -04:00
feat(mobile): add ability to force view original videos (#15094)
This commit is contained in:
parent
1f0ffd634a
commit
a13b7b364e
@ -527,6 +527,8 @@
|
|||||||
"settings_require_restart": "Please restart Immich to apply this setting",
|
"settings_require_restart": "Please restart Immich to apply this setting",
|
||||||
"setting_video_viewer_looping_subtitle": "Enable to automatically loop a video in the detail viewer.",
|
"setting_video_viewer_looping_subtitle": "Enable to automatically loop a video in the detail viewer.",
|
||||||
"setting_video_viewer_looping_title": "Looping",
|
"setting_video_viewer_looping_title": "Looping",
|
||||||
|
"setting_video_viewer_original_video_title": "Force original video",
|
||||||
|
"setting_video_viewer_original_video_subtitle": "When streaming a video from the server, play the original even when a transcode is available. May lead to buffering. Videos available locally are played in original quality regardless of this setting.",
|
||||||
"setting_video_viewer_title": "Videos",
|
"setting_video_viewer_title": "Videos",
|
||||||
"share_add": "Add",
|
"share_add": "Add",
|
||||||
"share_add_photos": "Add photos",
|
"share_add_photos": "Add photos",
|
||||||
@ -656,4 +658,4 @@
|
|||||||
"viewer_unstack": "Un-Stack",
|
"viewer_unstack": "Un-Stack",
|
||||||
"wifi_name": "WiFi Name",
|
"wifi_name": "WiFi Name",
|
||||||
"your_wifi_name": "Your WiFi name"
|
"your_wifi_name": "Your WiFi name"
|
||||||
}
|
}
|
||||||
|
@ -242,6 +242,9 @@ enum StoreKey<T> {
|
|||||||
preferredWifiName<String>(133, type: String),
|
preferredWifiName<String>(133, type: String),
|
||||||
localEndpoint<String>(134, type: String),
|
localEndpoint<String>(134, type: String),
|
||||||
externalEndpointList<String>(135, type: String),
|
externalEndpointList<String>(135, type: String),
|
||||||
|
|
||||||
|
// Video settings
|
||||||
|
loadOriginalVideo<bool>(136, type: bool),
|
||||||
;
|
;
|
||||||
|
|
||||||
const StoreKey(
|
const StoreKey(
|
||||||
|
@ -75,9 +75,14 @@ class NativeVideoViewerPage extends HookConsumerWidget {
|
|||||||
|
|
||||||
// Use a network URL for the video player controller
|
// Use a network URL for the video player controller
|
||||||
final serverEndpoint = Store.get(StoreKey.serverEndpoint);
|
final serverEndpoint = Store.get(StoreKey.serverEndpoint);
|
||||||
|
final isOriginalVideo = ref
|
||||||
|
.read(appSettingsServiceProvider)
|
||||||
|
.getSetting<bool>(AppSettingsEnum.loadOriginalVideo);
|
||||||
|
final String postfixUrl =
|
||||||
|
isOriginalVideo ? 'original' : 'video/playback';
|
||||||
final String videoUrl = asset.livePhotoVideoId != null
|
final String videoUrl = asset.livePhotoVideoId != null
|
||||||
? '$serverEndpoint/assets/${asset.livePhotoVideoId}/video/playback'
|
? '$serverEndpoint/assets/${asset.livePhotoVideoId}/$postfixUrl'
|
||||||
: '$serverEndpoint/assets/${asset.remoteId}/video/playback';
|
: '$serverEndpoint/assets/${asset.remoteId}/$postfixUrl';
|
||||||
|
|
||||||
final source = await VideoSource.init(
|
final source = await VideoSource.init(
|
||||||
path: videoUrl,
|
path: videoUrl,
|
||||||
|
@ -63,6 +63,11 @@ enum AppSettingsEnum<T> {
|
|||||||
logLevel<int>(StoreKey.logLevel, null, 5), // Level.INFO = 5
|
logLevel<int>(StoreKey.logLevel, null, 5), // Level.INFO = 5
|
||||||
preferRemoteImage<bool>(StoreKey.preferRemoteImage, null, false),
|
preferRemoteImage<bool>(StoreKey.preferRemoteImage, null, false),
|
||||||
loopVideo<bool>(StoreKey.loopVideo, "loopVideo", true),
|
loopVideo<bool>(StoreKey.loopVideo, "loopVideo", true),
|
||||||
|
loadOriginalVideo<bool>(
|
||||||
|
StoreKey.loadOriginalVideo,
|
||||||
|
"loadOriginalVideo",
|
||||||
|
false,
|
||||||
|
),
|
||||||
mapThemeMode<int>(StoreKey.mapThemeMode, null, 0),
|
mapThemeMode<int>(StoreKey.mapThemeMode, null, 0),
|
||||||
mapShowFavoriteOnly<bool>(StoreKey.mapShowFavoriteOnly, null, false),
|
mapShowFavoriteOnly<bool>(StoreKey.mapShowFavoriteOnly, null, false),
|
||||||
mapIncludeArchived<bool>(StoreKey.mapIncludeArchived, null, false),
|
mapIncludeArchived<bool>(StoreKey.mapIncludeArchived, null, false),
|
||||||
|
@ -15,6 +15,8 @@ class VideoViewerSettings extends HookConsumerWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final useLoopVideo = useAppSettingsState(AppSettingsEnum.loopVideo);
|
final useLoopVideo = useAppSettingsState(AppSettingsEnum.loopVideo);
|
||||||
|
final useOriginalVideo =
|
||||||
|
useAppSettingsState(AppSettingsEnum.loadOriginalVideo);
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@ -26,6 +28,12 @@ class VideoViewerSettings extends HookConsumerWidget {
|
|||||||
subtitle: "setting_video_viewer_looping_subtitle".tr(),
|
subtitle: "setting_video_viewer_looping_subtitle".tr(),
|
||||||
onChanged: (_) => ref.invalidate(appSettingsServiceProvider),
|
onChanged: (_) => ref.invalidate(appSettingsServiceProvider),
|
||||||
),
|
),
|
||||||
|
SettingsSwitchListTile(
|
||||||
|
valueNotifier: useOriginalVideo,
|
||||||
|
title: "setting_video_viewer_original_video_title".tr(),
|
||||||
|
subtitle: "setting_video_viewer_original_video_subtitle".tr(),
|
||||||
|
onChanged: (_) => ref.invalidate(appSettingsServiceProvider),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user