Navel Pondering Mantra


    1.2.0 • Public • Published

    UPnP Remote

    NPM Version NPM Downloads

    Remote control for UPnP media devices (tv, speakers, amplifiers, network streamers).


    npm i node-upnp-remote


    const UPnPRemote = require('node-upnp-remote');
    const remote = new UPnPRemote({
      url: ''
    function volumeHandler(vol) {
      console.log('Volume', vol);
    await remote.on('Volume', volumeHandler);
    const volume = await remote.getVolume();
    await remote.setVolume(volume + 1);
    await'Volume', volumeHandler);


    UPnP Remote adds following events for convenience:

    • Transitioning
    • Playing
    • Paused
    • Stopped

    note that all events names start with a capital letter as it is defined in UPnP


    async setURI(options)

    loads the media file to the device. Options are:

    • protocolInfo – protocol information
    • upnpClass - string, or you can use const upnpclass = require('node-upnp-remote/upnpclass');
    • autoplay - boolean
    • uri – string, uri to the file
    • title – string, file title
    • creator - string, file creator


    • protocolInfo – protocol information
    • uri – string, uri to the file
    • metadata – object that reperesent metadata XML. Example:
      "@id": 0,
      "@parentId": -1,
      "@restricted": false,
      "upnp:class": "object.item.audioItem",
      "dc:title": "Title",
      "dc:creator": "Artist",
      "res": {
        "@protocolInfo": "http-get:*:video/mp3:*",
        "#text": ""

    Properties names start with '@' will be parsed as attributes in the XML

    async on(eventName, listener)

    adds UPnP event listener

    async off(eventName, listener)

    removes UPnP event listener

    async removeAllListeners()

    removes all listeners from all UPnP events

    async play(speed = 1)

    sets the play speed, default is 1

    async pause()

    pauses current playback

    async stop()

    stops current playback

    async seek(seconds)

    sets the playback time to seconds

    async next()

    switches to next track

    async previous()

    switches to previous track

    async getVolume(channel = 'Master')

    Gets the volume for the channel

    async setVolume(volume, channel = 'Master')

    Sets the volume for the channel

    async getMute(channel = 'Master')

    gets the mute state for the channel

    async setMute(state, channel = 'Master')

    sets the mute state for the channel

    async getProtocolsInfo()

    returns the supported protocols

    async getMediaInfo()

    returns the current media info

    async getPositionInfo()

    returns the current position

    async getTransportInfo()

    returns the transport info

    async getTransportSettings()

    returns the transport settings

    async getDeviceCapabilities()

    returns the device capabilities

    License MIT


    npm i node-upnp-remote

    DownloadsWeekly Downloads






    Unpacked Size

    15.5 kB

    Total Files


    Last publish


    • velocityzen