playerPositionChanged
Description​
This event is fired when the current playback position of the song changed.
playerPositionChangedJavaScript |
alphaTab.playerPositionChangedjQuery |
alphaTab.playerPositionChangedHTML |
PlayerPositionChanged.net |
playerPositionChangedAndroid |
Types​
function(args)JavaScript |
Action<PositionChangedEventArgs>.net |
(e: PositionChangedEventArgs) -> UnitAndroid |
Parameters​
Parameters | Type | Summary |
---|---|---|
argsJavaScript | alphaTab.synth.PositionChangedEventArgs | The information about the player position. |
args.net | AlphaTab.Synth.PositionChangedEventArgs | The information about the player position. |
argsAndroid | alphaTab.synth.PositionChangedEventArgs | The information about the player position. |
PositionChangedEventArgs Properties​
Parameters | Type | Summary |
---|---|---|
currentTimeJavaScript | number | The current time position within the song in milliseconds. |
CurrentTime.net | double | The current time position within the song in milliseconds. |
currentTimeAndroid | double | The current time position within the song in milliseconds. |
endTimeJavaScript | number | The total length of the song in milliseconds. |
EndTime.net | double | The current time position within the song in milliseconds. |
endTimeAndroid | double | The current time position within the song in milliseconds. |
currentTickJavaScript | number | The current time position within the song in midi ticks. |
CurrentTick.net | double | The current time position within the song in midi ticks. |
currentTickAndroid | double | The current time position within the song in midi ticks. |
endTickJavaScript | number | The total length of the song in midi ticks. |
EndTick.net | double | The current time position within the song in midi ticks. |
endTickAndroid | double | The current time position within the song in midi ticks. |
isSeekJavaScript | boolean | Whether the position changed because of time seeking and not due to playback. since 1.2.0-alpha.97 |
IsSeek.net | bool | Whether the position changed because of time seeking and not due to playback. since 1.2.0-alpha.97 |
isSeekAndroid | bool | Whether the position changed because of time seeking and not due to playback. since 1.2.0-alpha.97 |
Examples​
- JavaScript
- HTML
- jQuery
- C#
- Android
const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.playerPositionChanged.on((args) => {
updatePlayerPosition(args);
});
$('#alphaTab').on('alphaTab.positionChanged', (e, args) => {
updatePlayerPosition(args);
});
document.querySelector('#alphaTab').addEventListener('alphaTab.positionChanged', (e) => {
var args = e.detail;
updatePlayerPosition(args);
}, false);
var api = new AlphaTabApi<MyControl>(...);
api.PlayerPositionChanged.On(args =>
{
UpdatePlayerPosition(args);
});
val api = AlphaTabApi<MyControl>(...)
api.playerPositionChanged.on { args ->
updatePlayerPosition(args)
}