Skip to content

JavaScript utilities for vMix to read state of vMix instance

License

Notifications You must be signed in to change notification settings

jensstigaard/vmix-js-utils

Repository files navigation

vMix-js-utils

package json version npm version npm downloads

NPM Badge

vMix API utility library for Javascript can be used in either frontend or backend applications (Node,js).

It is recommended to import the package as a NPM package. Alternatively you can download the source code and included it as a library manually.

OBS - Node.js utility for vMix

Note: The Node.js utility for communicating with vMix is branched out in its own repository/package - See node-vmix for more info. The node-vmix package is only for Node.js applications, used for easy connection to vMix instances.

This library can be used both in front-end and Node.js projects.


Simple use

// Import all XML API functionality
import { XmlApi as vMixXmlApi } from 'vmix-js-utils'

// Import specific XML API functionality from the (sub)module
import { DataParser, Inputs } from 'vmix-js-utils/xml-api'

Purpose

This library is a set of utilities consisting of several modules. Each can be used on its own, but usually it makes more sense to make it interplay with some of the other modules. This is demonstrated in the examples.

The modules are coded as classes, meaning that they are constructed with specific parameters.

The source code is written in TypeScript, and compiled to javascript to allow it to be used as a npm package. It includes type declarations for TypeScript support, meaning that you can type defer i.e. the input types.

Documentation

Please read the documentation.

Installation and use

As a dependency using npm (or yarn)

The library is published at npmjs as a package, meaning that you can easily add the utilities as a dependency in your project. Found here: https://www.npmjs.com/package/vmix-js-utils

npm install vmix-js-utils --save
# or 'yarn add vmix-js-utils -d'

In your code the simplest way to import the modules is the following:

// ES6
import { DataParser, GeneralState } from 'vmix-js-utils/xml-api'

// or commonjs
const { DataParser, GeneralState } = require('vmix-js-utils/xml-api')
// ...

Standalone project / Fork

The code can be cloned and tested as needed from the source code. It is especially useful when deveoping and extending the functionality.

git clone https://github.com/jensstigaard/vmix-js-utils.git
cd vmix-js-utils

To run the project as standalone locally, you may want to first install the dependencies

npm install # or 'yarn'

Compile TypeScript source code to JavaScript code

npm build # or 'yarn build'

Run tests

npm test # or 'yarn test'

Examples

Work in progress.

XML API

Inputs

Authors

(Jens Grønhøj Stigaard)[github.com/jensstigaard]

Contribution

You are more than welcome to contribute to the repository!

Roadmap

  • More examples
  • More tests
  • Perhaps more functionality