New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When pressing play at the end of a sound clip, the sound file doesn't reset. - iOS #5
Comments
I add at end of startAudio - (void) startAudio{
...
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(playerItemDidReachEnd:)
name:AVPlayerItemDidPlayToEndTimeNotification
object:[player currentItem]];
} playerItemDidReachEnd - (void)playerItemDidReachEnd:(NSNotification *)notification {
AVPlayerItem *p = [notification object];
[p seekToTime:kCMTimeZero]; //set to 00:00
[player pause];
} dealloc - (void) dealloc
[[NSNotificationCenter defaultCenter] removeObserver:self
name:AVPlayerItemDidPlayToEndTimeNotification
object:nil]; |
Do you mind if I include this fix into my code ? |
If my, of course include :) |
Feel free to use mine if you'd like as well. Thanks for making the program to begin with 👍 |
Both of yours :-D |
OK. I committed changes which hopefully fixes these issues. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not a huge deal, but I figured I'd bring it up.
When you are done listening to a sound clip, the audio stops and the button returns to 'play'. When you click on play though, it starts playing after the sound file.
For example, the app says 2:55/2:55 when the sound file is done playing. If play is pressed again, time will increase at that interval - 2:55/2:56, 2:55/2:57, so on so forth.
- Could be fixed on line 145 by replacing with this:
if(player.rate == 0.0 && (CMTimeGetSeconds(player.currentTime)/CMTimeGetSeconds(player.currentItem.duration)) < 1.0)
EDIT: Also found: Before you load a sound, there is nothing where the play/pause is. That would be fine, however you can still click on it and the green text says 'playing'.
These behaviors occurs in the iOS version, not the OSX version.
Thanks
The text was updated successfully, but these errors were encountered: