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. Note that syncmanager requires PTP to be enabled on players via the registry, which is a separate operation. To configure a player, use the roRegistrySection.Write() method to set the ptp_domain key of the networking section to a value between 0 and 127. The PTP synchronization service will start on the player after it is rebooted.
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:
[String] network_interface:
The network interface (for example, "eth0")[String] domain:
The domain identifier used to distinguish among different roSyncManager instances.[String] multicast_address:
The multicast address to which synchronization messages are communicated.[int] multicast_port:
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. The PTP messages, which are used by the firmware during synchronization, are sent over Ethernet only.
Note
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()
void close()
SyncManager Properties
[boolean] leader:
A read/write boolean attribute to set/get whether the sync manager is a leader, or a follower.[String] networkInterface:
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.[boolean] domain:
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:
[boolean] encrypted:
A read/write attribute that controls whether the sync manager uses encryption: Iftrue
, encryption is enabled on the unit.[boolean] encryptionKeyIsObfuscated: 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.[String] encryptionKey:
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:
<!DOCTYPE html> <html> <head> <script> function runtest() { var smc = require('@brightsign/syncmanager'); var sync = new smc("", "brightsign", "224.0.126.10", 5439); sync.leader = false; sync.encrypted = false; sync.addEventListener('syncevent', function f(e) { console.log("Node style event: " + JSON.stringify(e) + e.domain + "," + e.id + "," + e.iso_timestamp); }); } </script> >/head>> <body bgcolor="#E6E6FA" onload="runtest()"> <h1>syncmanager Test Page</h1> </body> </html>