Contributing to VLC for Android
VLC for Android has a feature called Remote Access: the app runs a small web server (built on Ktor) so you can browse your library and control playback from a browser on the same network. I use it, and I ran into a few rough edges, so I fixed them. This page collects my contributions to the project and will grow as I send more.
Remote Access fixes — December 2026
Three merge requests, all merged on 2026-12-02.
Send the current state when a client connects — !2503
The web client opens a websocket and says hello. The server ignored it:
HELLO -> {}
The client only learned what was playing when the next playback event came through. If the media was paused, no event ever came, so after a page reload the mini player stayed hidden and you could not resume the paused media from the browser.
The fix replies to hello with the play queue, the player status and the now playing info — the same thing the long polling endpoint already did.
Fix the session expiration — !2504
Logging in to Remote Access means typing a code shown on the device. You then get a session that should last a year in release builds. In practice it was asking for a new code every few hours. Two bugs were behind it.
A unit mixup. maxAge is in seconds (it is also used as the cookie’s maxAgeInSeconds), but it was added to System.currentTimeMillis():
// in seconds
val maxAge = if (BuildConfig.DEBUG) 4 * 3600L else 3600L * 24L * 365L
- it.maxAge = System.currentTimeMillis() + maxAge
+ it.maxAge = System.currentTimeMillis() + maxAge * 1000
Sessions expired 1000 times too early: a year became about 8.8 hours, and the 4 hour debug session became about 14 seconds.
Expired sessions were accepted anyway. getSessions() saved the filtered list but returned the unfiltered one:
adapter.fromJson(sessionsString)?.let {
saveSessions(settings, it.filter { it.maxAge > System.currentTimeMillis() + 3600 })
return it
}
The login check then accepted the expired session and, when refreshing its expiration, saved the unfiltered list back, bringing every expired session back to life. Whether an expired session was rejected depended on whether some other request happened to trim the list first. The + 3600 margin was also a leftover in the wrong unit: in milliseconds it only rejected sessions 3.6 seconds early. The fix returns the filtered list and drops the margin.
Validate sessions in the authentication provider — !2506
Ktor’s session authentication provider accepted any session found in the session storage, and the real check against the stored valid sessions was a verifyLogin() call at the top of each route. A route that forgot to call it was only protected by the provider.
This change moves the check into the provider’s validate block: the session is looked up in the stored valid sessions, its expiration is refreshed, and it is cleared from the session storage when it’s no longer valid. Every authenticated route now gets the same check, and verifyLogin() was removed from all the routes — 55 lines out, 20 in.
Built with AI
These contributions were made with AI. I worked with Claude, Anthropic’s AI assistant, using Claude Code in the terminal. Claude read through the Remote Access code, tracked down the bugs and wrote the fixes and commit messages. I directed the work, tested the changes, and submitted and followed the merge requests through review. Each commit carries a Co-Authored-By: Claude trailer, so the AI involvement is visible in the project’s history too.
Thanks to the VideoLAN team for the quick reviews.