You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title: startPlayer() Restarts from Beginning After Progress Dragging
Description:
When using the startPlayer() method to play an audio file, the player always restarts from the beginning, even after seeking to a specific position using the seekTo() method. The issue occurs only after the user has dragged the progress bar to a specific position.
Steps to Reproduce:
Use seekTo() to set the playback position to a specific time (e.g., seekTo(2464)).
Call startPlayer() to begin playback from the specified position.
If the user interacts with the progress bar (even by tapping it), startPlayer() will restart the audio from the beginning, regardless of the previous position set by seekTo().
Expected Behavior: After calling seekTo() to jump to a specific position, the audio should start from that position when startPlayer() is invoked, without restarting from the beginning.
Actual Behavior: Every time startPlayer() is called after the user interacts with the progress bar, the audio starts from the beginning, even though the position was set previously using seekTo().
Code Example:
GestureDetector(
onTap: () {
if (_isPlaying) {
getPlayerController(itemUrl).pausePlayer(); // Pause playback
} else {
print("Starting playback from position: ${UploadedProgress[itemUrl] ?? 0}");
// Set playback position
getPlayerController(itemUrl).seekTo(UploadedProgress[itemUrl] ?? 0);
// Start playback from the specified position
getPlayerController(itemUrl).startPlayer(forceRefresh: false);
}
setState(() {
_isPlaying = !_isPlaying; // Toggle playback state
});
},
child: Icon(
_isPlaying ? Icons.pause_outlined : Icons.play_arrow,
size: 30,
color: Colors.white, // Icon color
),
),
Version of audio_waveforms package: 1.2.0 (or whichever version you're using)
Environment:
Flutter version: [Insert Flutter version here]
Android version: [Insert Android version here]
iOS version: [Insert iOS version here]
Additional Information: This issue is occurring when forceRefresh: false is passed in startPlayer(). Even though the player is supposed to continue from the current position, it restarts from the beginning every time it's invoked after seeking or user interaction.
Suggested Solution:
It seems that the forceRefresh flag in startPlayer() is causing the player to ignore the previous position and always reset to the start. If this flag is necessary, a separate flag to preserve the position might be required to avoid resetting the player to the beginning.
The text was updated successfully, but these errors were encountered:
@shaniu00 could UploadedProgress[itemUrl] be null because if it is null then it will start from beginning since you're you are seeking to 0 before starting the player.
Title: startPlayer() Restarts from Beginning After Progress Dragging
Description:
When using the startPlayer() method to play an audio file, the player always restarts from the beginning, even after seeking to a specific position using the seekTo() method. The issue occurs only after the user has dragged the progress bar to a specific position.
Steps to Reproduce:
Use seekTo() to set the playback position to a specific time (e.g., seekTo(2464)).
Call startPlayer() to begin playback from the specified position.
If the user interacts with the progress bar (even by tapping it), startPlayer() will restart the audio from the beginning, regardless of the previous position set by seekTo().
Expected Behavior: After calling seekTo() to jump to a specific position, the audio should start from that position when startPlayer() is invoked, without restarting from the beginning.
Actual Behavior: Every time startPlayer() is called after the user interacts with the progress bar, the audio starts from the beginning, even though the position was set previously using seekTo().
Code Example:
Version of audio_waveforms package: 1.2.0 (or whichever version you're using)
Environment:
Flutter version: [Insert Flutter version here]
Android version: [Insert Android version here]
iOS version: [Insert iOS version here]
Additional Information: This issue is occurring when forceRefresh: false is passed in startPlayer(). Even though the player is supposed to continue from the current position, it restarts from the beginning every time it's invoked after seeking or user interaction.
Suggested Solution:
It seems that the forceRefresh flag in startPlayer() is causing the player to ignore the previous position and always reset to the start. If this flag is necessary, a separate flag to preserve the position might be required to avoid resetting the player to the beginning.
The text was updated successfully, but these errors were encountered: