0

UIWebView is properly loading other normal HTML saved locally but doesn't load this HTML5 file containing JavaScript structure but not any video/audio tags (although the page does include audio,video and images).

UIWebView *web=[[UIWebView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
web.backgroundColor=[UIColor clearColor];
web.opaque=YES;
web.scrollView.bounces=NO;
web.scrollView.showsHorizontalScrollIndicator=NO;
web.scrollView.showsVerticalScrollIndicator=NO;
NSString *path=[[NSBundle mainBundle]bundlePath];
NSURL *baseUrl=[NSURL fileURLWithPath:path];

NSString *html_file_str=[[NSBundle mainBundle]pathForResource:@"index" ofType:@"html"];
NSString *html_str=[NSString stringWithContentsOfFile:html_file_str encoding:NSASCIIStringEncoding error:nil];
[web loadHTMLString:html_str baseURL:baseUrl];
web.delegate=self;
[self.view addSubview:web];
Tarun Tanwar
  • 41
  • 12
  • 1
    May be it will help you :) [Here is link](http://stackoverflow.com/questions/5733883/loading-javascript-into-a-uiwebview-from-resources) – Meera Dec 21 '15 at 09:17
  • Appreciate your help @Meera; but my concern is something related to this : http://stackoverflow.com/questions/29789953/uiwebview-cannot-read-correctly-some-local-html5-stuff – Tarun Tanwar Dec 24 '15 at 06:26

0 Answers0