diff --git a/.github/workflows/auto-close.yml b/.github/workflows/auto-close.yml index 6e572b9..08a4a7e 100644 --- a/.github/workflows/auto-close.yml +++ b/.github/workflows/auto-close.yml @@ -8,5 +8,5 @@ jobs: uses: roots/issue-closer-action@v1.1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-close-message: "This issue was automatically closed because it did not follow the issue template." + issue-close-message: "Oops, it appears that your issue did not follow the template and is missing one or more required sections. Please open a new issue, and provide all required sections and information.\n\nFAQ:\n\n1. Do I really need to submit a minimal reproduction project for a bug? A: Yes. I prioritise bugs _secondarily_ on how many people are affected, and _primarily_ on whether the bug report is complete, in the sense that it enables me to immediately reproduce it and start working on a fix. If a bug is important to you, the best thing you can do is to provide all requested information ASAP so that I can start looking into it ASAP.\n\n2. I think I supplied all required information, so did the bot make a mistake? A: The bot only checks the section headings, so when you post a new issue, make sure you leave the section headings intact. (Note that because of this, it is even possible to trick the bot by including only the section headings, and then not providing the requested information under each heading. This is frowned upon, and the issue will be closed manually.)" issue-pattern: "Which API(.|[\\r\\n])*Minimal reproduction project(.|[\\r\\n])*To Reproduce|To which pages(.|[\\r\\n])*Describe your suggestion|Is your feature request(.|[\\r\\n])*Describe the solution you'd like" diff --git a/just_audio/CHANGELOG.md b/just_audio/CHANGELOG.md index de8be99..ea6444d 100644 --- a/just_audio/CHANGELOG.md +++ b/just_audio/CHANGELOG.md @@ -1,3 +1,13 @@ +## 0.5.2 + +* Fix bug in concatenating add/addAll. + +## 0.5.1 + +* Fix bug in loading from assets. +* Ignore method calls from invalid states. +* Forward exceptions from iOS platform implementation. + ## 0.5.0 * Convert to federated plugin. diff --git a/just_audio/example/pubspec.lock b/just_audio/example/pubspec.lock index b46cb75..d708c24 100644 --- a/just_audio/example/pubspec.lock +++ b/just_audio/example/pubspec.lock @@ -113,7 +113,7 @@ packages: path: ".." relative: true source: path - version: "0.5.0" + version: "0.5.2" just_audio_platform_interface: dependency: transitive description: diff --git a/just_audio/lib/just_audio.dart b/just_audio/lib/just_audio.dart index 949d8cb..f807c77 100644 --- a/just_audio/lib/just_audio.dart +++ b/just_audio/lib/just_audio.dart @@ -1185,6 +1185,11 @@ abstract class UriAudioSource extends IndexedAudioSource { : _type = type, super(tag); + /// If [uri] points to an asset, this gives us [_overrideUri] which is the URI + /// of the copied asset on the filesystem, otherwise it gives us the original + /// [uri]. + Uri get _effectiveUri => _overrideUri ?? uri; + @override Future _setup(AudioPlayer player) async { await super._setup(player); @@ -1249,7 +1254,7 @@ class ProgressiveAudioSource extends UriAudioSource { @override AudioSourceMessage _toMessage() => ProgressiveAudioSourceMessage( - id: _id, uri: uri.toString(), headers: headers); + id: _id, uri: _effectiveUri.toString(), headers: headers); } /// An [AudioSource] representing a DASH stream. The following URI schemes are @@ -1268,8 +1273,8 @@ class DashAudioSource extends UriAudioSource { : super(uri, headers: headers, tag: tag, type: 'dash'); @override - AudioSourceMessage _toMessage() => - DashAudioSourceMessage(id: _id, uri: uri.toString(), headers: headers); + AudioSourceMessage _toMessage() => DashAudioSourceMessage( + id: _id, uri: _effectiveUri.toString(), headers: headers); } /// An [AudioSource] representing an HLS stream. The following URI schemes are @@ -1287,8 +1292,8 @@ class HlsAudioSource extends UriAudioSource { : super(uri, headers: headers, tag: tag, type: 'hls'); @override - AudioSourceMessage _toMessage() => - HlsAudioSourceMessage(id: _id, uri: uri.toString(), headers: headers); + AudioSourceMessage _toMessage() => HlsAudioSourceMessage( + id: _id, uri: _effectiveUri.toString(), headers: headers); } /// An [AudioSource] representing a concatenation of multiple audio sources to @@ -1317,14 +1322,13 @@ class ConcatenatingAudioSource extends AudioSource { /// (Untested) Appends an [AudioSource]. Future add(AudioSource audioSource) async { + final index = children.length; children.add(audioSource); _player._broadcastSequence(); if (_player != null) { await (await _player._platform).concatenatingInsertAll( ConcatenatingInsertAllRequest( - id: _id, - index: children.length, - children: [audioSource._toMessage()])); + id: _id, index: index, children: [audioSource._toMessage()])); } } @@ -1341,13 +1345,14 @@ class ConcatenatingAudioSource extends AudioSource { /// (Untested) Appends multiple [AudioSource]s. Future addAll(List children) async { + int index = this.children.length; this.children.addAll(children); _player._broadcastSequence(); if (_player != null) { await (await _player._platform).concatenatingInsertAll( ConcatenatingInsertAllRequest( id: _id, - index: this.children.length, + index: index, children: children.map((child) => child._toMessage()).toList())); } } diff --git a/just_audio/pubspec.yaml b/just_audio/pubspec.yaml index f05363f..92ff961 100644 --- a/just_audio/pubspec.yaml +++ b/just_audio/pubspec.yaml @@ -1,6 +1,6 @@ name: just_audio description: Flutter plugin to play audio from streams, files, assets, DASH/HLS streams and playlists. Works with audio_service to play audio in the background. -version: 0.5.0 +version: 0.5.2 homepage: https://github.com/ryanheise/just_audio/tree/master/just_audio environment: @@ -15,7 +15,7 @@ dependencies: rxdart: ^0.24.1 path: ^1.6.4 path_provider: ^1.6.10 - async: ^2.4.1 + async: ^2.4.0 uuid: ^2.2.0 flutter: sdk: flutter