Skip to content

Commit

Permalink
VLCMediaPlayerDelegate: Rename from recordingStoppedAtPath to recordi…
Browse files Browse the repository at this point in the history
…ngStoppedAtURL If recording fails, return url as nil
  • Loading branch information
Hachiware-05-01 committed Sep 18, 2023
1 parent 9163783 commit a3e2d49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Headers/Public/VLCMediaPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
/**
* Sent by the default notification center whenever the player stopped recording.
* @param player the player who stopped recording
* @param path the path to the file that the player recorded to
* @param url the path to the file that the player recorded to
*/
- (void)mediaPlayer:(VLCMediaPlayer *)player recordingStoppedAtPath:(NSString *)path;
- (void)mediaPlayer:(VLCMediaPlayer *)player recordingStoppedAtURL:(nullable NSURL *)url;

@end

Expand Down
6 changes: 4 additions & 2 deletions Sources/VLCMediaPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,10 @@ static void HandleMediaPlayerRecord(const libvlc_event_t * event, void * opaque)
if ([mediaPlayer.delegate respondsToSelector: @selector(mediaPlayerStartedRecording:)])
[mediaPlayer.delegate mediaPlayerStartedRecording: mediaPlayer];
}else{
if ([mediaPlayer.delegate respondsToSelector: @selector(mediaPlayer:recordingStoppedAtPath:)] && filePath)
[mediaPlayer.delegate mediaPlayer: mediaPlayer recordingStoppedAtPath: filePath];
if ([mediaPlayer.delegate respondsToSelector: @selector(mediaPlayer:recordingStoppedAtURL:)]) {
NSURL *url = [filePath hasPrefix: @"/"] ? [NSURL fileURLWithPath: filePath isDirectory: NO] : nil;
[mediaPlayer.delegate mediaPlayer: mediaPlayer recordingStoppedAtURL: url];
}
}
}];
}
Expand Down

0 comments on commit a3e2d49

Please sign in to comment.