npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@stronk-tech/react-librespot-controller

v0.1.9

Published

`go-librespot` squeezebox-alike web frontend for small touchscreens

Downloads

1,898

Readme

react-librespot-controller

NPM NPM NPM NPM GitHub License Dependabot Updates

go-librespot squeezebox-alike web frontend for small touchscreens

Can be deployed standalone or imported as a NPM module.

The player is styled in the Tokyo Night colour scheme except for the album image, which emits an ambilight effect based on the colours in the image.

Install go-librespot

TODO: refer to OG source instructions + explain systemd script

[Unit]
Description=Spotify daemon
Documentation=https://github.com/devgianlu/go-librespot
Wants=sound.target
After=sound.target
Wants=network-online.target
After=network-online.target

[Service]
WorkingDirectory=/home/pulseaudio/go-librespot
ExecStart=/usr/local/go/bin/go run /home/pulseaudio/go-librespot/cmd/daemon
Restart=always
RestartSec=12

[Install]
WantedBy=default.target

Config go-librespot

TODO: instructions to enable the API

Make sure to mention the bind address.

Standalone

Create a .env file and fill in you API endpoints

REACT_APP_API_BASE_URL=http://apollo:3678
REACT_APP_WS_URL=ws://apollo:3678/events

Run npm run test for local debugging. Run npm run static to generate the build folder.

TODO: build instructions

TODO: nginx instructions. Include HTTPS instructions with local IP whitelist (+hairpin nat)

TODO: OS instructions (auto-login, open browser, etc)

Module

First install the dependency:

npm install --save `@stronk-tech/react-librespot-controller`

Then import the component and fill in your API endpoints:

import MediaPlayer from "@stronk-tech/react-librespot-controller";
<MediaPlayer websocketUrl={"ws://apollo:3678/events"} apiBaseUrl={"http://apollo:3678"} hideOnDisconnect={false} />

Props

  • hideOnDisconnect: When true, the entire component will hide itself when there is no connection to the API endpoint. Otherwise it will display an error state.
  • websocketUrl: Full URL to the WebSocket endpoint of the go-librespot client.
  • apiBaseUrl: Full URL to the HTTP API endpoint of the go-librespot client.
  • kioskMode: When true, the component will fill the entire screen. Otherwise it will fill the available width and base the layout on the width only. It is recommended to leave this option false when importing the module into an existing webpage and to true when you are running the player standalone on a touch screen.
  • layout: Can be auto, default, widescreen, portrait. See the screenshots for how the layouts look like.

Screen shots

The player arranges itself based on the screen dimensions, with three possible layouts:

Default layout

Default

Widescreen

Wide1 Wide2 Wide3

Portrait

Portrait