studiomonitor-api
v2.4.1
Published
A simple API that allows you to control the NDI Tools Studio Monitor
Downloads
3
Readme
StudioMonitor-API
This is simple API you can use to control a NDI Tools Studio Monitor. Studio Monitor is a free multi NDI Player that's includes in NDI Tools .
Usage
- Install the package using
npm install studiomonitor-api
- Import the module into your file with
const { StudioMonitor } = require("studiomonitor-api");
- Create a new instance of the StudioMonitor API with
var monitor = new StudioMonitor("127.0.0.1", 81)
Example
const { StudioMonitor } = require('studiomonitor-api');
var monitor = new StudioMonitor('127.0.0.1', 81, ready);
function ready() {
monitor
.getSources()
.then((sources) = > {
console.log('Sources:', sources);
if (sources.length > 0) {
monitor.setSource(sources[ i ]).then(() = > console.log('Set source')).catch(console.error);
}
})
.catch(console.error);
}
Documentation
new StudioMonitor( [ ipAddress ] , [ port ] , [ readyCallback(err?:Error) ] )
Create a new instance of the StudioMonitor API |Argument|Type|Description |-|-|-| |ipAddress|String|The IP address of the StudioMonitor| |port|Number|The port of the StudioMonitor.| |readyCallback|Function|Function that will be called when the API is ready. When something is wrong the first argument of the callback will contain an error.|
StudioMonitor.getSources() -> Promise< string[ ] >
Get a list of all available NDI sources.
StudioMonitor.getCurrentSource() -> Promise< void >
get the current NDI source.
StudioMonitor.setSource( [ sourceName ] ) -> Promise< void >
Set the current NDI source. |Argument|Type|Description |-|-|-| |sourceName|String|The name of the NDI Source|
StudioMonitor.setRecording( [ state ] ) -> Promise< void >
Set the recording state of the StudioMonitor. |Argument|Type|Description |-|-|-| |state|Boolean|Start/stop recording |
StudioMonitor.isRecording( [ state ] ) -> Promise< boolean >
Get the recording state of the StudioMonitor.
StudioMonitor.setLowBandwidth( [ state ] ) -> Promise< void >
Set the low bandwidth state of the StudioMonitor. |Argument|Type|Description |-|-|-| |state|Boolean|Start/stop low latency |
StudioMonitor.isLowBandwidth( [ state ] ) -> Promise< boolean >
Get the low bandwidth state of the StudioMonitor.
Todo
- Add more missing functions