Git Product home page Git Product logo

music-client's Introduction

Music Client

Music client is an unoriginally named React app that integrates with my music API. It supports two different methods of installation: purely remote, where files are streamed from the music API, or local where a copy of the music files are stored on the machine hosting the music client.

Image of UI landing page

Features (non conclusive list)

  • Integration with Media Session APIs, which Chrome (first image) integrates with Windows (second image):

Image of UI landing page Image of UI landing page

Running

Local mode

Deploying the music-client in local mode means that the client keeps a copy of all the tracks locally, and streams them locally, rather than streaming them from the server.

Note that the below command has a few placeholders that need to be replaced. It is also using a docker volume to persist local copies of the tracks.

Also note that the local.music.file.location MUST end with a trailing slash.

Optionally, you can use the variable $HOST in the zuul.routes.music-api.url property, which will be expanded client side to window.location.origin. This could be useful if you host both the API and UI on the same origin, and want to be able to access the API and UI directly from the host (rather than using the CNAME configured for the host).

docker run --name="music-client" -e "zuul.routes.music-api.url"="SERVER_URL" -e "zuul.music-api.authorizationHeader"="AUTHORIZATION_HEADER" -e "music.file.source"="local" -e "device.name"="DEVICE_NAME" -e "server.port"="8080" -p "8080:8080/tcp" -v music:/music -e "local.music.file.location"="/music/" --name music --rm stevenmassaro/music-client

Here's an example of running in remote mode (where music is streamed from the server).

docker run --name="music-client" -e "zuul.routes.music-api.url"="SERVER_URL" -e "zuul.music-api.authorizationHeader"="AUTHORIZATION_HEADER" -e "music.file.source"="remote" -e "device.name"="DEVICE_NAME" -e "server.port"="8080" -p "8080:8080/tcp" --name music --rm stevenmassaro/music-client 

Other useful tools

  • https://github.com/evilpro/Taskplay - puts playback controls on the Windows taskbar
  • https://github.com/sakithb/media-controls - puts playback controls on the Ubuntu GNOME toolbar
  • https://github.com/randyrants/sharpkeys - allows remapping of keyboard keys (used to remap something useless, like scroll lock, to the "skip track" key)
    • If this won't work for you, you can use a simple AutoHotKey script to remap the F9 key to the "skip track" keyboard press (note that I am no AHK expert, so this might not be the best way to do this, but it does work for me on Windows 10):
      #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
      ; #Warn  ; Enable warnings to assist with detecting common errors.
      SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
      SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
    
      f9::
                      Send {Media_Next}
      Return
    

Architecture

In previous versions, the unique design of allowing both remote and local usage of the client demanded a complicated architecture, involving an API Gateway (provided via Spring Cloud Gateway).

Current versions of the app circumvent the need for any gateway (which was a performance detriment), by making calls to the backend using CORS.

music-client's People

Contributors

dependabot[bot] avatar stevenmassaro avatar

Watchers

 avatar

music-client's Issues

metadata service does not gracefully handle songs with no album art

2023-10-25T17:59:40.713Z ERROR 1 --- [nio-8081-exec-4] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0] with root cause

java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
        at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) ~[na:na]
        at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) ~[na:na]
        at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266) ~[na:na]
        at java.base/java.util.Objects.checkIndex(Objects.java:361) ~[na:na]
        at java.base/java.util.ArrayList.get(ArrayList.java:427) ~[na:na]
        at music.service.MetadataService.getAlbumArt(MetadataService.kt:116) ~[music-service-1.18.4.jar!/:1.18.4]
        at musicclient.endpoint.TrackEndpoint.getAlbumArt(TrackEndpoint.java:51) ~[classes!/:1.18.4]

track name should show in file upload window when replacing track

Currently the track ID shows up in the file upload window, this isn't super useful to the user, the title, artist, album would be more useful.

Consider adding a tostring method to the Track object and use the same tostring representation that is used on the purge into dropdown

silently load next song in queue

the next song could be loaded in a music player but is hidden by css, and then when the current song ends, the next song immediately begins playing (and is already cached and ready)

artwork replacement wizard

Go through the songs that have never had their artwork replaced and prompt the user to replace them. It would be nice to do a comparison between the current artwork and the new artwork.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.