Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (id) initWithContentPath: (NSString *) path
- parameters: (NSDictionary *) parameters
- {
- NSAssert(path.length > 0, @"empty path");
- self = [super initWithNibName:nil bundle:nil];
- if (self) {
- _moviePosition = 0;
- // self.wantsFullScreenLayout = YES;
- _parameters = parameters;
- __weak KxMovieViewController *weakSelf = self;
- KxMovieDecoder *decoder = [[KxMovieDecoder alloc] init];
- decoder.interruptCallback = ^BOOL(){
- __strong KxMovieViewController *strongSelf = weakSelf;
- return strongSelf ? [strongSelf interruptDecoder] : YES;
- };
- dispatch_async(dispatch_get_global_queue(0, 0), ^{
- NSError *error = nil;
- [decoder openFile:path error:&error];
- __strong KxMovieViewController *strongSelf = weakSelf;
- if (strongSelf) {
- dispatch_sync(dispatch_get_main_queue(), ^{
- [strongSelf setMovieDecoder:decoder withError:error];
- });
- }
- });
- }
- return self;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement