---
title: syncmanager
slug: develop/syncmanager
docTags: 
createdAt: 2025-03-27T16:56:37.583Z
---

As of BrightSignOS 8.2.10, the *syncmanager&#xA0;*&#x6F;bject provides synchronization capabilities for video walls and other deployments that require closely calibrated interaction among players. See [roSyncManager](docId\:Wwc22ZsPhu1e689xe7en6) for more details, including information about PTP domains.

**syncmanager IDL**

```javascript
[
    constructor(String networkInterface, String domain, String multicast_address, unsigned multicast_port)
] interface SyncManager {
            attribute boolean leader;
            attribute String networkInterface;
   readonly attribute String domain;
            attribute boolean encrypted;
            attribute boolean encryptionKeyIsObfuscated;
  writeonly attribute String encryptionKey;
   void synchronize(in String id, in unsigned long ms_delay);
   void close()
};
```

## Object Creation

To create an *syncmanager* object, first load the `brightsign/syncmanager` module using the `require()` method. 

```javascript
const BSSyncManager = require("@brightsign/syncmanager");
let sm = new BSSyncManager(network_interface, domain, multicast_address, multicast_port);
```

The constructor for a syncmanager object takes four arguments:

- `network_interface` <font color="#6554c0">string</font>: The network interface (for example, "eth0")
- `domain` <font color="#6554c0">string</font>: The domain identifier used to distinguish among different *roSyncManager* instances.
- `multicast_address` <font color="#6554c0">string</font>: The multicast address to which synchronization messages are communicated.
- `multicast_port` <font color="#6554c0">int</font>: The multicast port to which synchronization messages are communicated.

## SyncManager

**synchronize()**

```javascript
void synchronize(in String id, in unsigned long ms_delay)
```

Broadcasts a time-stamped message to other players. This method is used on the leader unit only. The message will be rebroadcasted every second to allow follower units that are powered on late to catch up. The network message contains the sync ID, as well as the domain and a timestamp. The timestamp is created at the point when this method is called; however, it can be offset by passing a non-zero `ms_delay` value, allowing synchronization points to be set slightly in the future and giving the client enough time to switch video files and perform other actions. The `identifier` parameter allows the script on the leader unit to pass a filename, or some other useful marker, to the follower units as part of the synchronization message. This method returns the message that is sent out so that the leader can access the timestamp. 

The synchronization message is sent over all available networks (including WiFi), but follower units will use only the first message received.

:::hint{type="info"}
Because synchronization can involve follower units seeking to catch up with the playback of a leader unit, we recommend using the more efficient MOV/MP4 container format when synchronizing video files. Transport Stream files (MPEG-TS) are also supported, but they must begin with a presentation timestamp (PTS) of 0. Program Stream files (MPEG-PS) are not supported.
:::

**close()**

```javascript
void close()
```

Shuts down the instance, freeing the underlying sync manager. 

## SyncManager Properties

- `leader` <font color="#6554c0">boolean</font>: A read/write attribute to set/get whether the sync manager is a leader, or a follower.
- `networkInterface `<font color="#6554c0">string</font>: A read/write string attribute to set/get which network interface the sync manager uses (for example, "`eth0`", "`wifi0`"). The networkInterface parameter can be "" to allow any network interface.
- `domain` <font color="#6554c0">boolean</font>:  A read-only string attribute which returns the domain for the sync manager

`encrypted`, `encryptionKey` and `encryptionKeyIsObfuscated` are used to configure the use of encryption with the sync manager:

- `encrypted` <font color="#6554c0">boolean</font>: A read/write attribute that controls whether the sync manager uses encryption: If `true`, encryption is enabled on the unit. 
- `encryptionKeyIsObfuscated` <font color="#6554c0">boolean</font>: A write-only string attribute which is used to set the key used for encryption. Contact [support@brightsign.biz](mailto\:support@brightsign.biz) to learn more about generating a key for obfuscation and storing it on the player.
- `encryptionKey` <font color="#6554c0">string:</font> A write-only string attribute which is used to set the key used for encryption

## Synchronizing Video Playback

When using syncmanager for video synchronization, sync events are broadcast repeatedly (\~1 Hz) to ensure all players receive them. Your code must track the sync ID and only respond to the first occurrence of each new ID to avoid reloading the video on every repeated event.

See our GitHub repo for syncmanager leader and follower code examples:&#x20;

[https://github.com/brightsign/dev-cookbook/tree/main/examples/browser/syncmanager-js](https://github.com/brightsign/dev-cookbook/tree/main/examples/browser/syncmanager-js)&#x20;

:::hint{type="danger"}
Without tracking \`currentSyncId\`, the video will reload every second when repeated events arrive, disrupting playback.
:::

