Skip to content
Snippets Groups Projects
Commit 6012c098 authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

media list player: add selectors to set drawable on init matching the media player class

parent dc1b90ce
No related branches found
No related tags found
No related merge requests found
......@@ -48,7 +48,9 @@ typedef NS_ENUM(NSInteger, VLCRepeatMode) {
@property (readwrite) VLCMedia *rootMedia;
@property (readonly) VLCMediaPlayer *mediaPlayer;
- (instancetype)initWithDrawable:(id)drawable;
- (instancetype)initWithOptions:(NSArray *)options;
- (instancetype)initWithOptions:(NSArray *)options andDrawable:(id)drawable;
/**
* Basic play, pause and stop are here. For other methods, use the mediaPlayer.
......
......@@ -17,6 +17,10 @@ New APIs:
- added notifications: VLCMediaPlayerTitleChanged, VLCMediaPlayerChapterChanged
- Note: play's return type was changed from BOOL to void
- VLCMediaListPlayer
- added selectors: initWithDrawable:
initWithOptions:andDrawable:
- VLCMedia
- added keys: VLCMetaInformationTrackTotal, VLCMetaInformationDirector,
VLCMetaInformationSeason, VLCMetaInformationEpisode,
......
......@@ -42,7 +42,7 @@
@implementation VLCMediaListPlayer
- (instancetype)initWithOptions:(NSArray *)options
- (instancetype)initWithOptions:(NSArray *)options andDrawable:(id)drawable
{
if (self = [super init]) {
VLCLibrary *library;
......@@ -52,14 +52,27 @@
library = [VLCLibrary sharedLibrary];
instance = libvlc_media_list_player_new([library instance]);
_mediaPlayer = [[VLCMediaPlayer alloc] initWithLibVLCInstance:libvlc_media_list_player_get_media_player(instance) andLibrary:library];
if (drawable != nil)
[_mediaPlayer setDrawable:drawable];
}
return self;
}
- (instancetype)initWithOptions:(NSArray *)options
{
return [self initWithOptions:options andDrawable:nil];
}
- (instancetype)init
{
return [self initWithOptions:nil];
return [self initWithOptions:nil andDrawable:nil];
}
- (instancetype)initWithDrawable:(id)drawable
{
return [self initWithOptions:nil andDrawable:drawable];
}
- (void)dealloc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment