Functions and methods - Storm Library

MethodReturnsReturn typeDescription
getPlayerID()Player ID (first player starts with 0, next one gets 1, etc.)numberThe method returns an id of the player
getConfig()A config object provided as a first parameterObjectThe method returns the main config object that was provided to the player
getRole()"player" or "streamer"stringThe method returns whenever the player is working in “player” mode or a “streamer” (streamer function has not been implemented yet)
getVersion()Player versionstringThe method returns player version
start()-voidThe method starts the player. If “autostart” option has been selected in the config player, this method will be called automatically
stop()-voidThis method will stop the current playback and cease all operations
restart()-voidThe player is restarted to the default state (a combination of stop() and start() methods)
play()-voidThis method will force player to play a content (if it was paused previously)
pause()-voidThis method pauses current playback
mute()-voidMutes the player’s video object. It’s not the same as setVolume(0), as both can be applied together
unmute()-voidMethod unmutes the player’s video object
isMute()True if player is muted, or false if it’s notbooleanThis method can be used to check whenever the player is muted
setVolume(newVolume:int)-voidSets new volume for the player (0-100). Once the method is performed "volumeChange" event will be fired
setSize(width:int, height:int)-voidForces the player to resize to given dimensions
setWidth(width:int)-voidSets new width for the player
setHeight(height:int)-voidSets new height for the player
setScalingMode(newMode:string)-voidChanges player scaling mode. For the reference, please check scaling mode in the player config
destroy()-voidDestroys the player and removes it from the container
Table 1. Methods table