From c767f9cc6225d34fdd34b5d357ffed7f2a081b26 Mon Sep 17 00:00:00 2001 From: Ryan Heise Date: Sun, 4 Oct 2020 13:35:34 +1100 Subject: [PATCH 1/6] Fix bug in loading from assets. --- just_audio/lib/just_audio.dart | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/just_audio/lib/just_audio.dart b/just_audio/lib/just_audio.dart index b1dbe2a..f1d426b 100644 --- a/just_audio/lib/just_audio.dart +++ b/just_audio/lib/just_audio.dart @@ -1180,6 +1180,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); @@ -1244,7 +1249,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 @@ -1263,8 +1268,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 @@ -1282,8 +1287,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 From 9e25303e4ba136d3017e56c5d9d0252f5af6a386 Mon Sep 17 00:00:00 2001 From: Ryan Heise Date: Sun, 4 Oct 2020 13:44:45 +1100 Subject: [PATCH 2/6] just_audio 0.5.1 --- just_audio/CHANGELOG.md | 6 ++++++ just_audio/pubspec.yaml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/just_audio/CHANGELOG.md b/just_audio/CHANGELOG.md index de8be99..b00b383 100644 --- a/just_audio/CHANGELOG.md +++ b/just_audio/CHANGELOG.md @@ -1,3 +1,9 @@ +## 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/pubspec.yaml b/just_audio/pubspec.yaml index 81dd931..df36ef0 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.1 homepage: https://github.com/ryanheise/just_audio/tree/master/just_audio environment: From c29ee30f246376e107c298d890957010ab11d81f Mon Sep 17 00:00:00 2001 From: Ryan Heise Date: Sun, 4 Oct 2020 14:32:55 +1100 Subject: [PATCH 3/6] More detailed bot message. --- .github/workflows/auto-close.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" From b258b5d76e6763411fdf419b58d81e4db431c7ce Mon Sep 17 00:00:00 2001 From: Ryan Heise Date: Sun, 4 Oct 2020 14:45:12 +1100 Subject: [PATCH 4/6] Fix bug in concatenating add/addAll. --- just_audio/lib/just_audio.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/just_audio/lib/just_audio.dart b/just_audio/lib/just_audio.dart index f1d426b..130f994 100644 --- a/just_audio/lib/just_audio.dart +++ b/just_audio/lib/just_audio.dart @@ -1317,14 +1317,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 +1340,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())); } } From 440dfeafc335926f1f0159046121dfe9a6ec9be1 Mon Sep 17 00:00:00 2001 From: Ryan Heise Date: Sun, 4 Oct 2020 14:46:21 +1100 Subject: [PATCH 5/6] Fix bug in concatenating add/addAll. --- just_audio/CHANGELOG.md | 4 ++++ just_audio/pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/just_audio/CHANGELOG.md b/just_audio/CHANGELOG.md index b00b383..ea6444d 100644 --- a/just_audio/CHANGELOG.md +++ b/just_audio/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.2 + +* Fix bug in concatenating add/addAll. + ## 0.5.1 * Fix bug in loading from assets. diff --git a/just_audio/pubspec.yaml b/just_audio/pubspec.yaml index df36ef0..2f97ca7 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.1 +version: 0.5.2 homepage: https://github.com/ryanheise/just_audio/tree/master/just_audio environment: From a6f03841a0e235d2555a8d22955ee80736dc3307 Mon Sep 17 00:00:00 2001 From: Ryan Heise Date: Mon, 5 Oct 2020 21:01:19 +1100 Subject: [PATCH 6/6] Downgrade async dependency to work with older Flutter SDKs. --- just_audio/example/pubspec.lock | 2 +- just_audio/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/pubspec.yaml b/just_audio/pubspec.yaml index 2f97ca7..0d34a05 100644 --- a/just_audio/pubspec.yaml +++ b/just_audio/pubspec.yaml @@ -13,7 +13,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