Resuming play/stop position #1084
-
I was following your tutorial example and used clicked method, it works perfectly and can play again from the stopped position. playPause.onclick = (e) => {
if (e.target.classList.contains("disabled")) {
return;
}
api.playPause();
};
stop.onclick = (e) => {
if (e.target.classList.contains("disabled")) {
return;
}
api.stop();
}; but if I don't use this method, instead just call socket.on('play', function(){
api.playPause();
});
socket.on('stop', function(){
api.stop();
}); would like to know what I'm missing and how to tell player where to continue. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The behavior is intended like you describe it.
Stop is like the stop button in a music player where playback is fully reset. The position is remembered on pause. https://alphatab.net/docs/reference/api/playpause/ |
Beta Was this translation helpful? Give feedback.
-
Wow, thank you, I misread the stop function and didn't notice there's a pause. |
Beta Was this translation helpful? Give feedback.
The behavior is intended like you describe it.
Stop is like the stop button in a music player where playback is fully reset. The position is remembered on pause.
https://alphatab.net/docs/reference/api/playpause/
https://alphatab.net/docs/reference/api/play/
https://alphatab.net/docs/reference/api/pause/