playerStateChanged
Description​
This event is fired when the playback state changed.
playerStateChangedJavaScript |
alphaTab.playerStateChangedjQuery |
alphaTab.playerStateChangedHTML |
PlayerStateChanged.net |
Types​
function(e)JavaScript |
Action<PlayerStateChangedEventArgs>.net |
Parameters​
Parameters | Type | Summary |
---|---|---|
argsJavaScript | alphaTab.synth.PlayerStateChangedEventArgs | The information about the player state change event. |
args.net | AlphaTab.Synth.PlayerStateChangedEventArgs | The information about the player state change event. |
PlayerStateChangedEventArgs Properties​
Parameters | Type | Summary |
---|---|---|
stateJavaScript | alphaTab.synth.PlayerState | The new state of the player.
|
State.net | AlphaTab.Synth.PlayerState | The new state of the player. |
stoppedAll | bool | Whether the playback was fully stopped (including jump to start) or only paused. |
Examples​
- JavaScript
- HTML
- jQuery
- C#
const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.playerStateChanged.on((args) => {
updatePlayerControls(args.state, args.stopped);
});
$('#alphaTab').on('alphaTab.playerStateChanged', (e, args) => {
updatePlayerControls(args.state, args.stopped);
});
document.querySelector('#alphaTab').addEventListener('alphaTab.playerStateChanged', (e) => {
const args = e.detail;
updatePlayerControls(args.state, args.stopped);
}, false);
var api = new AlphaTabApi<MyControl>(...);
api.PlayerStateChanged.On(args =>
{
UpdatePlayerControls(args);
});