meld-studio-websocket-js
v0.0.6
Published
Meld Studio Websocket Javascript API
Downloads
5
Maintainers
Readme
meld-studio-websocket-js
Meld Studio WebSocket controller built on slobs-websocket-js Updated last for Meld Studio version: 0.7.1.3
Installation
# NPM Install
npm install meld-studio-websocket-js
# Yarn Install
yarn add meld-studio-websocket-js
Usage
Untested in browser, currently supported in node.
Node Import Methods
// CommonJS
const MeldStudiosWebSocket = require("meld-studio-websocket-js");
Connecting
Address is optional
private connection: 127.0.0.1 | public connection: 0.0.0.0
Port is optional
default: 13376
const MeldStudioWebSocket = require('./libs/MeldStudiosWebSocket');
const meldStudio = new MeldStudioWebSocket();
meldStudio.connect({
address: '127.0.0.1',
port: 13376
})
meldStudio.test().then(data => {
console.log(data)
})
Requests
All available requests can be found below. Check the Meld Studio Streamdeck documentation if you want to look at the requests more in depth.
// A test function that will tell you if connected to Meld Studio and return Meld object.
meldStudio.test()
// This will return the current scene in Meld Studio.
meldStudio.findCurrentScene()
// Switches to the specified scene.
meldStudio.showScene('Scene Name')
// Toggles mute status of an audio track.
meldStudio.toggleMute('Audio Track Name')
// Toggles monitoring status of an audio track.
meldStudio.toggleMonitor('Audio Track Name')
// Toggles visibility of a layer within a scene.
meldStudio.toggleLayer('Layer Name')
// Toggles the enabled status of an effect within a layer.
meldStudio.toggleEffect('Layer Name', 'Effect Name')
// Toggles the recording status.
meldStudio.toggleRecord()
// Toggles the streaming status.
meldStudio.toggleStream()
// Registers an observer for changes to a specific track.
meldStudio.registerTrackObserver('Context', 'Track Name')
// Unregisters an observer for a specific track.
meldStudio.unregisterTrackObserver('Context', 'Track Name')
// Adjusts the gain for an audio track.
meldStudio.setGain('Audio Track Name', 0.0)
// Sends a custom event.
meldStudio.sendEvent("Screenshot")
// Prepares a scene for switching without making it live.
meldStudio.setStagedScene("Scene Name")
// Switches to the prepared staged scene.
meldStudio.showStagedScene()
// Shows status if you are streaming.
meldStudio.isStreaming()
// Shows status if you are recording.
meldStudio.isRecording()
// Listener - Returns session data.
meldStudio.sessionChanged()
// Listener - Returns boolean stating if you are streaming or not.
meldStudio.isStreamingChanged()
// Listener - Returns boolean stating if you are recording or not.
meldStudio.isRecordingChanged()
// Example
meldStudios.test().then(data => {
console.log(data)
})
Errors
WebSocket errors besides the initial socket connection will be thrown as uncaught errors. All other errors can be caught using .catch()
when sending request.