Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Expand
titleTable of Contents
Table of Contents

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 interface, in DOMString domain, in DOMString multicast_address, in DOMString multicast_port)

Setting the interface to "" (empty) will use all interfaces, and omitting the interface parameter is equivalent to specifying an empty interface name. 

Methods

void SetAsLeader(in boolean leader_mode) raises(DOMException)

...

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 iso_timestamp

Examples

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

Leader Script

Code Block
languagejs
<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 () {
            restartLeader()
        }, 30000);
    }
    function restartLeader() {
        // Synchronize the videos to start playing in 1000ms
        sync.SetAsLeader(1);
        sync.Synchronize("sync_event1", 1000);
        startTimer();
    }
    restartLeader();

</script>

Follower Script

Code Block
languagejs
<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>