Skip to content

Commit

Permalink
media player: don't crash if the optional recording protocol is not i…
Browse files Browse the repository at this point in the history
…mplemented (fixes #237)
  • Loading branch information
fkuehne committed Jan 9, 2019
1 parent 4cccc28 commit 4a5db98
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Sources/VLCMediaPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -1553,8 +1553,15 @@ - (void)mediaPlayerRecordChanged:(NSArray *)arguments
NSString *filePath = arguments.firstObject[@"filePath"];
BOOL isRecording = [arguments.firstObject[@"isRecording"] boolValue];

isRecording ? [_delegate mediaPlayerStartedRecording:self]
: [_delegate mediaPlayer:self recordingStoppedAtPath:filePath];
if (isRecording) {
if ([(NSObject *)_delegate respondsToSelector:@selector(mediaPlayerStartedRecording:)]) {
[_delegate mediaPlayerStartedRecording:self];
}
} else {
if ([(NSObject *)_delegate respondsToSelector:@selector(mediaPlayer:recordingStoppedAtPath:)]) {
[self.delegate mediaPlayer:self recordingStoppedAtPath:filePath];
}
}
}

@end

0 comments on commit 4a5db98

Please sign in to comment.