Skip to content

Commit

Permalink
Show replay button if video completes for Android OS
Browse files Browse the repository at this point in the history
Closes: #88
  • Loading branch information
manikandn-m authored and nstrelow committed Nov 9, 2020
1 parent d1c883a commit d3d9416
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/src/material_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ class _MaterialControlsState extends State<MaterialControls> {
}

Expanded _buildHitArea() {
bool isFinished = _latestValue.position >= _latestValue.duration;
IconData _hitAreaIconData = isFinished ? Icons.replay : Icons.play_arrow;

return Expanded(
child: GestureDetector(
onTap: () {
Expand Down Expand Up @@ -195,7 +198,7 @@ class _MaterialControlsState extends State<MaterialControls> {
),
child: Padding(
padding: EdgeInsets.all(12.0),
child: Icon(Icons.play_arrow, size: 32.0),
child: Icon(_hitAreaIconData, size: 32.0),
),
),
),
Expand Down

0 comments on commit d3d9416

Please sign in to comment.