DLNA / UPnP AVTransport casting is picky about the play URL. Practical constraints (same idea as PlainAPP):
- Use HTTP in LAN (many TVs reject self-signed HTTPS)
- Keep URL short
- Avoid query strings / special characters
- Prefer a simple
name.ext(some TVs key off the extension)
PlainNAS accepts a URL in dlnaCast(...). If the URL is our own file endpoint:
- Input (UI-friendly):
GET /fs?id=<encrypted>
Then PlainNAS rewrites it to a DLNA-friendly URL:
- Output (TV-friendly):
GET /media/<aliasId>.<ext>
How it works:
- Decrypt
id-> real filesystem path - Create an in-memory alias (TTL 30min)
- Send
http://<host>:<http_port>/media/<aliasId>.<ext>to the renderer
- Must enable
server.http_port(rewrite needs a reachable HTTP listener) - TV must reach
<host>:<http_port>in the LAN - Only
/fs?id=...URLs are rewritten; external URLs are passed through
- The URL sent to the TV is
http://.../media/...(nothttps://..., not/fs?id=...) server.http_portis set and PlainNAS is listening on it- TV and server are on same network / no firewall blocking the port
/fs?id=...browser-friendly (encrypted id, supports thumbnails)/media/<aliasId>.<ext>DLNA-friendly (short, no query, created on cast)