Add player functionality with HLS support and API integration
- Implemented a new Player class in player.js to handle audio playback, including HLS support using hls.js. - Created a shared API module in api.js for making HTTP requests with proper error handling. - Added DOM utility functions in dom.js for creating and clearing elements. - Introduced WebSocket connection handling in ws.js for real-time updates. - Developed a comprehensive CSS stylesheet for styling the application, including a high-contrast theme.
This commit is contained in:
34
deploy/README.md
Normal file
34
deploy/README.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# Raspberry Pi deployment
|
||||
|
||||
## 1. Install Node 20+ and clone the repo
|
||||
```bash
|
||||
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
||||
sudo apt-get install -y nodejs build-essential python3
|
||||
git clone <repo> /home/pi/onlineRadioExplorer
|
||||
cd /home/pi/onlineRadioExplorer
|
||||
cp .env.example .env # edit secrets
|
||||
npm ci
|
||||
npm run build
|
||||
```
|
||||
|
||||
## 2. Service
|
||||
```bash
|
||||
sudo cp deploy/oradio.service /etc/systemd/system/oradio.service
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable --now oradio
|
||||
journalctl -u oradio -f
|
||||
```
|
||||
|
||||
App listens on `PORT` (default 4173). Open `http://<pi-ip>:4173/` for the kiosk
|
||||
and `http://<pi-ip>:4173/admin/` for admin.
|
||||
|
||||
## 3. Kiosk autostart (Chromium on Raspberry Pi OS)
|
||||
Edit `~/.config/lxsession/LXDE-pi/autostart` (or wayfire `[autostart]`):
|
||||
|
||||
```
|
||||
@chromium-browser --kiosk --noerrdialogs --disable-infobars --app=http://localhost:4173/
|
||||
```
|
||||
|
||||
Rotate the touchscreen to portrait via `/boot/firmware/config.txt`
|
||||
(`display_rotate=1`) or via the desktop display settings, then size the kiosk
|
||||
window/area to the 1080×660 region you reserved.
|
||||
16
deploy/oradio.service
Normal file
16
deploy/oradio.service
Normal file
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Online Radio Explorer
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=pi
|
||||
WorkingDirectory=/home/pi/onlineRadioExplorer
|
||||
EnvironmentFile=/home/pi/onlineRadioExplorer/.env
|
||||
ExecStart=/usr/bin/node server/index.js
|
||||
Restart=on-failure
|
||||
RestartSec=3
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user