Storm docs logo
Search the docs.../
Explore Storm Products

Events & Listeners Basics - Storm JavaScript Player

Storm player utilizes a simple event-lister model for a direct communication. While actions can be executed using available methods (API), a feedback from player is also necessary.

Attaching an Event Listener

Attaching an event lister is a straightforward task:

Code iconjavascript
const player = stormPlayer(playerConfig, streamConfig);

player.addEventListener("interfaceReady", function(event){
    console.log("onPlayerReady",event);
});

In this example, we have added a new event listener (called guiInitialized) to the player. Whenever the player GUI becomes ready, an attached function will be called. The function can also be of an inline type.

Code iconjavascript
player.addEventListener("interfaceReady", onGUIInitialized);

Detaching an Event Listener

In order to detach (remove) an event listener just use:

Code iconjavascript
player.removeEventListener("interfaceReady", onGUIInitialized);

For obvious reasons, inline functions cannot be removed (unless stored as a variable), however, there is a way to remove all events from the player:

Code iconjavascript
player.removeAllEventListeners();

Next Step

For the next step please check our Storm JS Player UI - Player Events where you’ll learn about available events for player behaviour.

Blog
Support
About us
Patents
Term of use
Privacy policy
Contact
©2026 Storm Streaming Media. All Rights Reserved.