[GH-ISSUE #201] Trying to get the example working #136

Closed
opened 2026-02-27 19:29:02 +03:00 by kerem · 5 comments
Owner

Originally created by @kbrah on GitHub (Apr 9, 2018).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/201

I'm new to rust and this library and I'm trying to get the example working but facing following error:

error[E0599]: no method named `load` found for type `(librespot::<unnamed>::player::Player, futures::sync::mpsc::UnboundedReceiver<librespot::<unnamed>::player::PlayerEvent>)` 
in the current scope
  --> src/main.rs:43:21
   |
43 |     core.run(player.load(track, true, 0)).unwrap();

What am I doing wrong?

Originally created by @kbrah on GitHub (Apr 9, 2018). Original GitHub issue: https://github.com/librespot-org/librespot/issues/201 I'm new to rust and this library and I'm trying to get the example working but facing following error: ``` error[E0599]: no method named `load` found for type `(librespot::<unnamed>::player::Player, futures::sync::mpsc::UnboundedReceiver<librespot::<unnamed>::player::PlayerEvent>)` in the current scope --> src/main.rs:43:21 | 43 | core.run(player.load(track, true, 0)).unwrap(); ``` What am I doing wrong?
kerem closed this issue 2026-02-27 19:29:02 +03:00
Author
Owner

@michaelherger commented on GitHub (Apr 10, 2018):

How do you call it?

<!-- gh-comment-id:379982914 --> @michaelherger commented on GitHub (Apr 10, 2018): How do you call it?
Author
Owner

@kbrah commented on GitHub (Apr 10, 2018):

I copied the example in the examples folder so exactly like that.

let player = Player::new(player_config, session.clone(), None, move || (backend)(None));

println!("Playing...");
core.run(player.load(track, true, 0)).unwrap();
<!-- gh-comment-id:380032578 --> @kbrah commented on GitHub (Apr 10, 2018): I copied the example in the examples folder so exactly like that. ``` let player = Player::new(player_config, session.clone(), None, move || (backend)(None)); println!("Playing..."); core.run(player.load(track, true, 0)).unwrap(); ```
Author
Owner

@kbrah commented on GitHub (Apr 11, 2018):

It also seems that the build in librespot with command cargo build --example play fails with the same error.

<!-- gh-comment-id:380597043 --> @kbrah commented on GitHub (Apr 11, 2018): It also seems that the build in librespot with command `cargo build --example play` fails with the same error.
Author
Owner

@kbrah commented on GitHub (Apr 15, 2018):

figured out the reason of the error: creating new player should be let (player, _) = ... instead of let player = ...

This should be updated in the example i guess.

<!-- gh-comment-id:381436600 --> @kbrah commented on GitHub (Apr 15, 2018): figured out the reason of the error: creating new player should be `let (player, _) = ...` instead of `let player = ...` This should be updated in the example i guess.
Author
Owner

@michaelherger commented on GitHub (Apr 16, 2018):

Good find! Please submit a pull request. Thanks!

<!-- gh-comment-id:381478255 --> @michaelherger commented on GitHub (Apr 16, 2018): Good find! Please submit a pull request. Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#136
No description provided.