Skip to content

Commit

Permalink
hot-fix/remove black background when swipe video
Browse files Browse the repository at this point in the history
  • Loading branch information
sherlockvn authored and hoangdat committed Oct 6, 2023
1 parent 2a16ca7 commit 6674605
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
2 changes: 0 additions & 2 deletions lib/pages/chat/events/message_content_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,5 @@ class MessageContentStyle {
static const BorderRadiusGeometry borderRadiusBubble =
BorderRadius.all(Radius.circular(12.0));

static const backgroundColorVideo = Colors.black;

static const backIconColor = Colors.white;
}
5 changes: 4 additions & 1 deletion lib/presentation/mixins/play_video_action_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ mixin PlayVideoActionMixin {
builder: (context) {
return InteractiveViewerGallery(
itemBuilder: PlatformInfos.isMobile
? VideoViewerMobileTheme(path: uriOrFilePath)
? VideoViewerMobileTheme(
path: uriOrFilePath,
eventId: eventId,
)
: VideoViewerDesktopTheme(path: uriOrFilePath),
);
},
Expand Down
16 changes: 5 additions & 11 deletions lib/widgets/video_player.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:fluffychat/pages/chat/events/message_content_style.dart';
import 'package:flutter/material.dart';
import 'package:media_kit/media_kit.dart';
import 'package:media_kit_video/media_kit_video.dart';
Expand All @@ -17,7 +16,6 @@ class VideoPlayer extends StatefulWidget {

class _VideoPlayerState extends State<VideoPlayer> {
final VideoController videoController = VideoController(Player());
bool isFullScreen = false;

@override
void initState() {
Expand All @@ -33,15 +31,11 @@ class _VideoPlayerState extends State<VideoPlayer> {

@override
Widget build(BuildContext context) {
return Container(
decoration: const BoxDecoration(
color: MessageContentStyle.backgroundColorVideo,
),
child: Video(
pauseUponEnteringBackgroundMode: true,
resumeUponEnteringForegroundMode: true,
controller: videoController,
),
return Video(
fill: Colors.transparent,
pauseUponEnteringBackgroundMode: true,
resumeUponEnteringForegroundMode: true,
controller: videoController,
);
}
}

0 comments on commit 6674605

Please sign in to comment.