The end plugin is used for setting up an end point for a certain project,
that is the time where the end experience will begin.
Properties
player.end.version : string
The end plugin’s version string.
Example
console.log('The end plugin version is', player.end.version);
Methods
player.end.set(nodeId, [options])
Set a node to be treated as the last node of the experience.
Can be called several times, will append multiple end points.
Param | Type | Description |
---|---|---|
nodeId | string |
The wanted end node’s id. |
[options] | object |
An optional options object. |
[options.offset] | number |
The time, in seconds, from the begining of given node to the start of an end experience. Default: 4 . |
Example
// Set node a as end point, use default offset.
player.end.set('node_a');
// Set node a as end point, with an offset of 3 seconds.
player.end.set('node_a', {
offset: 3
});
player.end.remove(nodeId)
Remove a node from being treated as the last node of the experience.
If no node was left as an end point, the default end point is set.
Param | Type | Description |
---|---|---|
nodeId | string |
The variable’s name. |
Example
// Remove a previously set end point
player.end.remove('node_a');
player.end.clear()
Clear all nodes that have been set previously from being treated as the last node of the experience.
The default (player.events.ended) end point is set.
Example
// Clear all end points, reset to default.
player.end.clear();