I am using Flex 4, ActionScript 3. In the AbstractPlayer.as class, the pauseTrack() method is as follows:
mIsPause = true;
mPausePosition = channel.position;
I implemented the playTrack() method in Player.as, which has the following code right at the beginning:
However, when I press the Play button after pausing, the audio file is played starting at the beginning. When I stepped through the debugger, the mPausePosition value is still present when playTrack() is called, but the mIsPause flag has been changed to false. I checked through my code and verified that the mIsPause flag is not reset before the check in playTrack().
Does anybody have a fix / workaround for this issue?
It is not clear from the code you posted whether you pass the 'position' value as the 1st argument to the play() method.
If you don't pass anything, by default it would start from 0; i.e. from the very beginning.
I looked at the code again, found the issue, and corrected it.