Skip to content

Commit

Permalink
feat: deleting output fle
Browse files Browse the repository at this point in the history
  • Loading branch information
RaulRodrigo06 committed Oct 3, 2023
1 parent fe086a1 commit 4b1f1b0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,14 @@ class DSVideoMessageBubbleController {
final inputFilePath = await DSFileService.download(
url,
fileName,
path: mediaPath,
httpHeaders: httpHeaders,
);

final session = await FFmpegKit.execute(
'-hide_banner -y -i "$inputFilePath" "${outputFile.path}"');

File(inputFilePath!).delete();

final returnCode = await session.getReturnCode();

if (!ReturnCode.isSuccess(returnCode)) {
Expand Down
14 changes: 11 additions & 3 deletions lib/src/widgets/chat/video/ds_video_player.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import 'package:flutter/services.dart';
import 'package:get/get.dart';

import '../../../controllers/ds_video_player.controller.dart';
import '../../../themes/colors/ds_colors.theme.dart';
import '../../../themes/icons/ds_icons.dart';
import '../../../themes/system_overlay/ds_system_overlay.style.dart';
import '../../utils/ds_header.widget.dart';

Expand Down Expand Up @@ -73,9 +75,15 @@ class DSVideoPlayer extends StatelessWidget {
8.0,
8.0 + MediaQuery.of(context).padding.bottom,
),
child: Chewie(
controller: controller.chewieController!,
),
child: controller.chewieController == null
? const Icon(
DSIcons.video_broken_outline,
size: 80.0,
color: DSColors.neutralDarkRooftop,
)
: Chewie(
controller: controller.chewieController!,
),
),
),
),
Expand Down

0 comments on commit 4b1f1b0

Please sign in to comment.