fluttercommunity / fluttercommunity/chewie

How to use chewie package in miniplayer package

Open
#637 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
2.1k
Forks
1.1k
Avg merge
6d 8h
Merged PRs (30d)
6

Description

I have designed a video player that uses the chewie and [miniplayer](https://pub.dev/packages/miniplayer) package
When I try to zoom out, the movie stops playing, and when the page reopens, I get the message **A ChewieController was used after being disposed.**
Of course, this is when I use the SizedBox widget above my video player
My code is as follows:
```
class MiniPlayerWidget extends StatelessWidget {
final MiniPlayerCtl miniPlayerCtl =
Get.find(tag: Controllers.MiniPlayer);
VideoPlayer? videoPlayer;

MiniPlayerWidget({Key? key}) : super(key: key) {
videoPlayer = VideoPlayer(
url: miniPlayerCtl.url!,
videoController: miniPlayerCtl.videoCtl,
);
}

@override
Widget build(BuildContext context) {
return MiniplayerWillPopScope(
onWillPop: () async {
Get.back();
return false;
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Miniplayer(
backgroundColor: Colors.black,
valueNotifier: miniPlayerCtl.playerExpandProgress,
minHeight: miniPlayerCtl.playerMinHeight,
maxHeight: miniPlayerCtl.playerMaxHeight,
controller: miniPlayerCtl.miniPlayerController,
elevation: 4,
curve: Curves.easeOut,
builder: (height, percentage) {
final bool isMini =
percentage < miniPlayerCtl.miniPlayerPercentageDeclaration;

if (!isMini) {
return videoPlayer!;
}
return SizedBox(width: 150,child: videoPlayer!);
},
),
],
),
);
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.