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

Battery drain when seekToNext and seekToPrevious multiple times #1396

Open
alickbuscariolli opened this issue Jan 29, 2025 · 0 comments
Open
Assignees
Labels
1 backlog bug Something isn't working

Comments

@alickbuscariolli
Copy link

alickbuscariolli commented Jan 29, 2025

Which API doesn't behave as documented, and how does it misbehave?
seekToNext and seekToPrevious.
on iOS when playing a playlist of streams and tapping seekToNext and seekToPrevious multiple times it will warm the iPhone and drain the battery.

Minimal reproduction project
Just use just_audio and just_audio_background on Flutter project.

To Reproduce (i.e. user steps, not code)
Steps to reproduce the behavior:
1- Loading audio playlist with:
final audio = ConcatenatingAudioSource( useLazyPreparation: true, children: book.bookContent.map((content) { return ClippingAudioSource( start: Duration.zero, end: null, // or specify the end duration if known child: AudioSource.uri( Uri.parse('${dotenv.env['API_URL']}/${content.audioUrl}.m3u8'), headers: { 'Authorization': 'Bearer $userToken', }), tag: MediaItem( artHeaders: { 'Authorization': 'Bearer $userToken', }, album: content.title, artist: content.title, artUri: Uri.parse(book.imageUrl), // Specify a unique ID for each media item: id: '${book.title}-${content.title}', // Metadata to display in the notification: title: book.title, ), ); }).toList(), );

2- Call play function from just_audio;
3- Call seekToNext and seekToPrevious multiple times;
4- Battery will be drained and phone warm out.

Error messages
No error message.

Expected behavior
Shoud not drain battery. Maybe some memory leak?

Screenshots

Desktop (please complete the following information):

Smartphone (please complete the following information):
iPhone 16 Pro Max iOS 18.2.1

Flutter SDK version
3.27.3

insert output of "flutter doctor" here
`[✓] Flutter (Channel stable, 3.27.3, on macOS 15.0 24A335 darwin-arm64, locale en-AU)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] VS Code (version 1.96.4)
[✓] Connected device (4 available)
! Error: Browsing on the local area network for iPhone de Alick (4). Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
! Error: Browsing on the local area network for iPhone de Alick (4). Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

• No issues found!`

Additional context

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

No branches or pull requests

2 participants