@@ -40,7 +40,6 @@ class NativeVideoViewerPage extends HookConsumerWidget {
40
40
final controller = useState <NativeVideoPlayerController ?>(null );
41
41
final lastVideoPosition = useRef (- 1 );
42
42
final isBuffering = useRef (false );
43
- final showMotionVideo = useState (false );
44
43
45
44
// When a video is opened through the timeline, `isCurrent` will immediately be true.
46
45
// When swiping from video A to video B, `isCurrent` will initially be true for video A and false for video B.
@@ -50,38 +49,18 @@ class NativeVideoViewerPage extends HookConsumerWidget {
50
49
final isCurrent = currentAsset.value == asset;
51
50
52
51
// Used to show the placeholder during hero animations for remote videos to avoid a stutter
53
- final isVisible =
54
- useState ((Platform .isIOS && asset.isLocal) || asset.isMotionPhoto);
52
+ final isVisible = useState (Platform .isIOS && asset.isLocal);
55
53
56
54
final log = Logger ('NativeVideoViewerPage' );
57
55
58
- ref.listen (isPlayingMotionVideoProvider, (_, value) async {
59
- final videoController = controller.value;
60
- if (! asset.isMotionPhoto || videoController == null || ! context.mounted) {
61
- return ;
62
- }
63
-
64
- showMotionVideo.value = value;
65
- try {
66
- if (value) {
67
- await videoController.seekTo (0 );
68
- await videoController.play ();
69
- } else {
70
- await videoController.pause ();
71
- }
72
- } catch (error) {
73
- log.severe ('Error toggling motion video: $error ' );
74
- }
75
- });
76
-
77
56
Future <VideoSource ?> createSource () async {
78
57
if (! context.mounted) {
79
58
return null ;
80
59
}
81
60
82
61
try {
83
62
final local = asset.local;
84
- if (local != null && ! asset.isMotionPhoto ) {
63
+ if (local != null ) {
85
64
final file = await local.file;
86
65
if (file == null ) {
87
66
throw Exception ('No file found for the video' );
@@ -204,9 +183,7 @@ class NativeVideoViewerPage extends HookConsumerWidget {
204
183
ref.read (videoPlaybackValueProvider.notifier).value = videoPlayback;
205
184
206
185
try {
207
- if (asset.isVideo || showMotionVideo.value) {
208
- await videoController.play ();
209
- }
186
+ await videoController.play ();
210
187
await videoController.setVolume (0.9 );
211
188
} catch (error) {
212
189
log.severe ('Error playing video: $error ' );
@@ -268,8 +245,7 @@ class NativeVideoViewerPage extends HookConsumerWidget {
268
245
return ;
269
246
}
270
247
271
- if (showMotionVideo.value &&
272
- videoController.playbackInfo? .status == PlaybackStatus .stopped &&
248
+ if (videoController.playbackInfo? .status == PlaybackStatus .stopped &&
273
249
! ref
274
250
.read (appSettingsServiceProvider)
275
251
.getSetting <bool >(AppSettingsEnum .loopVideo)) {
@@ -388,8 +364,7 @@ class NativeVideoViewerPage extends HookConsumerWidget {
388
364
if (aspectRatio.value != null )
389
365
Visibility .maintain (
390
366
key: ValueKey (asset),
391
- visible:
392
- (asset.isVideo || showMotionVideo.value) && isVisible.value,
367
+ visible: isVisible.value,
393
368
child: Center (
394
369
key: ValueKey (asset),
395
370
child: AspectRatio (
0 commit comments