Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/0.2.6 #286

Merged
merged 5 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
## 0.2.6

- [DSVideoMessageBubble] Fix when thumbnail is unavailable.

## 0.2.5

- [DSImageMessageBubble] Fix when channel is instagram.

## 0.2.4

- [DSSecurityService] Add service to manage security features.
-

## 0.2.3

- [DSPhoneInput] Add support to select current country code.
Expand Down
23 changes: 14 additions & 9 deletions lib/src/controllers/chat/ds_video_message_bubble.controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ class DSVideoMessageBubbleController {
final int mediaSize;
final Map<String, String?>? httpHeaders;
final String type;

final maximumProgress = RxInt(0);
final downloadProgress = RxInt(0);
final isDownloading = RxBool(false);
final thumbnail = RxString('');
final hasError = RxBool(false);
final isLoadingThumbnail = RxBool(false);
final isThumbnailUnavailable = RxBool(false);

DSVideoMessageBubbleController({
required this.url,
Expand All @@ -29,11 +35,6 @@ class DSVideoMessageBubbleController {
getStoredVideo();
}

final isDownloading = RxBool(false);
final thumbnail = RxString('');
final hasError = RxBool(false);
final isLoadingThumbnail = RxBool(false);

String size() {
return mediaSize > 0
? FileSize.getSize(
Expand Down Expand Up @@ -127,10 +128,14 @@ class DSVideoMessageBubbleController {
Future<void> _generateThumbnail(String path) async {
final thumbnailPath = await getFullThumbnailPath();

await DSMediaFormatService.getVideoThumbnail(
input: path,
output: thumbnailPath,
);
try {
await DSMediaFormatService.getVideoThumbnail(
input: path,
output: thumbnailPath,
);
} catch (e) {
isThumbnailUnavailable.value = true;
}

thumbnail.value = thumbnailPath;
}
Expand Down
27 changes: 17 additions & 10 deletions lib/src/widgets/chat/video/ds_video_message_bubble.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,23 @@ class _DSVideoMessageBubbleState extends State<DSVideoMessageBubble>
url: widget.url,
shouldAuthenticate:
widget.shouldAuthenticate,
thumbnail: Center(
child: Image.file(
File(
_controller.thumbnail.value,
),
width: DSUtils.bubbleMinSize,
height: DSUtils.bubbleMinSize,
fit: BoxFit.cover,
),
),
thumbnail: _controller
.isThumbnailUnavailable
.value
? const SizedBox.shrink()
: Center(
child: Image.file(
File(
_controller
.thumbnail.value,
),
width: DSUtils
.bubbleMinSize,
height: DSUtils
.bubbleMinSize,
fit: BoxFit.cover,
),
),
),
)
: _buidErrorIcon(),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: blip_ds
description: Blip Design System for Flutter.
version: 0.2.5
version: 0.2.6
homepage: https://github.com/takenet/blip-ds-flutter#readme
repository: https://github.com/takenet/blip-ds-flutter

Expand Down
2 changes: 1 addition & 1 deletion sample/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.2.4"
version: "0.2.5"
boolean_selector:
dependency: transitive
description:
Expand Down