virtual-pilot-consumer

Implementation of realtime communication protocol that aims control OTT and TV devices

Usage no npm install needed!

<script type="module">
  import virtualPilotConsumer from 'https://cdn.skypack.dev/virtual-pilot-consumer';
</script>

README

Virtual Pilot Consumer

This repository holds the Virtual Pilot creation tool which produces:

  • virtual-pilot-client
  • virtual-pilot-server

Each instance can stream video content, binary data, and transmit control signals that will be executed in order to control devices remotely. Each instance of Virtual Pilot was designed having in mind that the energy consumption and host device capabilities might be limited.

Virtual pilot client

Virtual pilot client is an implementation of Real Time Communication Protocol that aims to transmit and consume video stream latency free. Client can be summarized by the RTC manifest as RTC peer that is able to commit to connections sharing the video data stream, or send messages using binary data stream. Each client is capable of receiving said streams by connecting to one specific peer using unique identifier.

Virtual pilot server

Virtual pilot server is at its core the same instance of the Virtual pilot client but limited in its functionality and connected to listener instance that is designed to invoke incoming commands.

Commands

  • start - starts the server application and opens the listener instance
  • commit - commits the changes
  • build:dev - builds all the dev versions of the application
  • build:prod - builds all the prod versions of the application
  • build:dev:client - builds only dev client version of the application
  • build:dev:server - builds only dev server version of the application
  • build:prod:client - builds only prod client version of the application
  • build:prod:server - builds only prod server version of the application
  • lint - runs the linter, it will also sort all the class methods
  • lint:fix - runs the linter, forcing fixes, it will also sort all the class methods
  • pretty:watch - runs prettier spy on src folder

Configuration

All necessary configuration is done by editing the .env.example file supplied with the repository. In order to create your own configuration file, copy the .env.example and rename it to: .env

  • LISTENER_PORT - port used for a listener in the server instance, this port will be used for receiving and sending commands. Provide as number.
  • LISTENER_ENDPOINT - endpoint used for the listener in the server instance. Enclose within quotes, eg: '${value}'
  • LISTENER_REMOTE_CONFIG - LIRC configuration file for the remote used for the device manipulation. Enclose within quotes, eg: '${value}'
  • SERVER_HOST - server URI, where the Virtual Pilot Provider server is located. Provide without quotes
  • SERVER_PORT - port for the Virtual Pilot Provider server. Provide as number.
  • SERVER_PATH - path for the Virtual Pilot Provider server. Provide without quotes
  • SERVER_DEBUG - leave it at 0. Used only for debugging the WebRTC stun and turn communication. Provide as number (0 - 3).

Next step is to configure the src/config.js file providing the appropriate node elements that will be responsible for handling user interaction. HTMLNode list is visible either in src/template/client.html or src/template/server.html