syncmanager

As of BrightSignOS 8.2.10, the syncmanager object provides synchronization capabilities for video walls and other deployments that require closely calibrated interaction among players.

syncmanager IDL
[ 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. 

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

The constructor for a sync manager object takes four arguments:

  • network_interface string:  The network interface (for example, "eth0")

  • domain string:  The domain identifier used to distinguish among different roSyncManager instances.

  • multicast_address string: The multicast address to which synchronization messages are communicated.

  • multicast_port int: The multicast port to which synchronization messages are communicated.

SyncManager

synchronize()
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.

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()

Shuts down the instance, freeing the underlying sync manager. 

SyncManager Properties

  • leader boolean:  A read/write boolean attribute to set/get whether the sync manager is a leader, or a follower.

  • networkInterface string: 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 boolean:  A read-only string attribute which returns the domain for the sync manager

encryptedencryptionKey and encryptionKeyIsObfuscated are used to configure the use of encryption with the sync manager:

  • encrypted boolean: A read/write attribute that controls whether the sync manager uses encryption: If true, encryption is enabled on the unit. 

  • encryptionKeyIsObfuscated boolean: A write-only string attribute which is used to set the key used for encryption. Contact support@brightsign.biz to learn more about generating a key for obfuscation and storing it on the player.

  • encryptionKey string: A write-only string attribute which is used to set the key used for encryption

Example

This HTML code lets you listen for sync messages using syncmanager