From: Pierre d'Herbemont Date: Mon, 31 Aug 2009 08:46:22 +0000 (+0200) Subject: macosx/framework: Implement -playMedia:. X-Git-Tag: 1.1.0-ff~3686 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=7a779849558501c376c3d2e7d4205cda15400c96;hp=5995f330ba3032e8b3fa70dcb8d1a1648b68f3db;p=vlc macosx/framework: Implement -playMedia:. --- diff --git a/projects/macosx/framework/Headers/Public/VLCMediaListPlayer.h b/projects/macosx/framework/Headers/Public/VLCMediaListPlayer.h index bdc9c650ea..8bf30c57cc 100644 --- a/projects/macosx/framework/Headers/Public/VLCMediaListPlayer.h +++ b/projects/macosx/framework/Headers/Public/VLCMediaListPlayer.h @@ -32,4 +32,10 @@ */ - (void)play; - (void)stop; + +/** + * media must be in the current media list. + */ +- (void)playMedia:(VLCMedia *)media; + @end diff --git a/projects/macosx/framework/Sources/VLCMediaListPlayer.m b/projects/macosx/framework/Sources/VLCMediaListPlayer.m index 0d9c62cf3f..d6964c836c 100644 --- a/projects/macosx/framework/Sources/VLCMediaListPlayer.m +++ b/projects/macosx/framework/Sources/VLCMediaListPlayer.m @@ -88,6 +88,14 @@ return _rootMedia; } +- (void)playMedia:(VLCMedia *)media +{ + libvlc_exception_t ex; + libvlc_exception_init(&ex); + libvlc_media_list_player_play_item(instance, [media libVLCMediaDescriptor], &ex); + catch_exception(&ex); +} + - (void)play { libvlc_exception_t ex;