Skip to content

Commit

Permalink
improved double tap logic
Browse files Browse the repository at this point in the history
  • Loading branch information
nini22P committed Dec 15, 2024
1 parent 337fc46 commit d70450b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/pages/player/iris_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,19 @@ class IrisPlayer extends HookWidget {
}
},
onDoubleTapDown: (details) async {
showControl();
if (details.kind == PointerDeviceKind.touch) {
double position = details.globalPosition.dx / width;
if (position > 0.75) {
playerController.forward();
} else if (position < 0.25) {
playerController.backward();
} else {
player.state.playing == true
? player.pause()
: player.play();
if (playerCore.playing == true) {
playerController.pause();
showControl();
} else {
playerController.play();
}
}
} else {
if (isDesktop) {
Expand Down

0 comments on commit d70450b

Please sign in to comment.