Skip to content

Commit

Permalink
fix #216 解决iOS11以下系统预览网络视频crash的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
longitachi committed Apr 21, 2018
1 parent f556669 commit 39791a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions PhotoBrowser/ZLBigImageCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -939,8 +939,6 @@ @implementation ZLPreviewNetVideo
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[self.playLayer.player.currentItem removeObserver:self forKeyPath:@"playbackBufferEmpty"];
[self.playLayer.player.currentItem removeObserver:self forKeyPath:@"playbackLikelyToKeepUp"];
}

- (void)layoutSubviews
Expand Down Expand Up @@ -1010,6 +1008,9 @@ - (void)loadNetVideo:(NSURL *)url

- (void)seekToZero
{
[self.playLayer.player.currentItem removeObserver:self forKeyPath:@"playbackBufferEmpty"];
[self.playLayer.player.currentItem removeObserver:self forKeyPath:@"playbackLikelyToKeepUp"];

AVPlayer *player = self.playLayer.player;
[player.currentItem seekToTime:kCMTimeZero];
}
Expand Down

0 comments on commit 39791a3

Please sign in to comment.