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
[TIMOB-16102] iOS: AudioPlayer progress event not firing #7974
Conversation
3cb6232
to
be3085b
Compare
{ | ||
[timer invalidate]; | ||
RELEASE_TO_NIL(timer); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
67547d9
to
8555d31
Compare
@@ -50,15 +50,19 @@ -(void)_listenerAdded:(NSString *)type count:(int)count | |||
{ | |||
if (count == 1 && [type isEqualToString:@"progress"]) | |||
{ | |||
progress = YES; | |||
timer = [[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(updateProgress:) userInfo:nil repeats:YES] retain]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cause problems when the user creates different progress
event listener. That's why it was in the initial creation only. Please test different event listeners and try to come up with a solution that can handle different event listeners as well (like before).
Added Validation so the timer is only initialized once, this will allow you to have multiple progress events like so :
|
PR rejected. It only doesn't work in your example because the event listener is placed incorrectly. Placing it before starting the player fixes the issue (which is none, because that's the common way to implement the observer pattern). More info inside the ticket. |
JIRA