- Rust 100%
|
|
||
|---|---|---|
| sample_client | Handle switching subscribed playlists better | |
| songweb | Update readme | |
| .gitignore | Cleanup Server/SwarmController, hosting state messages | |
| Cargo.lock | More code cleanup, improve errors, remove tokio dependecy from songweb | |
| Cargo.toml | Improve the example client interface | |
| COPYING | Initial commit | |
| README.md | Update readme | |
| specification.md | Add specification to repo | |
SongWeb
SongWeb is a prototype, proof-of-concept p2p protocol to allow peers to share music over a local network through shared, network-accessible playlists. It is built on top of the libp2p networking stack.
This repository consists of two parts: the reference library for the protocol in the songweb directory, and an example client in the sample_client directory.
Using The Example Client
To use the example client, it is required to have gstreamer installed, as well as all of gstreamer-plugins-good gstreamer-plugins-bad, and potentially gstreamer-plugins-ugly. gstreamer-rtsp-server must also be installed in order for streaming to work.
To run the client, clone the repository and in the top-level directory run the command
cargo run --bin sample-client -- -m path/to/some/music
with path/to/some/music replaced with a path to a directory containing music files. To demonstrate streaming capabilities, run another instance of the application with directory containing music not present in the directory for the first instance.
One important caveat is that there is a bug that I was not able to track down, leading me to believe that it could be a bug in libp2p itself, which causes peers to fail to connect to each other correctly. If, when subscribing to a remote playlist, a status message indicating that the action failed is shown, it is necessary to restart at least the instance of the application which posted the error. This bug is very annoying and many attempts to find the cause have sadly failed.
To use the application, navigation between and within panes can be done with the arrow keys, and enter to select or activate the selected item. In the library pane, enter will add the selected song to the local playlist, while alt+enter will add it to the subscribed playlist, if there is one subscribed. (Shift+enter is not picked up by the terminal backend for some reason)
In order to send song requests to another peer on the network, it is first necessary to subscribe to the peers playlist by selecting it in the "available playlists" pane.
Pressing space starts playing the local playlist, or pauses it if currently playing. Due to unfortunate time constraints any other form of playback control are not implemented at this time.