What I found so far is, that you can init the mediaplayer with options. What I have seen in the sources of VLCKit is, that the options parameter expects an NSArray <NSString *> * argument, so an NSArray of NSStrings.
There is also a default array of options, that indicate, that it simply uses the same options as you would use on VLC command line.
Unfortunately it is not possible to get this default array (private method) to add or change these default options.
But you can copy the settings from VLCLibrary.m:
Code: Select all
- (NSArray *)_defaultOptions
{
NSArray *vlcParams = [[NSUserDefaults standardUserDefaults] objectForKey:@"VLCParams"];
#if TARGET_OS_IPHONE
if (!vlcParams) {
vlcParams = @[@"--no-color",
@"--no-osd",
@"--no-video-title-show",
@"--no-stats",
@"--no-snapshot-preview",
#ifndef NOSCARYCODECS
@"--avcodec-fast",
#endif
@"--text-renderer=freetype",
@"--avi-index=3",
@"--extraintf=ios_dialog_provider"];
}
#else
if (!vlcParams) {
NSMutableArray *defaultParams = [NSMutableArray array];
[defaultParams addObject:@"--play-and-pause"]; // We want every movie to pause instead of stopping at eof
[defaultParams addObject:@"--no-color"]; // Don't use color in output (Xcode doesn't show it)
[defaultParams addObject:@"--no-video-title-show"]; // Don't show the title on overlay when starting to play
[defaultParams addObject:@"--verbose=4"]; // Let's not wreck the logs
[defaultParams addObject:@"--no-sout-keep"];
[defaultParams addObject:@"--vout=macosx"]; // Select Mac OS X video output
[defaultParams addObject:@"--text-renderer=freetype"];
[defaultParams addObject:@"--extraintf=macosx_dialog_provider"]; // Some extra dialog (login, progress) may come up from here
[[NSUserDefaults standardUserDefaults] setObject:defaultParams forKey:@"VLCParams"];
[[NSUserDefaults standardUserDefaults] synchronize];
vlcParams = defaultParams;
}
#endif
return vlcParams;
}
As you see, the options are written to the NSUserDefaults, where you can also read or set them from Settings or from your application before initing LibVLC through VLCKit. The NSArray with the NSStrings is written to the key @"VCLParams".
Both ways should work.