feat: internet radio player with presets, favorites and background playback - #123
feat: internet radio player with presets, favorites and background playback#123danijar2000 wants to merge 1 commit into
Conversation
09a1c9f to
2a7efd1
Compare
Add internet radio to BYDMate: a dedicated tab, a compact player on the Dashboard and a cell on the floating widget. Off by default — existing users see no change until they switch it on in Settings. Playback - RadioPlayerService is a Media3 MediaSessionService driving ExoPlayer. ExoPlayer rather than the framework MediaPlayer because most Russian stations serve HE-AAC (.aacp) mounts, which MediaPlayer fails to decode on DiLink — Radio Record and Русское Радио never started. - The session gives the media notification and the head unit's own transport buttons (steering wheel, dashboard) for free; RadioController is the app's single handle on it. - The whole station list is the player's playlist with repeat-all, so prev/next cycle stations and wrap at both ends. - Bounded retry with backoff re-prepares a dropped stream instead of giving up, which is the normal case in a moving car. Stations - Eight built-ins seeded on first open: Европа Плюс, Love Radio, Хит FM, Radio Record, Ретро FM, Дорожное радио, Радио Шансон, Наше Радио. - Logos for five of them are bundled as drawables, so a tile renders identically with no connectivity; the rest fall back to a colored monogram. - Users can add a station by hand, or search the public directories: radio-browser.info (open, community-maintained) and Radio Record's own catalogue, queried in parallel and merged. A source that fails contributes nothing rather than failing the search. Data saver - Settings toggle plays built-in stations from a lighter mount where one exists; stations added from a directory carry their own low_bitrate_url. - The swap happens at playback time and is never written to the database, so turning the setting off restores full bitrate with nothing to undo. A station the user re-pointed at their own stream is left alone. Data layer - RadioStationEntity + RadioStationDao behind RadioRepository. - AppDatabase migration 18 -> 19 creates radio_stations; schema 19.json checked in. RadioUrlValidator rejects malformed and non-HTTP(S) input. Tests - Migration18to19Test, RadioRepositorySeedTest, RadioEnabledDefaultTest, RadioUrlValidatorTest, RadioTracksTest, RadioDirectoryParseTest. Strings localized for en, pt, zh and ru. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Данияр, посмотрел PR внимательно. Работа серьёзная - сервис на Media3, миграция базы, тесты, тумблер выключен по умолчанию. Видно, что делал вдумчиво, спасибо за такой вклад. Но влить это в BYDMate я не готов, и дело не в качестве кода. Приложение - про данные машины и автоматизацию, я сознательно держу его в этих рамках: без стриминга, без внешних каталогов, без второй медиасистемы рядом со штатной. Радио тянет за собой ExoPlayer, аудиофокус рядом с голосовым агентом, поддержку потоков и логотипов - этот груз придётся нести годами, и он размывает то, за что люди ставят приложение. Что предлагаю. Твоё радио отлично живёт отдельным приложением - а BYDMate уже умеет с ним дружить: запуск тапом по виджету, из автоматизаций, голосом, а с версии 3.9 его можно держать в трети экрана рядом с навигатором через разделение экрана. Оформи его самостоятельным APK - добавлю ссылку в README и в Благодарности. Такая связка полезнее пользователям, чем всё в одном. PR закрою, но код не выбрасывай - как отдельное приложение это уже почти готовый продукт. |
Add an internet radio feature to BYDMate, available as a dedicated tab and as a compact player on the Dashboard.
Playback