🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

vlc-simple-player

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vlc-simple-player

simple command-line vlc player with time and track status support via http interface

latest
Source
npmnpm
Version
0.5.1
Version published
Maintainers
1
Created
Source

VLC simple player

Simple module that starts VLC player via command-line together with HTTP interface enabled. It provides a unified API to start playing a file and to get information about current track.

Install

npm install vlc-simple-player --save

(Please note you'll need VLC binary installed in your system, you can download it on official website)

Example usage

var VLC = require('vlc-simple-player')

// start a fullscreen player
var player = new VLC('./path-to-your-movie/test.mp4')

// log current track time every second
player.on('statuschange', (error, status) => {
  console.log('current time', status.time)
})

Interface

  • new VLC(path[, options]) – starts a VLC player in fullscreen
    • path – string path to the video file ./test.mov
    • options – object with additional options
      • {password: String} will set a custom password for the HTTP interface (instead of random, which can be accessed by player.getPassword() method, btw)
      • {port: Number} will set a custom port for the HTTP interface (instead of default 8080)
      • {arguments: Array} will replace default command-line arguments (--fullscreen, --loop, --no-video-title)
  • player.on(eventName, callback) - registers an event
    • eventName – a string, available options are:
      • 'error' – stderr callback with error as an argument
      • 'statuschange' – callback that fires every second if the movie is playing
    • callback – a function with error and status object as an arguments
  • player.request(path, callback) - exposed request method to the VLC HTTP interface
    • path – a string, HTTP GET path with response in JSON format. For example: vlc.request('/requests/status.json?command=pl_pause') – toggles a pause. list of HTTP requests and interface description
    • callback – a function with error and status object as an arguments
  • player.process - exposed spawned process
  • player.quit() – stops the movie and close the player (via SIGKILL)

Contribution

Please feel free to submit a pull request for a bug fix or new features

Keywords

vlc

FAQs

Package last updated on 19 Jun 2022

Did you know?

Socket

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