Giter Site home page Giter Site logo

Comments (10)

nomyzs avatar nomyzs commented on July 23, 2024 3

I believe this is still an issue on ios. Getting position update in playing state with no sound first. Then position is reseted when audio starts a playback. Some logs:

flutter: 2020-03-02T16:07:01.188939	I	new AudioService.<ac>:	 state changed: AudioPlaybackState.stopped
flutter: 2020-03-02T16:07:01.190283	I	new AudioService.<ac>:	 state changed: AudioPlaybackState.playing
flutter: 2020-03-02T16:07:01.392662	I	AudioControlListenBloc._updatePosition:	 state: PlayerState.playing position: 0:00:00.203000
flutter: 2020-03-02T16:07:01.596361	I	AudioControlListenBloc._updatePosition:	 state: PlayerState.playing position: 0:00:00.407000
flutter: 2020-03-02T16:07:01.710461	I	AudioControlListenBloc._updatePosition:	 state: PlayerState.playing position: 0:00:00.000000
flutter: 2020-03-02T16:07:01.710859	I	new AudioService.<ac>:	 state changed: AudioPlaybackState.playing
flutter: 2020-03-02T16:07:01.711824	I	AudioControlListenBloc._updatePosition:	 state: PlayerState.playing position: 0:00:00.002000

Let me know if I could help with that. And thank you for this library @ryanheise !

from just_audio.

ReaganRealones avatar ReaganRealones commented on July 23, 2024

Currrently as a temporary fix, before I update my UI with the current time, I first make sure the audioplayer is in playing state (and not buffering)

from just_audio.

ryanheise avatar ryanheise commented on July 23, 2024

Ah, yes. I assume you're using getPositionStream() which in turn uses the position getter In AudioPlaybackEvent:

  /// The current position of the player.
  Duration get position => state == AudioPlaybackState.playing
      ? updatePosition +
          (Duration(milliseconds: DateTime.now().millisecondsSinceEpoch) -
                  updateTime) *
              speed
      : updatePosition;

That state == AudioPlaybackState.playing condition should be followed by && !buffering.

Just fixed. Do you want to try the latest commit?

from just_audio.

ReaganRealones avatar ReaganRealones commented on July 23, 2024

Sure, lemme check it out now ☺️

from just_audio.

ReaganRealones avatar ReaganRealones commented on July 23, 2024

Perfect, fixed. All good.

from just_audio.

Suhailakl avatar Suhailakl commented on July 23, 2024

@ryanheise Please fix this issue ASAP

from just_audio.

ryanheise avatar ryanheise commented on July 23, 2024

I've reopened this issue, as the iOS side will need to be investigated.

@nomyzs apologies for not seeing your comment sooner.

However, I'm in the process of moving apartments, so it may be a while before I can take a look.

from just_audio.

ryanheise avatar ryanheise commented on July 23, 2024

Can you confirm whether this is solved in the latest release? If not, can you test the media-source branch?

from just_audio.

ryanheise avatar ryanheise commented on July 23, 2024

Closing due to inactivity. I believe this is now working in the latest release but if not, please open a new issue with a minimal reproduction project.

from just_audio.

github-actions avatar github-actions commented on July 23, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with just_audio.

from just_audio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.