fix video loading and error
This commit is contained in:
@@ -1038,8 +1038,12 @@ class _MessageWidgetState extends State<MessageWidget>
|
||||
future: videoController.initialize(),
|
||||
builder: (_, snapshot) {
|
||||
if (snapshot.connectionState != ConnectionState.done) {
|
||||
return Center(
|
||||
return Container(
|
||||
height: 100,
|
||||
width: 100,
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
}
|
||||
ChewieController chewieController;
|
||||
@@ -1052,6 +1056,7 @@ class _MessageWidgetState extends State<MessageWidget>
|
||||
autoInitialize: false,
|
||||
aspectRatio: videoController.value.aspectRatio,
|
||||
errorBuilder: (_, e) {
|
||||
if (attachment.thumbUrl != null) {
|
||||
return Stack(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
@@ -1064,6 +1069,7 @@ class _MessageWidgetState extends State<MessageWidget>
|
||||
),
|
||||
),
|
||||
),
|
||||
if (attachment.titleLink != null)
|
||||
Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
@@ -1072,6 +1078,9 @@ class _MessageWidgetState extends State<MessageWidget>
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
return _buildErrorImage(attachment);
|
||||
});
|
||||
_chuwieControllers[attachment.assetUrl] = chewieController;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user