Constructor
new SyncManager()
- Source:
Example
Enable inter-device synchronisation with video/broadcast
var SyncManager = require('hbbtv-lib/cs/sync_manager');
mediaObj = document.getElementById("vbObject");
mediaObj.bindToCurrentChannel();
// wait for presenting state
syncMan = new SyncManager();
syncMan.on(SyncManager.EVT_MS_ERROR, on_ms_error);
syncMan.once(SyncManager.EVT_CII_ENABLED, on_cii_enabled);
syncMan.once(SyncManager.EVT_CII_DISABLED, on_cii_disabled);
syncMan.setMasterMedia(mediaObj, "urn:dvb:css:timeline:temi:1:1");
syncMan.enableCII();
function on_cii_enabled() {
log("synchronisation with companion can be started.");
}
Extends
Members
(static) EVT_CII_DISABLED
Event name constant for the EVT_CII_DISABLED event.
- Source:
(static) EVT_CII_ENABLED
Event name constant for the EVT_CII_ENABLED event.
- Source:
(static) EVT_ERROR
Event name constant for the EVT_ERROR event.
- Source:
(static) EVT_MS_ERROR
Event name constant for the EVT_MS_ERROR event.
- Source:
Methods
addMediaObject(mediaObject, tl_spec, cor) → {boolean}
Adds the media object to the sync manager, i.e. by calling addMediaObject.
Parameters:
Name | Type | Description |
---|---|---|
mediaObject |
object | either a A/V or V/B object, or an HTML5 media element in a suitable state for media synchronisation. |
tl_spec |
string | a synchronisation timeline specifier. |
cor |
object | an object providing a correlation tuple (support dvbcss_clocks from BBC and MRS formats) |
- Source:
Fires:
Returns:
TRUE if method executed without errors, else FALSE.
- Type
- boolean
addMediaObject(obj) → {boolean}
Removes the media object from the sync manager, i.e. by calling removeMediaObject.
Parameters:
Name | Type | Description |
---|---|---|
obj |
video | audio | object | either a A/V or V/B object, or an HTML5 media element in a suitable state for media synchronisation. |
- Source:
Fires:
Returns:
TRUE if method executed without errors, else FALSE.
- Type
- boolean
currentTime() → {number}
Returns current position on the media timeline
- Source:
Returns:
Current time
- Type
- number
disableCII() → {boolean}
Disables inter-device synchronisation. Closes the terminals CII endpoints.
- Source:
Fires:
Returns:
- Type
- boolean
enableCII() → {boolean}
Enables inter-device synchronisation for MediaSynchroniser that is properly initialized.
An event is fired when the service endpoints (e.g. DVB CII) are operational.
- Source:
Fires:
Returns:
true if the SyncManager is initialized properly.
- Type
- boolean
setMasterMedia(master, tl_spec) → {boolean}
Adds the master media to the sync manager, i.e. by calling initMediaSynchroniser. Note: this can be called only once.
Parameters:
Name | Type | Description |
---|---|---|
master |
media_object | either a A/V or V/B object, or an HTML5 media element in a suitable state for media synchronisation. |
tl_spec |
string | a synchronisation timeline specifier. |
- Source:
Fires:
Returns:
TRUE if method executed without errors, else FALSE.
- Type
- boolean
stop()
Stops any active MediaSynchroniser, i.e. disables inter-device sync (aka DVB CSS).
- Source:
Events
EVT_CII_DISABLED
The CII endpoint of the HbbTV terminal has been disabled.
- Source:
EVT_CII_ENABLED
The CII endpoint of the HbbTV terminal has been enabled.
- Source:
EVT_ERROR
An error occured
Parameters:
Name | Type | Description |
---|---|---|
message |
string | A textual description of what happened |
- Source:
EVT_MS_ERROR
An error occured
Parameters:
Name | Type | Description |
---|---|---|
message |
string | A textual description of what happened |
- Source: