Page tree
Skip to end of metadata
Go to start of metadata

ON THIS PAGE

For more information about available methods, refer to the roSyncManager entry. To enable Genlock in JavaScript, pass the BSSyncManager/roSyncManager domain to the videooutput.SetSyncDomain() method

Object Creation

BSSyncManager(in DOMString domain, in DOMString multicast_address, in DOMString multicast_port);

Methods

void SetMaster(in boolean master_mode) raises(DOMException)

void Synchronize(in DOMString id, in unsigned long ms_delay) raises(DOMException)

void Close()

Shuts down the instance, preventing it from further consuming resources. If this method is not called, garbage collection determines when the instance will be destroyed.

boolean SetEncryptionEnable(in boolean enable)
boolean SetEncryptionEnable(in boolean enable, in DOMString key)
boolean SetEncryptionEnable(in boolean enable, in ArrayBuffer key)

Enables or disables encryption of BSSyncManager messages over the network. This method returns true on success and false on failure.

The key may be specified as a string or binary array. Alternatively, a key value may not be supplied, in which case a pseudo-randomly generated key is used. Setting enable to false and supplying a key at the same time will cause this method to fail. 

Encryption is available (and enabled by default) in OS8 and later. Note the following behavior in mixed-version environments:

  • Slave units that have encryption enabled can ingest unencrypted synchronization messages from a master unit. Once a slave unit receives encrypted packets, it will no longer accept unencrypted packets from a master unit, unless encryption is explicitly disabled using this method.
  • Slave units that have encryption disabled (or do not support encryption) cannot ingest encrypted messages from a master unit. Therefore, if a synchronization group includes mixed versions of OS, the master unit should always have an older version of OS than the slave units.
boolean SetEncryptionEnableWithObfuscatedKey(in DOMString obfuscated_key) As Boolean

Enables encryption of BSSyncManager messages using an obfuscated key. Contact support@brightsign.biz to learn more about generating a key for obfuscation and storing it on the player.

HTML Video Functions

setSyncParams(in DOMString domain, in DOMString id, in DOMString iso_timestamp)

HTML video tags include the setSyncParams() function. Calling this function synchronizes the video with the specified sync group.

Events

The following event is available on the BSSyncManager object. It can receive events of the type BSSyncManagerEvent.

  • onsyncevent 

BSSyncManagerEvent – Attributes

The following attributes are relevant to the onsyncevent event:

  • readonly attribute DOMString domain
  • readonly attribute DOMString id
  • readonly attribute DOMString iso_timestamp

Example

The following JavaScript example contains two videos being synchronized locally with BSSyncManager. If a Slave player is configured to be in the same PTP domain as the Master player and uses the Slave HTML script, then it will display the videos in sync with the Master player. This can be implemented on multiple Slave players.

Master Script
<video id="one" hwz="on">
    <source id="one_src" src="pirates.mov">
</video>

<script>
    // Create the sync manager with provided multicast settings
    var sync = new BSSyncManager("domain1", "224.0.126.10", 1539);

    sync.onsyncevent = function (e) {
        document.getElementById("one").setSyncParams(e.domain, e.id, e.iso_timestamp);
        document.getElementById("one").load();
        document.getElementById("one").play();
        console.log(e.domain);
        console.log(e.id);
        console.log(e.iso_timestamp);
    };

    function startTimer() {
        setTimeout(function () {
            restartMaster()
        }, 30000);
    }
    function restartMaster() {
        // Synchronize the videos to start playing in 1000ms
        sync.SetMaster(1);
        sync.Synchronize("sync_event1", 1000);
        startTimer();
    }
    restartMaster();

</script>

 

 

Slave Script
<video id="one" hwz="on">
    <source id="one_src" src="pirates.mov">
</video>

<script>
    // Create the sync manager with provided multicast settings
    var sync = new BSSyncManager("domain1", "224.0.126.10", 1539);

    sync.onsyncevent = function (e) {
        document.getElementById("one").setSyncParams(e.domain, e.id, e.iso_timestamp);
        document.getElementById("one").load();
        document.getElementById("one").play();
        console.log(e.domain);
        console.log(e.id);
        console.log(e.iso_timestamp);
    };
 
</script>

</body>
</html>

  • No labels