Since: 0.9.4

playerPositionChanged

Description

This event is fired when the current playback position of the song changed.

playerPositionChanged.net

Types

function(args)JavaScript
Action<PositionChangedEventArgs>.net

Parameters

ParametersTypeSummary
argsJavaScriptalphaTab.synth.PositionChangedEventArgsThe information about the player position.
args.netAlphaTab.Synth.PositionChangedEventArgsThe information about the player position.

PositionChangedEventArgs Properties

ParametersTypeSummary
currentTimeJavaScriptnumberThe current time position within the song in milliseconds.
CurrentTime.netdoubleThe current time position within the song in milliseconds.
endTimeJavaScriptnumberThe total length of the song in milliseconds.
EndTime.netdoubleThe current time position within the song in milliseconds.
currentTickJavaScriptnumberThe current time position within the song in midi ticks.
CurrentTick.netdoubleThe current time position within the song in midi ticks.
endTickJavaScriptnumberThe total length of the song in midi ticks.
EndTick.netdoubleThe current time position within the song in midi ticks.
isSeekJavaScriptboolean

Whether the position changed because of time seeking and not due to playback.

since 1.2.0-alpha.97
IsSeek.netbool

Whether the position changed because of time seeking and not due to playback.

since 1.2.0-alpha.97

Examples

const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.playerPositionChanged.on((args) => {
updatePlayerPosition(args);
});