# vlc-rc-socket

> Control vlc player using Unix socket

Latest version **0.0.1** (published 2015-04-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install vlc-rc-socket
pnpm add vlc-rc-socket
yarn add vlc-rc-socket
bun add vlc-rc-socket
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2015-04-29 |
| First published | 2015-04-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Denis Vidyakin |
| Maintainers | meerkat |
| Keywords | vlc, Unix socket |

## Links

- npm: https://www.npmjs.com/package/vlc-rc-socket
- Repository: https://github.com/denisvidyakin/vlc-rc-socket
- Issues: https://github.com/denisvidyakin/vlc-rc-socket/issues
- npm.io page: https://npm.io/package/vlc-rc-socket

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2015-04-29

## README

# vlc-rc-socket

Simple module to control VLC player using a Unix socket.


## Installation

```bash
$ npm install vlc-rc-socket
```
The following shall be done once to enable and configure VLC Player RC Interface before start:
  - in *Preferences > Interface > Main Interfaces* check *Remote control interface*
  - in *Preferences > Interface > Main Interfaces > RC* check *fake TTY* and set path to socket file in *UNIX socket command input* field.

Make sure that VLC player has permissions to make and write files in this directory.



## Examples

```js
  //Getting started
  var vlc = require('vlc-rc-socket');

  vlcPlayer = new vlc.VlcPlayer();
  vlcPlayer.socketFile = 'vlc.sock';  //path to socket file
  vlcPlayer.autoRestore = true;       //reopen file if VLC player was crashed

  vlcPlayer
    .on('open', function(pid) {
      console.log('VLC player PID: ', this.vlcPID);
    })

    .on('err', function(err){
      console.log(err);
    })

    .on('state_change', function(stateInfo){
      // stateInfo object contains state name and info about opened media file

      console.log(vlcPlayer.currentState);
      console.log(stateInfo);
    })

    .on('close', function(code) {
      console.log('vlc was closed. Exit  code: ', code);
    });

  //Run VLC player. Argument - string to run VLC player from a command shell
  vlcPlayer.startVLC('/usr/bin/vlc');
```

### States

module has 4 states:

    - 'playerStarting': module executed command to run VLC player ('/usr/bin/vlc') and waits for VLC player to get started;
    - 'stopped': no media file is opened;
    - 'tryingToOpenFile': module sent openFile command to VLC player and waits for response;
    - 'playing': media file is opened.




## License

[MIT](LICENSE)

---
_Source: https://npm.io/package/vlc-rc-socket · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
