Global theoplayer variable

Global theoplayer variable

THEOplayer puts the theoplayer variable on the global scope.

This variable supports the following methods:

MethodDescription
player(identifier) Returns the player linked to the given identifier. Identifier can be either a sequence number, an HTML-id given to the <video>-tag to which the player was attached or the player instance itself.
controller(identifier,name) Returns the appropriate controller for the player identifier. Supported controllers right now are:
destroy(identifier) Destroys the player linked to the given identifier. This removes the player from the web page and cleans up all resources used by the player. The destroyed player can no longer be used: any attempt to access properties or methods of a destroyed player results in undefined behavior.
addEventListener(eventName,listener) Adds the given event listener for the given global event.
removeEventListener(eventName,listener) Removes the given event listener for the given global event.

This variable supports the following properties:

PropertyDescription
configuration Sets the global player configuration before setup.
onReady Function set in this property will be run after THEOplayer has been loaded and auto-detected players have been created.

This variable supports the following events:

EventDescription
ready Fires when THEOplayer has been loaded and auto-detected players have been created.