Skip to content

Commit

Permalink
feat(las_ios): register ijklas_demuxer through url or format_name
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwenjunwu committed Apr 23, 2021
1 parent 640f3cb commit b9dd6f6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions ios/IJKMediaDemo/IJKMediaDemo/IJKMoviePlayerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ + (void)presentFromViewController:(UIViewController *)viewController withTitle:(
- (instancetype)initWithManifest: (NSString*)manifest_string {
self = [self initWithNibName:@"IJKMoviePlayerViewController" bundle:nil];
if (self) {
NSString *fake_url = @"http://fakeurl_for_manifest";
NSURL *url = [NSURL URLWithString:fake_url];
self.url = url;
self.url = [NSURL URLWithString:@"manifest.las"];
self.manifest = manifest_string;
}
self.manifest = manifest_string;
return self;
}

Expand Down Expand Up @@ -87,8 +85,9 @@ - (void)viewDidLoad
IJKFFOptions *options = [IJKFFOptions optionsByDefault];

if (self.manifest != nil){
[options setFormatOptionValue:self.manifest forKey:@"manifest_string"];
[options setPlayerOptionIntValue:1 forKey:@"is-manifest"];
[options setPlayerOptionValue:@"ijklas" forKey:@"iformat"];
[options setPlayerOptionIntValue:0 forKey:@"find_stream_info"];
[options setFormatOptionValue:self.manifest forKey:@"manifest_string"];
}
self.player = [[IJKFFMoviePlayerController alloc] initWithContentURL:self.url withOptions:options];
self.player.view.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
Expand Down

0 comments on commit b9dd6f6

Please sign in to comment.