Functions and methods - Storm JavaScript Player

MethodReturnsReturn typeDescription
initialize()-voidStarts the player. This method will be called automatically by the constructor unless wait parameter in the constructor has been set to false.
getInstanceID()Instance ID numbernumberThe method returns instance ID of the player.
getLibrary()StormLibrary ObjectStormLibraryThe method returns main StormLibrary object used by the player.
setPlayerConfig(config:StormPlayerConfig)-voidUpdates player config.
setStreamConfig(config:StormStreamConfig)-voidUpdates stream config.
setSize(width:number | string, height:number | string)-voidThe method sets a new width and height for the player. The values can be given as a number (in which case they are treated as the number of pixels), or as a string ending with "px" (this will also be the number of pixels) or "%", where the number is treated as a percentage of the parent container's value.
setWidth(width:number | string)-voidThe method sets a new width for the player. The value can be given as a number (in which case it is treated as the number of pixels), or as a string ending with "px" (this will also be the number of pixels) or "%", where the number is treated as a percentage of the parent container's value.
setHeight(height:number | string)-voidThe method sets a new height for the player. The value can be given as a number (in which case it is treated as the number of pixels), or as a string ending with "px" (this will also be the number of pixels) or "%", where the number is treated as a percentage of the parent container's value.
getWidth()Player widthnumberReturns player width in pixels.
getHeight()Player heightnumberReturns player height in pixels.
setTitle(title:string)-voidThe method allows to specify the title displayed in the upper-right corner of the player.
setSubtitle(subtitle:string)-voidThe method allows to specify the subtitle displayed in the upper-right corner of the player (below the title).
getPlayerConfig()Object containing player settingsObjectThis method returns an object containing all player preferences (related to its GUI).
addCuePoint(title:string, time:number)-voidThis method adds a CUE point to the player timeline with a given title.
removeCuePoint(time:number)-voidThis method removes a CUE point based on its time.
addEventListener(eventName:string, callback:function)-voidRegisters an event with the player object. Whenever a registered event occurs, player will call a predefined function provided
removeEventListener(eventName:string, callback:function)-voidRemoves event listener from the player.
Table 1. Methods table