Player APIs (BrightScript & Ja...
BrightScript-JavaScript Object...
BSSyncManager
6min
for more information about available methods, refer to the rosyncmanager docid\ wwc22zsphu1e689xe7en6 entry to enable genlock in javascript, pass the bssyncmanager / rosyncmanager domain to the videooutput docid\ kzf34hnxf53r9owsdud6e 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) 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 bindtointerface(in domstring interface) binds the syncmanager to a specific network interface (for example, "eth0", "wifi0") setting the interface to "" (empty) will use all interfaces 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 follower units that have encryption enabled can ingest unencrypted synchronization messages from a leader unit once a follower unit receives encrypted packets, it will no longer accept unencrypted packets from a leader unit, unless encryption is explicitly disabled using this method follower units that have encryption disabled (or do not support encryption) cannot ingest encrypted messages from a leader unit therefore, if a synchronization group includes mixed versions of os, the leader unit should always have an older version of os than the follower units boolean setencryptionenablewithobfuscatedkey(in domstring obfuscated key) as boolean enables encryption of bssyncmanager messages using an obfuscated key contact support\@brightsign biz mailto\ 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 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 \<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 \<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>