Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@atem-connection/camera-control

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atem-connection/camera-control

Library for ATEM Camera control using atem-connection.

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ATEM connection camera control - @atem-connection/camera-control

Node CI npm

Usage

This library can be used with atem-connection NPM Github, to provide a friendly interface for camera control.

Example:

import { Atem } from 'atem-connection'
import { AtemCameraControlDirectCommandSender, AtemCameraControlStateBuilder } from '@atem-connection/camera-control'

// Create the class which tracks the current state from the atem
const cameraControlState = new AtemCameraControlStateBuilder(4)

const atem = new Atem({})
atem.connect('10.0.0.1')

// Create the command sender. Alternatively `AtemCameraControlBatchCommandSender` can be used to be able to batch multiple commands to be sent once
const cameraControlSender = new AtemCameraControlDirectCommandSender(atem)

atem.on('connected', () => {
	console.log('connected')

	// Perform an autofocus of camera 1 after a short timeout
	setTimeout(() => {
		cameraControlSender.triggerAutoFocus(1)
	}, 1000)
})
atem.on('disconnected', () => {
	cameraControlState.reset()
})

atem.on('receivedCommands', (commands) => {
	const cameraCommands = []
	for (const command of commands) {
		if (command instanceof Commands.CameraControlUpdateCommand) cameraCommands.push(command)
	}

	const changes = cameraControlState.applyCommands(cameraCommands)

	// Do something based on the reported changes
	console.log('camera changes', changes)
})

Development

Setting up

  • Clone the repository
  • Install a compatible version of nodejs and yarn
  • Build the project with yarn build

Modifying the code

You can run yarn build:main --watch to rebuild the typescript code, which will re-run upon saving a file.

There are some unit tests, which can be run with yarn unit. This command calls into jest, so any jest arguments can also be used

Keywords

FAQs

Package last updated on 07 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc