When you press Cast in Yonto Player on an Android phone, one of the sections in the picker is DLNA: TVs, Kodi boxes and AV receivers that take a video address and play it. DLNA is UPnP underneath, and for a sender that means UDP multicast, a couple of XML documents and a handful of HTTP POSTs.
This post is about the sender side, what UPnP calls a control point, and how I wrote ours in Kotlin.
Why our own code
The protocol code is ours, in the shared touch UI module ( app/touch , package cast.dlna ), on top of the app's HTTP transport. The only platform part is the UDP search itself. The Android libraries I looked at carry a whole UPnP stack, server side included, under the LGPL, for what turned out to be a handful of small requests. That did not seem worth it, so the protocol is under a thousand lines of plain Kotlin, and DlnaCast hands a renderer to the same cast interface that Google Cast and AirPlay use.…