fluttercommunity / fluttercommunity/chewie

Fullscreen then play onTap

Open
#342 6 comments 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 created a listview which has my attachments so it can be images or video. What I did was create an instance of chewie on the listview but what I wanted is when I tap or click on the video it would open a new screen showing the video on fullscreen mode. But I can't seem to make it work.

```
Widget _buildVideo(AttachmentModel attachment) {
_playerController = VideoPlayerController.network(attachment.media);
_chewieController = ChewieController(
videoPlayerController: _playerController,
aspectRatio: 3 / 2,
autoPlay: false,
autoInitialize: true,
looping: false,
showControlsOnInitialize: false,
fullScreenByDefault: true,
materialProgressColors: ChewieProgressColors(
playedColor: primaryColor,
handleColor: Colors.white,
bufferedColor: Colors.grey,
backgroundColor: Color(0xFFF1F1F1),
),
placeholder: Container(
color: Color(0xFFF1F1F1),
child: Center(
child: Icon(Icons.videocam,
size: 35.0, color: secondaryTextColor),
),
)
);

return GestureDetector(
onTap: () {
_playerController.play();
},
child: Container(
color: Color(0xFFF1F1F1),
child: Chewie(
controller: _chewieController,
),
),
);
}
```

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.