# bring it up now (it will also auto-start on every boot from here on)
sudo nmcli connection up mediapi-ap
# verify
nmcli connection show mediapi-ap
ip addr show wlan0
```
To remove it later: `sudo nmcli connection delete mediapi-ap`
# app to browse media
media will be stored at
* /localmedia
* more TBD
I want an app that runs on the raspbery pi with two modes:
* playback
* control
the app should have two buttons up top that show the two modes all the time. the manager will switch back and forth between the two. the rest of the screen will be used to show the content. Must fit on one phone screen
## control mode
* shows the media stores
* the user can click on any one of them to "go" inside the folder
* at any point in time the user can chose to "play" a folder, or a file (how TBD)
* radio buttons up top of that panel (below and separately from the two global modes)
* keep playing
* more TBD
* has basic navigation (pretty buch go back one level at the time)
## playback mode:
* display the file being played
* displays playback info (current time, total video time), volume control
* pause/play, back and fast forward 30 seconds (or whatever you can get on the framework you use)
* plays on both HDMI mirrored if connected.
## basic auth
user: jujualexevan
pw: bambas
fine to keep known devices logged in forever pretty much
easy to run ... I don't want to have to download a gazillion things
## Setup (mediapi app)
Implemented as a small Flask app (`mediapi/`) + a permanently-running `mpv`
player controlled over its JSON IPC socket. mpv renders video to HDMI
directly (DRM/KMS, no desktop needed); the phone browser only shows
metadata/controls, never the video image itself.
```bash
# system deps: mpv for HDMI/DRM playback
sudo apt update
sudo apt install -y mpv
# mpv needs access to the GPU/DRM devices to render to HDMI
sudo usermod -aG video,render jm
# log out/in (or reboot) for the new group membership to take effect
# install uv (Python package/venv manager) if not already present
curl -LsSf https://astral.sh/uv/install.sh | sh
# installs to ~/.local/bin/uv -- confirm with `which uv`; if it differs,
# update the ExecStart path in systemd/mediapi-app.service to match
cd /home/jm/mediapi
uv sync # creates .venv and installs dependencies from pyproject.toml
# install the two systemd services (mpv player + the web app)