API Methods - Storm Android Library

MethodReturnsReturn typeDescription
play()-voidPlays current playback.
pause()-voidPauses current playback.
stop()-voidStops current playback.
prepare(boolean autostart)-voidPrepares the library for operation. Its autostart parameter determines whether to play the video immediately after the preparation or wait for the user's action.
isPlaying()true - if player is playing a videobooleanReturns the information on whether the video is being played at the moment or not.
setVolume(float volume)-voidSets the audio volume, with 0 being silence and 1 being unity gain.
getVolume()Current volume levelfloatReturns current volume level.
seekTo(long streamSeekUnixTime)-voidForces the player to seek for a given source time.
addMediaItem(StormMediaItem stormMediaItem)-voidAdds new StormMediaItem item to the playback list.
addMediaItem(StormMediaItem stormMediaItem, boolean markAsSelected)-voidAdds new StormMediaItem item to the playback list and decides if it should be started.
removeMediaItem(StormMediaItem stormMediaItem)-voidRemoves StormMediaItem item from the playback list.
playMediaItem(StormMediaItem stormMediaItem)-voidInitiates the playback of a given StormMediaItem item.
playMediaItem(StormMediaItem stormMediaItem, boolean resetSeekPosition)-voidInitiates the playback of a given StormMediaItem item. Depending on resetSeekPosition it will either start the playback from LIVE moment (if true), or from the last position (if false).
selectMediaItem(StormMediaItem stormMediaItem)-voidSelects given StormMediaItem item for playback.
getSelectedStormMediaItem()Currently selected (played) StormMediaItem itemStormMediaItemReturns the currently selected StormMediaItem item.
getStormMediaItems()List of all added StormMediaItem itemsList<StormMediaItem>Returns the list of all added StormMediaItem items.
clearStormMediaItems()-voidClears the list of all added StormMediaItem items.
addEventListener(StormLibrary.EventListener e)-voidRegisters a new event listener with the library object.
removeEventListener(StormLibrary.EventListener e)-voidRemoves an event listener from the library object.
getExoPlayer()SimpleExoPlayer objectSimpleExoPlayerReturns the underlying SimpleExoPlayer object.
initStormGateway(String groupName)A StormGateway objectStormGatewayInitiates a new request to the Gateway server and returns its object.
Table 1. API methods table.
Support Needed?

Create a free ticket and our support team will provide you necessary assistance.

On this page

API Methods