Create a new controlled player instance. Available in the global entry only.
The ID of the new player instance.
The options for the new player instance.
disableWindowAnimation
: Disable window animations when opening/closing the window.disableUI
: Hide the window's User Interface.enablePlugins
: Enable all plugins for the new player instance.label
: A custom label of the new player instance. Can be obtained by global.getLabel()
in the main entry.
Note that if this option is set to false
, the player will only have the current plugin loaded
to ensure communication between the players and the global entry.url
: The URL to open in the new player instance.Get the custom label of the current player instance.
The label can be set by the label
option of createPlayerInstance.
Available in the main entry only.
Post a message to the (main entry of) player instance(s). Available in the global entry only.
Specify the target player instance(s).
If set to a string, it will be treated as the player instance's label.
If set to a number, it will be treated as the player instance's ID.
The ID is only available for plugin-created players returned by createPlayerInstance.
If set to null
, the message will be sent to all player instances.
The message name.
The message data.
Post message to the global entry. Available in the main entry only.
The message name.
The message data.
Register a message listener.
The message name.
The callback function.
The message data.
Optional
player: stringThe player's ID. Available in the global entry only, and only when the message is sent from a player instance.
Generated using TypeDoc
The
Global
module provides a way to create new player instances and communicate with them. The controlled player instances can have special properties, such as hidden User Interface, disabled window animations, disabled plugins, and more.It also enables communication between the main entries and the global entry.
Available In Entry
Global and main. However, the
createPlayerInstance
method is only available in the global entry. Note that if the plugin doesn't have a global entry, the whole module will be unavailable.