GithubHelp home page GithubHelp logo

fholzer / dlnacasts2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rslavin/dlnacasts2

0.0 0.0 0.0 33 KB

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

License: MIT License

JavaScript 100.00%

dlnacasts2's Introduction

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

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

dlnacasts2's People

Contributors

grunjol avatar cyberhck avatar rslavin avatar vipyne avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.