ReactiveObjC
ReactiveObjC copied to clipboard
AVPlayerItem was deallocated while key value observers were still registered with it.
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]; } }];