Renames to isPlayingVideo
This commit is contained in:
@@ -68,13 +68,13 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|||||||
final isLoadPreview = useState(AppSettingsEnum.loadPreview.defaultValue);
|
final isLoadPreview = useState(AppSettingsEnum.loadPreview.defaultValue);
|
||||||
final isLoadOriginal = useState(AppSettingsEnum.loadOriginal.defaultValue);
|
final isLoadOriginal = useState(AppSettingsEnum.loadOriginal.defaultValue);
|
||||||
final isZoomed = useState(false);
|
final isZoomed = useState(false);
|
||||||
final isPlayingMotionVideo = useState(false);
|
final isPlayingVideo = useState(false);
|
||||||
Offset? localPosition;
|
Offset? localPosition;
|
||||||
final currentIndex = useState(initialIndex);
|
final currentIndex = useState(initialIndex);
|
||||||
final currentAsset = loadAsset(currentIndex.value);
|
final currentAsset = loadAsset(currentIndex.value);
|
||||||
// Update is playing motion video
|
// Update is playing motion video
|
||||||
ref.listen(videoPlaybackValueProvider.select((v) => v.state), (_, state) {
|
ref.listen(videoPlaybackValueProvider.select((v) => v.state), (_, state) {
|
||||||
isPlayingMotionVideo.value = state == VideoPlaybackState.playing;
|
isPlayingVideo.value = state == VideoPlaybackState.playing;
|
||||||
});
|
});
|
||||||
|
|
||||||
final stackIndex = useState(-1);
|
final stackIndex = useState(-1);
|
||||||
@@ -116,6 +116,7 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|||||||
settings.getSetting<bool>(AppSettingsEnum.loadPreview);
|
settings.getSetting<bool>(AppSettingsEnum.loadPreview);
|
||||||
isLoadOriginal.value =
|
isLoadOriginal.value =
|
||||||
settings.getSetting<bool>(AppSettingsEnum.loadOriginal);
|
settings.getSetting<bool>(AppSettingsEnum.loadOriginal);
|
||||||
|
isPlayingVideo.value = false;
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
[],
|
[],
|
||||||
@@ -242,7 +243,7 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|||||||
child: TopControlAppBar(
|
child: TopControlAppBar(
|
||||||
isOwner: isOwner,
|
isOwner: isOwner,
|
||||||
isPartner: isPartner,
|
isPartner: isPartner,
|
||||||
isPlayingMotionVideo: isPlayingMotionVideo.value,
|
isPlayingMotionVideo: isPlayingVideo.value,
|
||||||
asset: asset,
|
asset: asset,
|
||||||
onMoreInfoPressed: showInfo,
|
onMoreInfoPressed: showInfo,
|
||||||
onFavorite: toggleFavorite,
|
onFavorite: toggleFavorite,
|
||||||
@@ -255,7 +256,7 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|||||||
context,
|
context,
|
||||||
),
|
),
|
||||||
onToggleMotionVideo: (() {
|
onToggleMotionVideo: (() {
|
||||||
isPlayingMotionVideo.value = !isPlayingMotionVideo.value;
|
isPlayingVideo.value = !isPlayingVideo.value;
|
||||||
}),
|
}),
|
||||||
onAddToAlbumPressed: () => addToAlbum(asset),
|
onAddToAlbumPressed: () => addToAlbum(asset),
|
||||||
onActivitiesPressed: handleActivities,
|
onActivitiesPressed: handleActivities,
|
||||||
@@ -402,7 +403,7 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|||||||
final ImageProvider provider =
|
final ImageProvider provider =
|
||||||
ImmichImage.imageProvider(asset: a);
|
ImmichImage.imageProvider(asset: a);
|
||||||
|
|
||||||
if (a.isImage && !isPlayingMotionVideo.value) {
|
if (a.isImage && !isPlayingVideo.value) {
|
||||||
return PhotoViewGalleryPageOptions(
|
return PhotoViewGalleryPageOptions(
|
||||||
onDragStart: (_, details, __) =>
|
onDragStart: (_, details, __) =>
|
||||||
localPosition = details.localPosition,
|
localPosition = details.localPosition,
|
||||||
@@ -444,7 +445,7 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|||||||
child: VideoViewerPage(
|
child: VideoViewerPage(
|
||||||
key: ValueKey(a),
|
key: ValueKey(a),
|
||||||
asset: a,
|
asset: a,
|
||||||
isMotionVideo: isPlayingMotionVideo.value,
|
isMotionVideo: isPlayingVideo.value,
|
||||||
placeholder: Image(
|
placeholder: Image(
|
||||||
image: provider,
|
image: provider,
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
|
|||||||
Reference in New Issue
Block a user