Socket
Socket
Sign inDemoInstall

dlnacasts2

Package Overview
Dependencies
32
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dlnacasts2

Query your local network for DLNA enabled renderers and have them play media


Version published
Weekly downloads
373
increased by11.34%
Maintainers
1
Install size
0.985 MB
Created
Weekly downloads
 

Readme

Source

dlnacasts2

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

Usage

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'})
})

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 network

player.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

player.pause([cb])

Make the player pause playback

player.resume([cb])

Resume playback

player.stop([cb])

Stop the playback

player.seek(seconds, [cb])

Seek the video

player.status(cb)

Get a status object of the current played video.

player.on('status', status)

Emitted when a status object is received.

License

MIT

Keywords

FAQs

Last updated on 28 May 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc