An UPnP/DLNA MediaRenderer client
Customized version of the upnp-mediarenderer-client.
The main reason for custom repo is customizing and fixing main package avoiding
different explanation steps which take loong time. Just push and use solution.
This module allows you to control an UPnP/DLNA MediaRenderer directly (usually your TV set). It implements load, play, pause, stop and seek commands.
Events coming from the MediaRenderer (ie. fired from the TV remote) such as playing
, paused
, stopped
can be listened to.
External subtitles are supported through DIDL-Lite metadata, but be aware that some MediaRenderers require the HTTP server serving the media file to return specific headers as illustrated in this gist. Also, some MediaRenderers don't support external subtitles at all.
Installation
$ npm install upnp-mediarenderer-client
Usage
var MediaRendererClient = ; // Instanciate a client with a device description URL (discovered by SSDP)var client = 'http://192.168.1.50:4873/foo.xml'; // Load a stream with subtitles and play it immediatelyvar options = autoplay: true contentType: 'video/mp4' metadata: title: 'Some Movie Title' creator: 'John Doe' type: 'video' // can be 'video', 'audio' or 'image' subtitlesUrl: 'http://url.to.some/subtitles.srt' /* Optional for LG TVs protocol have to be specified explicit */ protocolInfo : 'http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_BL_CIF15_AAC_520;' ; client; // Pause the current playing streamclient; // Unpauseclient; // Stopclient; // Seek to 10 minutesclient; client; client; client; client; client; client;