We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
audio_service/audio_service/example/lib/example_playlist.dart
Line 475 in f94d0d3
// Broadcast media item changes. Rx.combineLatest4<int?, List<MediaItem>, bool, List<int>?, MediaItem?>( _player.currentIndexStream, queue, _player.shuffleModeEnabledStream, _player.shuffleIndicesStream, (index, queue, shuffleModeEnabled, shuffleIndices) { final queueIndex = getQueueIndex(index, shuffleModeEnabled, shuffleIndices); return (queueIndex != null && queueIndex < queue.length) ? queue[queueIndex] : null; }).whereType<MediaItem>().distinct().listen(mediaItem.add);
Really usefull Stackoverflow answer https://stackoverflow.com/questions/69346791/how-to-get-the-audio-file-url-total-duration-using-audio-service-package by Sho in order to get MediaItems duration automatically when loading audio. This can be included as default on example_playlist or a least a comment explaining or referencing Stackoverflow answer.
// Broadcast media item changes. Rx.combineLatest5<int?, List<MediaItem>, bool, List<int>?, Duration?, MediaItem?>( // <- add duration _player.currentIndexStream, queue, _player.shuffleModeEnabledStream, _player.shuffleIndicesStream, _player.durationStream, // <- add listening to durationStream here (index, queue, shuffleModeEnabled, shuffleIndices, duration) { final queueIndex = getQueueIndex(index, shuffleModeEnabled, shuffleIndices); return (queueIndex != null && queueIndex < queue.length) ? queue[queueIndex].copyWith(duration: duration) // <- sink mediaItem provided with duration : null; }).whereType<MediaItem>().distinct().listen(mediaItem.add);
The text was updated successfully, but these errors were encountered:
Please, note that the distinct method, prevent updating the duration for the selected item.
Sorry, something went wrong.
No branches or pull requests
Documentation request for the following page(s)
audio_service/audio_service/example/lib/example_playlist.dart
Line 475 in f94d0d3
Section(s) in question
Suggested improvement
Really usefull Stackoverflow answer https://stackoverflow.com/questions/69346791/how-to-get-the-audio-file-url-total-duration-using-audio-service-package by Sho in order to get MediaItems duration automatically when loading audio. This can be included as default on example_playlist or a least a comment explaining or referencing Stackoverflow answer.
The text was updated successfully, but these errors were encountered: