LivePhoto: show toast if video is being downloaded during long press
This commit is contained in:
parent
da1693e856
commit
da26f2c199
|
@ -3,6 +3,7 @@ import 'package:chewie/chewie.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
import 'package:photos/core/constants.dart';
|
import 'package:photos/core/constants.dart';
|
||||||
import 'package:photos/models/file.dart';
|
import 'package:photos/models/file.dart';
|
||||||
|
@ -62,6 +63,13 @@ class _ZoomableLiveImageState extends State<ZoomableLiveImage>
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Widget content;
|
Widget content;
|
||||||
|
// check is long press is selected but videoPlayer is not configured yet
|
||||||
|
if (_loadLivePhotoVideo &&
|
||||||
|
_videoPlayerController == null &&
|
||||||
|
_livePhoto.isRemoteFile()) {
|
||||||
|
showToast("downloading... ", toastLength: Toast.LENGTH_SHORT);
|
||||||
|
}
|
||||||
|
|
||||||
if (_loadLivePhotoVideo && _videoPlayerController != null) {
|
if (_loadLivePhotoVideo && _videoPlayerController != null) {
|
||||||
content = _getVideoPlayer();
|
content = _getVideoPlayer();
|
||||||
} else {
|
} else {
|
||||||
|
@ -113,6 +121,8 @@ class _ZoomableLiveImageState extends State<ZoomableLiveImage>
|
||||||
if (file != null && file.existsSync()) {
|
if (file != null && file.existsSync()) {
|
||||||
_setVideoPlayerController(file: file);
|
_setVideoPlayerController(file: file);
|
||||||
} else {
|
} else {
|
||||||
|
showToast("failed to download live photo",
|
||||||
|
toastLength: Toast.LENGTH_SHORT);
|
||||||
_logger.warning("failed to load from remote" + widget.photo.tag());
|
_logger.warning("failed to load from remote" + widget.photo.tag());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue