Pergunta

I'm trying to stream specific media to dlna/upnp compliant devices. I already found out how to send commands to devices using c#(e.g play, pause, stop etc.).

So, i can play media on a device. However, it's unclear to me how i tell the device what media to play. Is there a certain command for this?

I saw the "SetAVTransportURI" command but this takes a uri, i just want to play a video file from a shared directory on my network. How do i tell the device which media to play?

Foi útil?

Solução

Per UPnP MediaRenderer spec (it's public, look up at www.upnp.org), AVTransport service is expected to take URI scheme file: only for internal protocol, which is largely unspecified and device specific (as written in the spec). In other words, you are allowed to SetAVTransportURI with file: only for things like "1st track on CD" or "Tuner station X". If you want remote connection, you must use protocol http-get, that is URI scheme http:. Setting up a simple webserver which will publish your shared directory should do the trick.

For this isolated part of UPnP (that is setting single, already known media URI, no browsing and no metadata like video name etc.) you don't need your server to know any special DLNA/UPnP services. As soon as you would like to have better-than-none user experience, look up some full blown UPnP MediaServer. There are some written in C# too.

Outras dicas

Check the wikipedia entry for the URI scheme on Windows.
Does your shared network directory also provide DLNA/UPNP services? Edit:In case there no UPNP service, you may look at this question regarding UPNP server functionality.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top