[Feature]: Android app: watch and listen together, deep links
Um pull request relacionado já foi integrado.
- #59 de @PhrolovaMoe — integrado
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 20/100
- Tipo de issue
- Funcionalidade
- Clareza
- Claramente especificada
- Status de atividade
- Estagnada
- Stack de tecnologia
- android, react-native, typescript
- Domínio
- backend-api-design, distributed-systems, mobile
Direção de pesquisa
Read epic #40 and the prerequisite issues #45 and #46 first; inspect the named web entry points web/src/routes/together.$code.tsx, player/Room.tsx, player/sync.ts, routes/listen.$code.tsx and music/listen.ts. The issue also names packages/shared as the destination for shared protocol logic. Done means implementing the listed Android room, link, guest and notification flows while preserving web behavior and meeting the sync, queue, sharing and Live Update acceptance criteria; a linked merged PR indicates work has already proceeded.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
[!NOTE]
This issue was written by Claude (Claude Opus 5.5) from a planning session with @PhrolovaMoe. Part of #40, builds on #45 and #46. Read the epic first.
Area
Streaming / playback
Problem
Watch together (web/src/routes/together.$code.tsx, player/Room.tsx, player/sync.ts) and listen together (routes/listen.$code.tsx, music/listen.ts) are core features. Rooms are joined through links, often by people who aren't signed in (public rooms allow named guests). The app has to speak both protocols, open room links, and let guests in.
Proposed solution
Protocols (facts; no server changes)
- Watch: a WebSocket at
/api/together/{code}/ws?name=<guest name>. Listen:/api/listen/{code}/ws?name=…. Both are plain JSON, not GraphQL. - The server authenticates the upgrade from the
Authorization: Bearerheader (or cookie). Guests are allowed into public rooms with aname(src/api/together.rs:27-39). - Messages are as in
sync.ts(Outgoing:ping,play/pause/seek,rate,status,tracks,media,name,settings,invite,end) andlisten.ts(plusskip,queue,add,remove,move). - The welcome message carries
serverTimefor clock sync. - Room media goes through room-scoped routes (
/api/together/{code}/media/{id}/…,/api/listen/{code}/tracks/{id}/…, room avatars and art), which work for guests.
Sharing code with web
- Move the platform-independent parts of
sync.tsandlisten.tsintopackages/shared, and make web use them too:- message types
- clock-offset estimation from the quickest recent round trips
- the snapshot model
- reconnect/backoff
- the drift-correction rules
- Inject the WebSocket constructor, the clock (
performance.timeOrigin + performance.now()on web, a monotonic clock on Android), and media control. - React Native's
WebSocketaccepts headers on Android (new WebSocket(url, undefined, { headers })). Use it for the Bearer token. - Web behaviour must not change.
Watching together
- The #45 player screen with the web
Room.tsxfeatures:- participants with avatars and status
- control mode (everyone/host), wait-for-all, public toggle
- invite users (
invite), copy/share the link, end the room RoomNotices, tap-to-join, and the room's own track selection (tracks)
- Phone presentation: a participants pill in the player's top bar, which opens a bottom sheet with people, settings and invite. Join/leave notices are toasts over the video.
- Sharing uses the Android share sheet with the room's https web URL (it works for people without the app).
- Drift correction drives the #45 module API (
seek,setRate,play/pause) assync.tsdrives<video>today.
Listening together
- A room screen like
listen.$code.tsx: Now Playing-style art, shared queue (add/remove/move with the reorder haptics), participants, invite, settings, and the ambient tint. - Playback goes through the #46 engine through
followRemote(shared in #46). The mini-player shows the room while you're in it.
Live Update for sessions
- While in a room, post a promoted ongoing notification (Android 16 Live Update; a normal ongoing notification on 14/15):
- "Watching together · 3 people" or "Listening together · 3 people", with the host's name
- tap to return to the room, and a "Leave" action
- Update it when people join or leave. Remove it when you leave or the room ends.
- Media playback keeps its media notification as well.
Deep links
- Custom scheme, handled with Expo Router linking:
tinystream://<host[:port]>/together/<code>tinystream://<host[:port]>/listen/<code>tinystream://<host[:port]>/title/<id>,/album/<id>,/artist/<id>,/playlist/<id>,/c/<code>(public clip pages, #49)- The scheme means https. Add
?insecure=1for http servers.
- Share to the app: an intent filter for
ACTION_SENDwithtext/plain. If the shared text contains a URL whose path matches one of the routes above (the web UI's paths are the same), handle it as the custom-scheme link for that origin. This is how "open a tinystream link in the app" works for any self-hosted domain. Verified https App Links can't be used, because they need every domain declared in the APK at build time. - Web UI change: on Android browsers (UA check), the web's together, listen and public clip pages show a small dismissible "Open in the app" banner linking to the matching
tinystream://URL. Dismissal is remembered in localStorage.
Resolving a link:
- If the link's origin matches a saved server, switch to it (#42 rules), then:
- signed in → open the screen
- room link and signed out → the guest flow
- anything else and signed out → sign in, then continue
- If it's an unknown server:
- room links → the guest flow
- other links → offer "Add this server" (#42 connect flow pre-filled), then continue
Guest flow:
- A sheet: "Join room title on server as a guest". A name field, prefilled with the last guest name used on this device, plus Join.
- Guests connect without a token and aren't added to the saved server list (offer "Add this server" after leaving).
- While joined as a guest, the rest of the app keeps showing the user's own active server. The room screen is modal over it.
Acceptance criteria
- Phone and web in the same watch room stay in sync (play, pause, seek, rate, and the correction after a stall), both as a signed-in user and as a guest.
- The same for listen rooms, including queue edits from either side.
- Sharing a room link from the browser to the app joins it.
adb shell am start -d "tinystream://host/together/CODE"joins. An unknown server leads to the guest flow. - The Live Update shows the participant count and Leave works.
- The web "Open in the app" banner appears on Android only.
- Linguagem predominante
- TypeScript
- Estrelas
- 4
- Forks
- 1
- Merge médio
- 4h 49min
- PRs com merge (30d)
- 5
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Sem modelo de pull request
- Sem guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de tinystream-dev/tinystream
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
tinystream-dev/tinystream#132 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
tinystream-dev/tinystream#131 ·
-
bug
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
tinystream-dev/tinystream#129 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
tinystream-dev/tinystream#128 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
tinystream-dev/tinystream#124 ·
Todas as issues de tinystream-dev/tinystream
Issues semelhantes
-
Console writes URL credentials to the local log, though AGENTS.md says secrets never reach diskAberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 86/100
sandbox-quantum/switch#2163 ·
Mantenedores costumam responder em até 1 dia
-
automated issue report
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
area/dashboard kind/bug QA/dev-automation
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
bug pydanty:is-working
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
pydantic/pydantic-ai#13939 ·
Mantenedores costumam responder em até 1 dia
-
self-host
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
funmusicplace/mirlo#2625 ·
Mantenedores costumam responder em até 1 dia