From b9dd6f642d8acfbd344d74869a9a9535e48b25bb Mon Sep 17 00:00:00 2001 From: johnwenjunwu Date: Thu, 22 Apr 2021 20:22:14 +0800 Subject: [PATCH] feat(las_ios): register ijklas_demuxer through url or format_name --- .../IJKMediaDemo/IJKMoviePlayerViewController.m | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ios/IJKMediaDemo/IJKMediaDemo/IJKMoviePlayerViewController.m b/ios/IJKMediaDemo/IJKMediaDemo/IJKMoviePlayerViewController.m index 6859d63d89..79ceb60f8c 100644 --- a/ios/IJKMediaDemo/IJKMediaDemo/IJKMoviePlayerViewController.m +++ b/ios/IJKMediaDemo/IJKMediaDemo/IJKMoviePlayerViewController.m @@ -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; } @@ -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;