dlnacasts
Query your local network for DLNA media renderers and have them play mediaAPI (and code) based on mafintosh/chromecasts for DLNA
npm install dlnacasts
Usage
var dlnacasts = require('dlnacasts')()
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'})
})
API
var list = dlnacasts()
Creates a dlna list.
When creating a new list it will call list.update()
once.list.update()
Updates the player list by querying the local network for DLNA renderer instances.list.on('update', player)
Emitted when a new player is found on the local networkplayer.play(url, [opts], cb)
Make the player play a url. Options include:{
title: 'My movie',
type: 'video/mp4',
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
}
player.subtitles(track, [cb])
Enable subtitle track. Use player.subtitles(false)
to disable subtitles