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 - NodeJS utility for vMix
Note: The NodeJS utility for communicating with vMix is branched out in its own repository/package - See node-vmix for more info. This package is only for NodeJS applications.
The utilities consists 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.
The modules are coded as classes, meaning that they are constructed with specific parameters, e.g. that the instanciation of a connection needs a host and a port.
Description of modules
Interprets the tally info from the TCP service.
TcpTally.extractSummary(tallyString: string) (static): Extract summary of tally info.
// Tally info summaryprogram: Numberpreview: NumbernumberOfInputs: Number
TcpTally.extractInputs(tallyString: string) (static): Extract (full) info of inputs from tally.
Xml Api Data Parser
XmlApiDataParser.parse(xmlStringRaw) (static): Parse raw XML string content to XML document.
Audio info from master and busses from the vMix instance state.
XmlAudio.all(xmlDocument) (static): Extract info for all audio channels (master + busses) from XML content.
XmlAudio.busses(xmlDocument) (static): Extract all audioBusses from XML content.
XmlAudio.master(xmlDocument) (static): Extract audio master channel info from XML content.
Xml General State
Get general state info from the vMix instance.
Constructor inputting complete xmlDocument from vMix API
const vMixGeneralState = new vMixGeneralState(xmlDocument)
Update with new data
string - Software version of vMix instance
string - Software edition of vMix instance
boolean - Is vMix instance recording?
boolean - Is multiCorder module recording in vMix instance
boolean - Is playlist module active in vMix instance
boolean - Is fullscreen active in vMix instance
Xml Input Mapper
Maps the inputs from the vMix instance state to JSON objects.
XmlInputMapper.extractInputsFromXML(xmlDocument) (static): Extract all inputs from raw XML data using XPath.
XmlInputMapper.mapInput(xmlDocument, wantedAttributes?) (static): Map single input from XML content to JSON object.
XmlInputMapper.mapInputs(xmlDocument, wantedAttributes?) (static): Map all inputs from XML content to JSON objects.
XmlInputMapper.mapTallyInfo(xmlDocument, wantedAttributes?) (static): Map all (extracted) inputs to JSON objects.
Xml Overlay Channels
XmlOverlayChannels.extract(xmlDocument) (static) - Returns a object of overlay channels state read from XML data.
// Overlay channels1: inputNumber: Number|null inPreview: Boolean2: inputNumber: Number|null inPreview: Boolean3: inputNumber: Number|null inPreview: Boolean4: inputNumber: Number|null inPreview: Boolean5: inputNumber: Number|null inPreview: Boolean6: inputNumber: Number|null inPreview: Boolean
XmlTransitions.extract(xmlDocument) (static) - Returns a object of transitions state read from XML data.
// Transitions1: effect: String duration: Number2: effect: String duration: Number3: effect: String duration: Number4: effect: String duration: Number
Installation and use
As a dependency using npm
The utilities are published at npmjs, meaning that you can easily add the utilities as a dependency in your frontend project. Found here: https://www.npmjs.com/package/vmix-js-utils
npm install vmix-js-utils --save # or 'yarn add vmix-js-utils'
In your code the simplest way to import the modules is the following:
const XmlApiDataParser XmlGeneralState =// ...
You are also able to import all of the modules as a gathered variable, less elegant way:
const vMixUtils =// ...
Standalone project / Fork
The code can be cloned and tested as needed from the source code.
git clone https://github.com/jensstigaard/vmix-js-utils.gitcd vmix-js-utils
npm install # or 'yarn'
npm build # or 'yarn build'
npm test # or 'yarn test'
Work in progress.
XML Input mapper
Jens Grønhøj Stigaard - firstname.lastname@example.org (http://jens.stigaard.info)
You are more than welcome to contribute to the repository!
- More examples
- More tests
- Perhaps more functionality