Skip to content

Commit

Permalink
Merge pull request #286 from takenet/release/0.2.6
Browse files Browse the repository at this point in the history
Release/0.2.6
  • Loading branch information
githubdoandre authored Dec 9, 2024
2 parents 4af3dea + eda0c3d commit 626ab85
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 22 deletions.
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

0 comments on commit 626ab85

Please sign in to comment.