Code: Select all
- (id)initWithURL:(NSURL *)anURL
{
if (self = [super init]) {
VLCLibrary *library = [VLCLibrary sharedLibrary];
NSAssert(library.instance, @"no library instance when creating media");
p_md = libvlc_media_new_location(library.instance, [[anURL absoluteString] UTF8String]);
if(p_md) {
libvlc_media_add_option(p_md, [[NSString stringWithFormat:@":demux=ts"] UTF8String]);
}
delegate = nil;
metaDictionary = [[NSMutableDictionary alloc] initWithCapacity:3];
// This value is set whenever the demuxer figures out what the length is.
// TODO: Easy way to tell the length of the movie without having to instiate the demuxer. Maybe cached info?
length = nil;
[self initInternalMediaDescriptor];
}
return self;
}