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

Seek doesn't work properly on long videos #19

Closed
vorte opened this issue Apr 21, 2023 · 4 comments · Fixed by #36
Closed

Seek doesn't work properly on long videos #19

vorte opened this issue Apr 21, 2023 · 4 comments · Fixed by #36
Labels
bug Something isn't working

Comments

@vorte
Copy link

vorte commented Apr 21, 2023

Which API doesn't behave as documented, and how does it misbehave?
The seek() method doesn't behave as expected on Windows. Calling seek to a specific position seems to update the position data in the positionDataStream, but the actual audio continues playing from the original position.

Minimal reproduction project
The just_audio example.

To Reproduce (i.e. user steps, not code)
Steps to reproduce the behavior:

  1. Press the Play button.
  2. Seek somewhere far ahead using the seek bar - e.g. to the halfway point.
  3. The bar updates, but audio continues playing from the beginning.

If you seek a small amount forward (e.g. 5 mins), the seek seems to behave as expected.

Error messages
No errors displayed

Expected behavior
The audio should always match the seek position on screen.

Screenshots
The screen looks as expected, but the audio played doesn't match. E.g. screen shows 45 mins in, but you're actually in the first minute of audio.

Desktop (please complete the following information):

  • OS: Windows 11

Smartphone (please complete the following information):

  • Device: Pixel 7 Pro
  • OS: Android 13

Web:

  • OS: Windows 11
  • Browser: Microsoft Edge 112.0.1722.48

Everything works as expected on Android and Web. The issue is only present on Windows.

Flutter SDK version

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.12, on Microsoft Windows [Version 10.0.22621.1555], locale en-GB)
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✗] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Visual Studio - develop for Windows (Visual Studio Build Tools 2022 17.3.6)
[!] Android Studio (not installed)
[✓] VS Code (version 1.77.3)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

Additional context
Raised a similar issue ryanheise#971 on the just_audio repo, but was redirected here as it seems to be limited to windows.

@vorte vorte added the bug Something isn't working label Apr 21, 2023
@bdlukaa bdlukaa changed the title Seek doesn't work properly Seek doesn't work properly on long videos Apr 21, 2023
@ghost
Copy link

ghost commented May 4, 2023

Hi, I have the similar problem too. When I seek, it doesn't jump to the correct place and there is a delay for long audio files. I guess after seek action position or duration not coming correct. Thanks.

@bdlukaa
Copy link
Owner

bdlukaa commented May 15, 2023

It may be the case that the duration is only returning the value of the already fetched part of the video

@vorte
Copy link
Author

vorte commented May 19, 2023

It may be the case that the duration is only returning the value of the already fetched part of the video

Any ideas on how to fix this? Or maybe a workaround?

@mirozahorak
Copy link

This is still a problem on windows.
I can seek to certain point, [around position 36:00 minutes] but after that is seek command ignored.
F.e. when playing at 20:00 minute and seeking to position 50:00, position displayed is updated to 50:00, but playback continues where it was [20:00…].
When I afterwards press Pause and Play, it still continues from where it was at the time pressing pause [20:00…] and also Position display is reset from 50:00 to 20:00…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants