exports

Server-side representation of the PlayerManager

Extends

Constructor

new exports()

Source:

Attributes

players

Description:
  • The living collection of all players underlying shared states.

Source:
Overrides:

Methods

(async) createPlayer(sourceId, optionsopt) → {String}

Description:
Source:
Overrides:
Parameters:
Name Type Attributes Description
sourceId String

Id of the source

options Object <optional>
Properties
Name Type Attributes Default Description
nodeId String <optional>
this.como.nodeId

Optional id of the ComoNode where the player should be created, defaults to the node where the function is called

id String <optional>
null

Optional user-defined id to assign to the player. Important: that for now this is the responsibility of the client code to ensure the ids remain unique across the network.

Returns:

Id of the player

Type
String

(async) getPlayer(playerId) → {Player|null}

Description:
  • Get the full Player API access of a given player.

    If called on another ComoNode, getPlayerthis basically creates a clone of the original player. Useful for example to duplicate the audio of a node on another node.

Source:
Overrides:
Parameters:
Name Type Description
playerId String
Returns:
Type
Player | null

(async) getPlayerState(playerId) → {Player|null}

Description:
  • Get the underlying state of a player without the full {Player logic and behavior.

Source:
Overrides:
Parameters:
Name Type Description
playerId String
Returns:
Type
Player | null

(async) getScriptSharedState(playerId) → {SharedState|null}

Description:
  • Return the SharedState associated to the script assigned to the given player.

    Return null if the player is not associated to a script, or if the associated script does not define a shared state.

Source:
Overrides:
Parameters:
Name Type Description
playerId String
Returns:
Type
SharedState | null

playerExists(playerId) → {Boolean}

Description:
  • Returns wether the player exists on the network

Source:
Overrides:
Parameters:
Name Type Description
playerId String
Returns:
Type
Boolean