JSPM

meld-studio-websocket-js

0.0.8
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9
  • Score
    100M100P100Q22980F
  • License ISC

Meld Studio Websocket Javascript API

Package Exports

  • meld-studio-websocket-js
  • meld-studio-websocket-js/libs/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (meld-studio-websocket-js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

meld-studio-websocket-js

Meld Studio WebSocket controller built on slobs-websocket-js Updated last for Meld Studio version: 0.9.1.8-13704359b

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 command.
meldStudio.sendCommand("recordClip")
// Supported events: recordClip, screenshot, startStreamingAction, stopStreamingAction, toggleStreamingAction, startRecordingAction, stopRecordingAction, toggleRecordingAction, toggleVirtualCameraAction

// 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.