Skip to content

AVPlayerItem was deallocated while key value observers were still registered with it.  #185

@S-Freedom

Description

@S-Freedom

use RACObserve caused a crash:
creash info:

#56 Thread
NSInternalInconsistencyException

An instance 0x178201b40 of class AVPlayerItem was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x174a3bca0> ( <NSKeyValueObservance 0x1754523c0: Observer: 0x1704342e0, Key path: playbackLikelyToKeepUp, Options: <New: NO, Old: NO, Prior: YES> Context: 0x1758637c0, Property: 0x175e5df70> )

my code:
//缓冲区播放完成
[RACObserve(self.playerItem, playbackBufferEmpty) subscribeNext:^(id _Nullable x) {
@strongify(self);
BOOL empty = [x boolValue];
if (empty) {
//缓冲区为空
[self callBackDelegateStatus:PlayerStatusBuffering];
}
}];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions