Commit 4a5db98b authored by Felix Paul Kühne's avatar Felix Paul Kühne

media player: don't crash if the optional recording protocol is not implemented (fixes #237)

parent 4cccc28d
......@@ -1553,8 +1553,15 @@ static void HandleMediaPlayerRecord(const libvlc_event_t * event, void * self)
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];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment