diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 08a9c9f..b5de839 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,5 +55,5 @@ jobs: uses: ncipollo/release-action@v1 with: artifacts: "build/app/outputs/flutter-apk/bloomee_tunes_v1.1.3+${{github.run_number}}.apk" - tag: v1.1.3+${{github.run_number}} + tag: v1.2.2+${{github.run_number}} token: ${{secrets.SECRET_KEY}} \ No newline at end of file diff --git a/lib/screens/screen/audioPlayer_screen.dart b/lib/screens/screen/audioPlayer_screen.dart index ae00813..cd10755 100644 --- a/lib/screens/screen/audioPlayer_screen.dart +++ b/lib/screens/screen/audioPlayer_screen.dart @@ -260,7 +260,7 @@ class _AudioPlayerViewState extends State { InkWell( onTap: () => musicPlayer.rewind(), child: const Icon( - FluentIcons.arrow_repeat_1_24_filled, + FluentIcons.replay_20_regular, color: Default_Theme.primaryColor1, size: 35, ), @@ -273,19 +273,53 @@ class _AudioPlayerViewState extends State { size: 35, ), ), - StreamBuilder( + StreamBuilder( stream: context .watch() .bloomeePlayer - .audioPlayer - .playerStateStream, - builder: (context, snapshot) { - return PlayPauseButton( - size: 75, - onPause: () => musicPlayer.pause(), - onPlay: () => musicPlayer.play(), - isPlaying: snapshot.data?.playing ?? false, - ); + .isLinkProcessing, + builder: (context, snapshot2) { + return snapshot2.hasData && + snapshot2.data == true + ? Container( + decoration: const BoxDecoration( + boxShadow: [ + BoxShadow( + color: + Default_Theme.accentColor2, + spreadRadius: 1, + blurRadius: 20) + ], + shape: BoxShape.circle, + color: Default_Theme.accentColor2, + ), + width: 75, + height: 75, + child: const Center( + child: SizedBox( + width: 35, + height: 35, + child: CircularProgressIndicator( + color: + Default_Theme.primaryColor1, + ), + ), + )) + : StreamBuilder( + stream: context + .watch() + .bloomeePlayer + .audioPlayer + .playerStateStream, + builder: (context, snapshot) { + return PlayPauseButton( + size: 75, + onPause: () => musicPlayer.pause(), + onPlay: () => musicPlayer.play(), + isPlaying: + snapshot.data?.playing ?? false, + ); + }); }), InkWell( onTap: () => musicPlayer.skipToNext(), diff --git a/lib/services/bloomeePlayer.dart b/lib/services/bloomeePlayer.dart index 7ba2bd4..efdb565 100644 --- a/lib/services/bloomeePlayer.dart +++ b/lib/services/bloomeePlayer.dart @@ -14,6 +14,8 @@ class BloomeeMusicPlayer extends BaseAudioHandler List currentPlaylist = []; BehaviorSubject currentQueueName = BehaviorSubject.seeded("Empty"); + + BehaviorSubject isLinkProcessing = BehaviorSubject.seeded(false); int currentPlayingIdx = 0; bool isPaused = false; @@ -100,6 +102,8 @@ class BloomeeMusicPlayer extends BaseAudioHandler if (mediaItem.extras?["source"] == "youtube") { audioPlayer.seek(Duration.zero); audioPlayer.stop(); + isLinkProcessing.add(true); + final tempStrmVideo = await YouTubeServices() .getVideoFromId(mediaItem.id.replaceAll("youtube", '')); if (tempStrmVideo != null) { @@ -114,6 +118,7 @@ class BloomeeMusicPlayer extends BaseAudioHandler getLinkOperation.then((tempStrmLinks) { audioPlayer.setUrl(tempStrmLinks.first).then((value) { + isLinkProcessing.add(false); if (super.mediaItem.value?.id == mediaItem.id && !isPaused) { audioPlayer.play(); } diff --git a/pubspec.yaml b/pubspec.yaml index 3e46c28..3552b04 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.2.1+0 +version: 1.2.2+0 environment: sdk: '>=3.0.6 <4.0.0'