mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 16:05:18 +00:00
fix(play_overlay): show progress indicator on song loading
This commit is contained in:
parent
42b3e111f8
commit
7803a48237
@ -28,14 +28,6 @@ class PlayPauseAction extends Action<PlayPauseIntent> {
|
|||||||
if (playlist == null) {
|
if (playlist == null) {
|
||||||
return null;
|
return null;
|
||||||
} else if (!PlaylistQueueNotifier.isPlaying) {
|
} else if (!PlaylistQueueNotifier.isPlaying) {
|
||||||
// if (playlist.activeTrack is SpotubeTrack &&
|
|
||||||
// (playlist.activeTrack as SpotubeTrack).ytUri.startsWith("http")) {
|
|
||||||
// final track =
|
|
||||||
// Track.fromJson((playlist.activeTrack as SpotubeTrack).toJson());
|
|
||||||
|
|
||||||
// await playlistNotifier.play(track);
|
|
||||||
// } else {
|
|
||||||
// }
|
|
||||||
await playlistNotifier.play();
|
await playlistNotifier.play();
|
||||||
} else {
|
} else {
|
||||||
await playlistNotifier.pause();
|
await playlistNotifier.pause();
|
||||||
|
@ -27,6 +27,7 @@ class PlayerOverlay extends HookConsumerWidget {
|
|||||||
PlaylistQueueNotifier.provider.select((s) => s != null),
|
PlaylistQueueNotifier.provider.select((s) => s != null),
|
||||||
);
|
);
|
||||||
final playlistNotifier = ref.watch(PlaylistQueueNotifier.notifier);
|
final playlistNotifier = ref.watch(PlaylistQueueNotifier.notifier);
|
||||||
|
final playlist = ref.watch(PlaylistQueueNotifier.provider);
|
||||||
final playing = useStream(PlaylistQueueNotifier.playing).data ??
|
final playing = useStream(PlaylistQueueNotifier.playing).data ??
|
||||||
PlaylistQueueNotifier.isPlaying;
|
PlaylistQueueNotifier.isPlaying;
|
||||||
|
|
||||||
@ -87,7 +88,13 @@ class PlayerOverlay extends HookConsumerWidget {
|
|||||||
Consumer(
|
Consumer(
|
||||||
builder: (context, ref, _) {
|
builder: (context, ref, _) {
|
||||||
return IconButton(
|
return IconButton(
|
||||||
icon: Icon(
|
icon: playlist?.isLoading == true
|
||||||
|
? const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
width: 20,
|
||||||
|
child: CircularProgressIndicator(),
|
||||||
|
)
|
||||||
|
: Icon(
|
||||||
playing
|
playing
|
||||||
? SpotubeIcons.pause
|
? SpotubeIcons.pause
|
||||||
: SpotubeIcons.play,
|
: SpotubeIcons.play,
|
||||||
|
Loading…
Reference in New Issue
Block a user