Nod

Submit a ticket My Tickets
Welcome
Login  Sign up

Nod Asset API Methods

The `dmc` object can be interacted with using the following methods:

Method signature
Behaviour
`stop()`
Tell DMC to stop playing this asset (only effective if the asset is set to play "Until the asset says it's finished").
`getFieldValue(id)`
Get the value of the asset field with id `id`, or `undefined` if there is no such field.
`getFeedContent(key)`
Get the content of the feed with key `key`. Returns an array of hashes, whose contents are specific to the type of feed, or `undefined` if there is no such feed or no feed data is available.
`getTagValue(name)`
Get the value of the tag called `name`, or `undefined` if it has no value. If both the screen and its location have a value for the same tag, the screen's value takes precedence.
`getScreenName()`
Get the name of the screen.
`getLocationName()`
Get the name of the location.
`getZoneName()`
Get the name of the zone.
`getLocationCode()`
Get the code that has been assigned to the location in DMC.
`onStart(callback[, context])` (javascript only)
Register a callback to be called with the given context when DMC starts playing the asset. If this method is called multiple times before the asset starts playing, the callbacks will be called in the order they were registered. If this method is called after the asset starts playing (including from another `onStart` callback), the callback provided is called immediately.
`setData(data)` (javascript only)
Set data that can be retrieved across different plays of the asset. Such data should be treated as ephemeral; it may be dropped by DMC at any time due to memory constraints. It must be constructed from plain javascript values: numbers, booleans, strings, hashes, arrays and null. If `data` is `null` or `undefined`, this method will delete any data currently against the asset.
`getData()` (javascript only)
Get data previously save using `setData()`, or `null` if there is no data against the asset. The object returned is always a deep copy of the asset data.
`getDate()` (javascript only)
Get the current date in the ISO 8601 format `yyyy-MM-ddTHH:mm:ss.fffZ`. The timezone designator will always match `/[+-]\d\d:\d\d/`.
`canRunPlaylist(code)` (LG and Windows only)
Returns a boolean indicating whether there is a playlist available to play with the given on demand code.
`runPlaylist(code)` (LG and Windows only)
Switch to playing the playlist with the given on demand code, if there is one available. If `code` is `null` or an empty string, the main playlist will resume playing.
`getLastSense(key)` (Windows only)
Get the last sense received for the given sense query key
`onSense(key, callback[, context])` (Windows only)
Register a callback to be called with the given context whenever a new sense is received which matches the given query key. The sense received will be passed to the callback as the first argument.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.