Difference between revisions of "Live Object"

From MSX - Wiki
Jump to navigation Jump to search
Line 54: Line 54:
 
* <code>"setup"</code>: The object is never live and has only the state <code>"init"</code>, but the live action (i.e. the <code>action</code> property) is executed if the corresponding content item becomes visible.
 
* <code>"setup"</code>: The object is never live and has only the state <code>"init"</code>, but the live action (i.e. the <code>action</code> property) is executed if the corresponding content item becomes visible.
  
'''Note: The live object is only evaluated if the corresponding content item is visible. If the corresponding content item is visible, the live object is evaluated every second, regardless of the current state. Since version 0.1.74, live objects of type <code>"playback"</code> can also have the state "coming" if the corresponding content item contains the extension property <code>resume:key</code>. Please also note that live objects are evaluated on an overlay/underlay page, even if the overlay/underlay page is hidden.'''
+
'''Note: The live object is only evaluated if the corresponding content item is visible. If the corresponding content item is visible, the live object is evaluated every second, regardless of the current state. Since version 0.1.74, live objects of type <code>"playback"</code> can also have the state <code>"coming"</code> if the corresponding content item contains the extension property <code>resume:key</code>. Please also note that live objects are evaluated on an overlay/underlay page, even if the overlay/underlay page is hidden.'''
 
|}
 
|}
  

Revision as of 12:38, 14 January 2021

The live object can be used to periodically update content items (e.g. with live data, playback progress, etc.). It can have following states.

  • "init": The initial state. Possible next states: "coming", "running", or "over".
  • "coming": The object is not live yet or it was live before and can become live again. Possible next states: "running" or "over".
  • "running": The object is live. Possible next states: "coming" or "over".
  • "over": The object is not live anymore. Possible next states: "coming" or "running".
{    
    "type": "schedule",
    "from": 0,
    "to": 0,   
    "duration": 0,
    "delay": 0,
    "coming": null,
    "running": null,
    "over": null,
    "execute": null,
    "color": "msx-glass",
    "title": "Item Title",
    "titleHeader": "Item Title Header",
    "titleFooter": "Item Title Footer",
    "label": "Item Label",
    "icon": "blank",     
    "headline": "Item Headline",
    "text": "Item Text",
    "tag": "Item Tag",
    "tagColor": "msx-red",
    "badge": "Item Badge",
    "badgeColor": "msx-green",
    "progress": -1,
    "progressColor": "msx-yellow",
    "wrapperColor": "msx-blue",
    "image": "http://link.to.image",    
    "extensionIcon": "blank",
    "extensionLabel": "Item Extension Label",    
    "action": null,
    "data": null    
}
Property syntax of live object
Property Type Default Value Mandatory Since Version Description
type string null No 0.1.70

The type of the live object. If this property is not set, the current live object is removed.

  • "schedule": The object is live for a specific schedule time, indicated by a start and end timestamp (i.e. the from and to properties). Possible states: "init", "coming", "running", and "over".
  • "lifetime": The object is live for a specific lifetime (starting from the creation timestamp), indicated by a duration and delay (i.e. the duration and delay properties). Possible states: "init", "coming", "running", and "over".
  • "airtime": The object is live for a specific airtime (running for the visible time), indicated by a duration (i.e. the duration property). Possible states: "init", "running", and "over".
  • "playback": The object is live if the corresponding content item is currently being played. Possible states: "init", "running", and "over". This type can only be used if the corresponding content action is video:{URL} or audio:{URL}. Please note that the corresponding content action URL is compared with the current player URL to check the live state.
  • "setup": The object is never live and has only the state "init", but the live action (i.e. the action property) is executed if the corresponding content item becomes visible.

Note: The live object is only evaluated if the corresponding content item is visible. If the corresponding content item is visible, the live object is evaluated every second, regardless of the current state. Since version 0.1.74, live objects of type "playback" can also have the state "coming" if the corresponding content item contains the extension property resume:key. Please also note that live objects are evaluated on an overlay/underlay page, even if the overlay/underlay page is hidden.

See also[edit]