Class: Device

Device

new Device(atemIpAddressopt)

Provides an easy way to connect to an ATEM. If a valid IP address is provided, Device#connect will be called automatically.
Parameters:
Name Type Attributes Description
atemIpAddress String <optional>
The ip address of the ATEM to connect to.
Source:

Members

ip :String

The ip address of the ATEM
Type:
  • String
Source:

state :ConnectionState

The current state of the connection. For more information about the possible values see ConnectionState
Type:
  • ConnectionState
Source:

(inner) commandQueue :Array.<Command>

Commands we need to send to the atem
Type:
Source:

(inner) commandTimer :Timeout

A timer to ensure commands are sent within 16 milliseconds
Type:
  • Timeout
Source:

(inner) communicationTimeout

The timeout of the last received ATEM packet. Used to detect connection loss.
Source:

(inner) incomingPackets :Array.<AtemPacket>

Packets the ATEM sent and have yet to be acknowledged
Type:
Source:

(inner) ls :Number

The current local sequence number. Local sequence numbers are used to identify sync packets we send to the ATEM.
Type:
  • Number
Source:

(inner) pendingPackets :Array.<UserPacket>

Packets we sent to the ATEM but for which we received no acknowledgement yet.
Type:
Source:

(inner) socket

Create a UDP v4 socket
Source:

(inner) syncInterval :Timer

A timer to assure there is a sync message sent every 600 milliseconds.
Type:
  • Timer
Source:

(inner) uid :number

Unique identifier A temporary uid is generated to make a connection. When connected, the ATEM will provide another uid for us
Type:
  • number
Source:

Methods

changeSourceConfiguration(sourceID, options)

Changes the specified options of the Source Configuration. Note that you don't need to specify all the properties of SourceConfiguration.
Parameters:
Name Type Description
sourceID SourceID
options SourceConfiguration
Source:

connect()

Initiate a new connection. If already connected it will first disconnect.
Source:

cut()

Performs a cut transition between preview and program
Source:

setPreview(sourceID)

Sets the desired source in preview
Parameters:
Name Type Description
sourceID SourceID the ID of the source
Source:

setProgram(sourceID)

Sets the desired source in program. (cut transition)
Parameters:
Name Type Description
sourceID SourceID the ID of the source
Source:

(inner) getPendingPacket(ls) → {UserPacket}

Find a pending packet by local sequence number
Parameters:
Name Type Description
ls Number Local sequence number
Source:
Returns:
The packet
Type
UserPacket

(inner) handleQueue()

Sends a packet with all the remaining command of the commandQueue
Source:

(inner) sync()

Create and transmit a sync packet to the ATEM.
Source:

Events

auxiliaryOutput

When an auxiliary output changes, this event will be fired.
Properties:
Name Type Description
aux SourceID The id of the auxiliary output
source SourceID The id of the source that is assigned to the auxiliary output
Source:

connectionLost

When the connection with the atem is lost, this event will be fired.
Source:

connectionStateChange

Properties:
Name Type Description
state ConnectionState The new state
Source:

error

When an error is encountered during communication, this event will be fired.
Type:
  • Error
Properties:
Name Type Description
Message String
Source:

inputTally

When the input tally changes, this event will be fired.
By input tally we mean the state (which is: live, preview or neither of them) of one of the camera inputs
Properties:
Name Type Description
inputNumber Number the index of the input
state SourceState
Source:

messageTimeout

When a sync message is sent to the atem and the ATEM does not respond in x milliseconds, this event will be fired.
Type:
  • Error
Properties:
Name Type Description
message String The error message
Source:

previewBus

When the selected preview bus changes this event will be fired.
Properties:
Name Type Description
source SourceID The new preview source
Source:

programBus

When the selected program bus changes this event will be fired.
Properties:
Name Type Description
source SourceID The new program source
Source:

rawCommand

Type:
Source:

sourceConfiguration

When the Source Configuration changes, for example: if the display name of input 2 changes, this event will be fired
Properties:
Name Type Description
sourceID SourceID the identifier of the source
sourceConfiguration SourceConfiguration the new configuration of the source
Source:

sourceTally

When the source tally changes, this event will be fired.
Properties:
Name Type Description
sourceID Number the id of the source
state SourceState
Source: