-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement support for the headless PlexAmp client
Added a container build for the headless PlexAmp client, this will allow a user to use the plex app on a mobile device to cast music from their media server to their Balena Sound device. Change-type: minor Signed-off-by: Lewis L. Foster <[email protected]>
- Loading branch information
Showing
5 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM balenalib/%%BALENA_MACHINE_NAME%%-node:12.22.9 | ||
|
||
|
||
RUN install_packages wget bzip2 | ||
|
||
# Audio block setup | ||
ENV PULSE_SERVER=tcp:localhost:4317 | ||
RUN curl -sL https://raw.githubusercontent.com/balenablocks/audio/master/scripts/alsa-bridge/debian-setup.sh | bash -s y | ||
|
||
WORKDIR /opt/plexamp | ||
ADD *.sh /opt/plexamp/ | ||
|
||
RUN chmod +x start.sh | ||
RUN chmod +x plexamp-setup.sh && ./plexamp-setup.sh | ||
|
||
ENTRYPOINT /opt/plexamp/start.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
if [[ -d "/root/.local/share/Plexamp/Settings" ]]; then | ||
echo "Plexamp appears to be already configured, skipping..." | ||
exit 1 | ||
fi | ||
|
||
echo "When prompted, enter your claim token from https://plex.tv/claim" | ||
echo "Plexamp will start after entering, simply press control+c and restart the plex service to continue." | ||
|
||
cd /opt/plexamp/plexamp/ | ||
|
||
node js/index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
wget "https://plexamp.plex.tv/headless/Plexamp-Linux-arm64-v4.2.2-beta.7.tar.bz2" -O "plexamp.tar.bz2" | ||
|
||
tar -xf plexamp.tar.bz2 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
if [[ -n "$SOUND_DISABLE_PLEX" ]]; then | ||
echo "Plex is disabled, exiting..." | ||
exit 0 | ||
fi | ||
|
||
if [[ ! -d "/root/.local/share/Plexamp/Settings" ]]; then | ||
echo "__________________________________________WARNING__________________________________________________" | ||
echo "| Plex is not configured! |" | ||
echo "| Please enter a shell into the Plex container and run `bash login.sh` to setup your credentials! |" | ||
echo "|_________________________________________________________________________________________________|" | ||
echo "" | ||
echo "Note: This is likely to change as headless Plexamp versions are released with new features." | ||
echo " Passing a claim token via a command line argument has been suggested, we will have to see." | ||
exit 1 | ||
fi | ||
|
||
echo "Starting Plex plugin..." | ||
|
||
cd /opt/plexamp/plexamp/ | ||
|
||
node js/index.js |