Skip to main content

Input

Inputs can be declared by calling new Input with the appropriate arguments.

const imageSource = new Input({
kind: "image_source", // The kind of the input
name: "Image Input", // Name of the input in OBS
// Must be unique among all sources
});

The sources pacakge contains helper classes that have type definitions and input kinds built into them.

const { ImageSource } = require("@sceneify/sources");

const imageSource = new ImageSource({
name: "Image Source",
// kind is no longer necessary, since it is provided by ImageSource
});

Inputs Don't Create Themselves​

Declaring a source with new Input does not create the source in OBS. In fact, inputs never create themselves. Instead, it is the responsibility of scenes to detect if an input already exists, and create it if necessary.

Inputs have two properties that you can use to check if they have been processed by a scene:

  • exists: Whether the input exists in OBS
  • initialized: Whether a scene has checked if the input exists in OBS

Properties​

In addition to the two properties above, inputs have a number of other properties:

  • name: The name of the input
  • kind: The kind of the input

These properties can be set with their associated functions: