dlnacasts2 is a fork of grunjol's now abandoned dlnacasts. This version includes minor improvements, including the addition of setTimeout() to fix situations where a search would conclude before clients had an opportunity to respond.
Query your local network for DLNA media renderers and have them play media
API (and code) based on mafintosh/chromecasts for DLNA
npm install dlnacasts2
var dlnacasts = require('dlnacasts2')()
dlnacasts.on('update', function (player) {
console.log('all players: ', dlnacasts.players)
player.play('http://example.com/my-video.mp4', {title: 'my video', type: 'video/mp4'})
})
Creates a dlna list.
When creating a new list it will call list.update()
once.
Updates the player list by querying the local network for DLNA renderer instances.
Emitted when a new player is found on the local network
Make the player play a url. Options include:
{
title: 'My movie',
type: 'video/mp4',
dlnaFeatures: "DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01100000000000000000000000000000", // this enables seeking in some dlna devices
seek: seconds, // start by seeking to this offset
subtitles: ['http://example.com/sub.vtt'], // subtitle track 1,
autoSubtitles: true // enable first track if you provide subs
}
Enable subtitle track. Use player.subtitles(false)
to disable subtitles
Make the player pause playback
Resume playback
Stop the playback
Seek the video
Get a status object of the current played video.
Emitted when a status object is received.
MIT