Chubby said swift10--------avplayer after removal, monitoring does not release the issue

Source: Internet
Author: User

Avplayer how to release after playing the video, I have removed the monitoring, after exiting the controller will still have a sound? And will also walk the bag.

When you encounter such problems, it may be that you are releasing the class without completely releasing the Avplayer.

Self.player.currentItem.cancelPendingSeeks ()
self.player.currentItem.asset.cancelLoading ()
// When you call the Addperiodictimeobserverforinterval method in your code, you also need to release the Playbackobserver object returned by Addperiodictimeobserverforinterval
Self.player.removeTimeObserver:playbackObserver ()

At this point, it is possible to release the operation of Avplayer, in addition to the deinit{} method remove the Listener notification method is OK.

My Jane book Link: HTTP://WWW.JIANSHU.COM/P/0EBD070EFBFA





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.