Skip to content

Commit 1f62642

Browse files
committed
Added Player#isReady
1 parent ff7f261 commit 1f62642

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • player/src/main/java/xyz/gianlu/librespot/player

player/src/main/java/xyz/gianlu/librespot/player/Player.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ public void removeFromQueue(@NotNull String uri) {
280280
@NotNull
281281
public Future<Player> ready() {
282282
CompletableFuture<Player> future = new CompletableFuture<>();
283-
if (state.isReady()) {
283+
if (isReady()) {
284284
future.complete(this);
285285
return future;
286286
}
@@ -756,6 +756,13 @@ public boolean isActive() {
756756
return state != null && state.isActive();
757757
}
758758

759+
/**
760+
* @return Whether the player is ready
761+
*/
762+
public boolean isReady() {
763+
return state != null && state.isReady();
764+
}
765+
759766
/**
760767
* @return A {@link Tracks} instance with the current player queue
761768
*/

0 commit comments

Comments
 (0)