Skip to content

Commit

Permalink
Merge branch 'play-video-without-thumbnail' into lint/play-video-with…
Browse files Browse the repository at this point in the history
…out-thumbnail
  • Loading branch information
poppingmoon committed Jan 7, 2024
2 parents b291aa5 + 121f02b commit 664e61a
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions lib/view/common/misskey_notes/misskey_file_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class MisskeyImageState extends ConsumerState<MisskeyImage> {
initialPage: widget.position,
),
);
} else if (widget.fileType.startsWith("video")) {
} else if (widget.fileType.startsWith(RegExp("video|audio"))) {
showDialog<void>(
context: context,
builder: (context) => VideoDialog(
Expand Down Expand Up @@ -262,22 +262,26 @@ class MisskeyImageState extends ConsumerState<MisskeyImage> {
),
),
);
} else if (widget.thumbnailUrl != null) {
} else if (widget.fileType
.startsWith(RegExp("video|audio"))) {
cachedWidget = Stack(
children: [
Positioned.fill(
child: SizedBox(
height: 200,
child: NetworkImageView(
url: widget.thumbnailUrl!,
type: ImageType.imageThumbnail,
loadingBuilder:
(context, widget, chunkEvent) => SizedBox(
width: double.infinity,
height: 200,
child: widget,
),
),
child: widget.thumbnailUrl != null
? NetworkImageView(
url: widget.thumbnailUrl!,
type: ImageType.imageThumbnail,
loadingBuilder:
(context, widget, chunkEvent) =>
SizedBox(
width: double.infinity,
height: 200,
child: widget,
),
)
: const SizedBox.shrink(),
),
),
const Positioned.fill(
Expand Down

0 comments on commit 664e61a

Please sign in to comment.