Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Preventing multiple observers for the same notification #832

Merged
merged 1 commit into from
Jun 4, 2018

Conversation

jalieven
Copy link
Contributor

When a video is set to repeat the attachListeners method gets called on every cycle thus adding the same observer over and over again, which all get called at the end of a cycle which is kinda pointless. This can be mitigated by first removing the observer before adding it.
I encountered this behaviour while debugging to find out why this 'AVPlayerItemDidPlayToEndTimeNotification'-observer did not get called for the second time for repeat m3u8 videos on iOS 11. The bug report can be found here.

@cobarx
Copy link
Contributor

cobarx commented Jun 4, 2018

Thanks for noticing this issue and providing a fix!

@cobarx cobarx merged commit 88f6e7d into TheWidlarzGroup:master Jun 4, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants