Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dragging works fine but just tapping progress bar does not move video position #23

Closed
Hwan-seok opened this issue Sep 3, 2021 · 15 comments · Fixed by #29
Closed

dragging works fine but just tapping progress bar does not move video position #23

Hwan-seok opened this issue Sep 3, 2021 · 15 comments · Fixed by #29

Comments

@Hwan-seok
Copy link
Contributor

Is this a bug? or didn't implemented?

@Hwan-seok Hwan-seok changed the title not dragging but just tapping progress bar does not move video position dragging works fine but just tapping progress bar does not move video position Sep 3, 2021
@suragch
Copy link
Owner

suragch commented Sep 3, 2021

onSeek should be called when you tap the bar. After that you need to take the given duration and move the video position yourself.

@Hwan-seok
Copy link
Contributor Author

Hwan-seok commented Sep 3, 2021

Ah, I thought the tapping behavior does not work in every environment but it does not work in specific cases.
I found that progress bar tapping is not work in PageView with itemCount >= 2 and the dragging works fine.

To make sure,

  1. PageView - children(only one) => works fine, Pageview - children(more than 1)=> does not work.
  2. Drag is calling onSeek, onDragStart & onDragEnd but Tap is not calling these. (in above case)

@suragch
Copy link
Owner

suragch commented Sep 3, 2021

It sounds like this may be related to which widget is getting the tap event. I'm not exactly sure how to fix that. If you add a regular button does it receive a tap event?

@Hwan-seok
Copy link
Contributor Author

Other tap gesture does work.
Hmm... I can provide minimal reproduction code but this library is implemented really row level to me.. so I am not sure what made this wrong...

@suragch
Copy link
Owner

suragch commented Sep 5, 2021

You have a GestureDetecter in your example. It may be stealing the tap event from the progress bar. Try removing it and seeing if the problem persists.

@Hwan-seok
Copy link
Contributor Author

Hwan-seok commented Sep 5, 2021

Oh, the gesuterDetector is just inserted because you asked me if another gesture works.
It persists even if the gestureDetector is removed.

@suragch
Copy link
Owner

suragch commented Sep 5, 2021

I see. I didn't mean to add another gesture recognizer. I meant to add a normal button and see if that received the tap event.

@Hwan-seok
Copy link
Contributor Author

Is it different between gestureDetector and the normal button? I really didn't know that.. Let me try it.

@Hwan-seok
Copy link
Contributor Author

I added two types of buttons.
One is for behind the progress bar.
The other is far apart from it.
Former one does not recog the tap But the other tap works fine.
You can check it on my reproduction code.

@Hwan-seok
Copy link
Contributor Author

@suragch
I found why this behavior occurring but do not know the solution yet.

When PageView with itemCount = 1, the HorizontalDragGestureRecognizer calls as follows even just "tap" not "drag"

  1. onDown
  2. onStart
  3. onUpdate
  4. onEnd

But with itemCount > 2 same one calls only onDown when "tap" and calls rest of it after "drag"

Is this the flutter internal bug? or expected behavior?
should I leave the issue on flutter?

@suragch
Copy link
Owner

suragch commented Nov 14, 2021

Sorry for the delay in replying.

I wonder if the HorizontalDragGestureRecognizer is conflicting with the PageView gesture recognizer. I'm not really sure what the solution is.

@Hwan-seok
Copy link
Contributor Author

I investigated and studied gestures since this issue came out, I might think the eager gesture recognizer's approach is the key solution.
I will submit the pr very soon.

@AhmadFalahian
Copy link

AhmadFalahian commented Mar 5, 2022

I investigated and studied gestures since this issue came out,

Were you able to find a solution to this problem? I got involved in this problem like you, maybe you can share the solution with me

@HosseinAsadi
Copy link

Were you able to find a solution to this problem? I got involved in this problem like you, maybe you can share the solution with me

this issue seems to be solved with this commit

https://github.com/suragch/audio_video_progress_bar/pull/29/commits/26a48f9b7f76e821c2a7250cdb78f1aa2fc3995b

but pull request is not merged!

@HosseinAsadi HosseinAsadi mentioned this issue Mar 5, 2022
@Hwan-seok
Copy link
Contributor Author

@AhmadFalahian I solved and submitted PR but as @HosseinAsadi mentioned it did not merge.

I understand the author does not accept it because somewhere it could be the breaking change and this issue was reported from only me.

Use the following forked version until the author accepts it.

  audio_video_progress_bar:
    git:
      url: https://github.com/Hwan-seok/audio_video_progress_bar
      ref: 26a48f9b7f76e821c2a7250cdb78f1aa2fc3995b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants