JSPM

atem-connection

0.2.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3536
  • Score
    100M100P100Q130792F
  • License MIT

Typescript Node.js library for connecting with an ATEM switcher.

Package Exports

  • atem-connection

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 (atem-connection) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ATEM-connection

CircleCI

This is a library for connecting to Blackmagic Design ATEM devices, created by SuperFly.tv

Note: this is a work in progress, expect many new features and also... breaking changes

Technology highlights

  • Typescript
  • Yarn
  • Jest
  • standard-version
  • codecov

Installation

For usage by library consumers installation is as easy as:

yarn add atem-connection

For library developers installation steps are as following:

git clone https://github.com/nrkno/tv-automation-atem-connection
yarn
yarn build

If you want to make a contribution, feel free to open a PR.

Usage

const { Atem } = require('atem-connection')
const myAtem = new Atem({ externalLog: console.log })

myAtem.connect('192.168.168.240')

myAtem.on('connected', () => {
    myAtem.changeProgramInput(3).then((res) => {
        console.log(res)
        // ProgramInputCommand {
        // 	flag: 0,
        // 	rawName: 'PrgI',
        // 	mixEffect: 0,
        // 	properties: { source: 3 },
        // 	resolve: [Function],
        // 	reject: [Function] }
    })
    console.log(myAtem.state)
})

myAtem.on('stateChanged', function(err, state) {
  console.log(state); // catch the ATEM state.
});

Events

  • connected This event will be fired once we have connected with the ATEM.

  • disconnected Whenever the connection to the ATEM fails and does not recover within 5 seconds this is called.

  • stateChanged(state) Whenever a packet from the ATEM is received that changes the state, this event will be fired.

Debug

Set debug=true config option in order to see raw packets. This is especially useful for library developers.

const myAtem = new Atem({ debug: true, externalLog: console.log })
SEND <Buffer 10 14 53 ab 00 00 00 00 00 3a 00 00 01 00 00 00 00 00 00 00>
SEND <Buffer 80 0c 53 ab 00 00 00 00 00 03 00 00>
SEND <Buffer 80 0c 53 ab 00 00 00 00 00 03 00 00>
SEND <Buffer 80 0c 80 0f 00 01 00 00 00 41 00 00>
RECV <Buffer 00 0c 90 60 5f 76 65 72 00 02 00 10>...

Test

This module will run tests by jest (in the future).

$ yarn unit