Radio: estaciones en vivo mientras entrenás
Tests / test (push) Canceled after 0s
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
Tests / test (push) Canceled after 0s
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
Música tiene una sección **Radio**: estaciones en vivo por género (Workout/Rave, Techno/House, R&B/Soul, Latina, Hip-Hop, Reggae, Chill, Jazz, Rock, Electrónica), sin publicidad primero —SomaFM y Radio Paradise— y detrás el directorio público de radio-browser. Nada de esto suma dependencias: la lista la arma api/radio.js. Tres decisiones que no se ven en la pantalla y son las que hacen que funcione: - **El audio no pasa por el servidor.** La api entrega la lista y después no ve un byte: el teléfono habla con la estación. Sin ancho de banda, sin disco, sin copias. - **La URL del stream viene resuelta en la lista**, porque iOS sólo deja arrancar audio dentro del gesto del toque: cualquier cosa asíncrona entre el dedo y el play() es un botón que no hace nada, sin error en ninguna parte. - **El `<audio>` vive fuera de React** (lib/radio-player.js): un elemento dentro de un componente se desmonta con él, y eso es la música cortándose al cambiar de pantalla — justo lo que no puede pasar en medio de una serie. Barra arriba de la barra de pestañas con pausa (deja la estación donde estaba) y parar; Media Session pone estación, pista y controles en la pantalla bloqueada, y las canciones siguen con el teléfono en el bolsillo. Qué suena lo dicen SomaFM y Radio Paradise y nadie más: en el resto la barra muestra la estación en vez de inventar una pista. api/test/server-radio.test.js guarda las dos puertas (sesión obligatoria, `src`+`id` reconstruidos en vez de confiar en el objeto del cliente); RadioBar.test.jsx y el caso de la fila en Music.test.jsx guardan lo demás. También: radio.js en el COPY del Dockerfile —importar un archivo que no está copiado es un contenedor que arranca en ERR_MODULE_NOT_FOUND—, /api/radio y /api/radio/now (con /api/music/lookup, que faltaba) en la especificación, y docs/RADIO.md.
This commit is contained in:
1 parent
e1d28f971d
commit
48cf976635
22 files changed
+1662
-15
No files matched your search
@@ -159,6 +159,21 @@ a Mac and nothing more; nobody here does it for you. A signed build (TestFlight,
|
||||
additionally need an Apple Developer Program membership, the distribution certificate and profile,
|
||||
and an `-exportArchive` step — none of that is set up.
|
||||
|
||||
### Audio with the screen locked (the shells only)
|
||||
|
||||
The web app plays radio fine with the phone locked: **Safari and Chrome keep the audio alive
|
||||
underneath the page**, and Media Session puts the station and its controls on the lock screen. The
|
||||
packaged shells are a different story, and it is a config gap rather than a code one:
|
||||
|
||||
- **iOS** (`frontend/ios`) — the app needs `UIBackgroundModes: audio` in `Info.plist`. Without it,
|
||||
iOS suspends the WebView's audio a moment after the screen locks.
|
||||
- **Android** (`frontend/android`) — a WebView needs a foreground service (with a
|
||||
`mediaPlayback` type and its notification) to keep playing while the app is not in front;
|
||||
`android:foregroundServiceType` plus the service's own declaration, not a manifest flag alone.
|
||||
|
||||
Neither is set today, so **radio in a packaged build stops when the screen locks** — install the PWA
|
||||
instead (Add to Home Screen) if that matters, which is the recommended path here anyway.
|
||||
|
||||
### Release notes for maintainers
|
||||
|
||||
- Bump `versionName`/`versionCode` in `android/app/build.gradle` per release; keep them in
|
||||
|
||||
Reference in new issue
Block a user