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

Looping audio doesn't work #82

Open
michaelspeedcode opened this issue Jul 21, 2020 · 3 comments
Open

Looping audio doesn't work #82

michaelspeedcode opened this issue Jul 21, 2020 · 3 comments

Comments

@michaelspeedcode
Copy link

michaelspeedcode commented Jul 21, 2020

 _audio2 = Audio.loadFromRemoteUrl(url,
        playInBackground: true,
        looping: true, // <<<<<<<<<<< here!
        onPosition: _backgroundOnPosition,
        onComplete: _backgroundOnComplete,
        onError: (error) => onError(error))
      ..play();

//....

  void _backgroundOnComplete() {
    print('complete!');
  }

  void _backgroundOnPosition(double position) {
    print(position);
  }

  void onError(var error) {
    print(error.toString());
  }

Setting looping to true doesn't make the audio loop.

The above code prints this output:

flutter: 0.0
flutter: 0.250060887
flutter: 0.500675319
flutter: 0.751075692
flutter: 1.001015662
flutter: 1.250292806
flutter: 1.500241974
........
flutter: 9.7511342
flutter: 10.000516212
flutter: 10.250713764
flutter: complete!
@monkeyswarm
Copy link
Collaborator

What device and operating system version?

@monkeyswarm
Copy link
Collaborator

And what is the remote URL?

@michaelspeedcode
Copy link
Author

Sorry, that was half a bug report!

iOS 13.3 iPhone 11
https://medito.app/media/pages/service/backgroundmusic/356537342-1595184663/file_example_mp3_700kb.mp3

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

No branches or pull requests

2 participants