mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
Merge branch 'main' into feat/toggle-video-auto-play
This commit is contained in:
commit
ce4458dd80
403 changed files with 51800 additions and 66202 deletions
|
|
@ -88,9 +88,10 @@ class NativeVideoViewer extends HookConsumerWidget {
|
|||
return null;
|
||||
}
|
||||
|
||||
final videoAsset = await ref.read(assetServiceProvider).getAsset(asset) ?? asset;
|
||||
try {
|
||||
if (asset.hasLocal && asset.livePhotoVideoId == null) {
|
||||
final id = asset is LocalAsset ? (asset as LocalAsset).id : (asset as RemoteAsset).localId!;
|
||||
if (videoAsset.hasLocal && videoAsset.livePhotoVideoId == null) {
|
||||
final id = videoAsset is LocalAsset ? videoAsset.id : (videoAsset as RemoteAsset).localId!;
|
||||
final file = await const StorageRepository().getFileForAsset(id);
|
||||
if (file == null) {
|
||||
throw Exception('No file found for the video');
|
||||
|
|
@ -100,14 +101,14 @@ class NativeVideoViewer extends HookConsumerWidget {
|
|||
return source;
|
||||
}
|
||||
|
||||
final remoteId = (asset as RemoteAsset).id;
|
||||
final remoteId = (videoAsset as RemoteAsset).id;
|
||||
|
||||
// Use a network URL for the video player controller
|
||||
final serverEndpoint = Store.get(StoreKey.serverEndpoint);
|
||||
final isOriginalVideo = ref.read(settingsProvider).get<bool>(Setting.loadOriginalVideo);
|
||||
final String postfixUrl = isOriginalVideo ? 'original' : 'video/playback';
|
||||
final String videoUrl = asset.livePhotoVideoId != null
|
||||
? '$serverEndpoint/assets/${asset.livePhotoVideoId}/$postfixUrl'
|
||||
final String videoUrl = videoAsset.livePhotoVideoId != null
|
||||
? '$serverEndpoint/assets/${videoAsset.livePhotoVideoId}/$postfixUrl'
|
||||
: '$serverEndpoint/assets/$remoteId/$postfixUrl';
|
||||
|
||||
final source = await VideoSource.init(
|
||||
|
|
@ -117,7 +118,7 @@ class NativeVideoViewer extends HookConsumerWidget {
|
|||
);
|
||||
return source;
|
||||
} catch (error) {
|
||||
log.severe('Error creating video source for asset ${asset.name}: $error');
|
||||
log.severe('Error creating video source for asset ${videoAsset.name}: $error');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue