0

Here I come with a new challenge for you all, Objective-C developers:

I'm trying to load some HTML5 exports from Articulate into an UIWebView. Well, at first sight it's quite simple: just put the HTML5 resources into the project and call index.html.

Well, that simply doesn't work if the HTML5 resource have a complex javascript structure. Specially with <audio> and <video> tags.

Any idea?

Jorge Ramos
  • 891
  • 10
  • 21
  • Do you mean UIWebView (as mentioned in the question/title) or WKWebView (as mentioned in your answer)? – EthanB Apr 23 '15 at 12:41
  • There are some other work-arounds for WKWebView here: http://stackoverflow.com/q/24882834/1580288 – EthanB Apr 23 '15 at 12:49
  • Hi there @EthanB, it0s just a workaround I fought a couple of days ago at work. It seems that Articulate HTML5 exports don't want to play with UIWebView or WKWebView locally anymore so, in my own answer, I've found a solution. Just sharing with everyone, if it could help. – Jorge Ramos Apr 24 '15 at 07:12

1 Answers1

0

I've been investigating for hours and the solution appeared with some lateral thinking:

If the main problem is that reading locally doesn't work, but the app requirements forces you to maintain the content offline, then let's serve the content locally!.

Here are the steps I followed to resolve this issue:

  1. Embed a web server into your app (I prefer GCDWebServer)
  2. Let GDCWebServer serve your storyline locally with: [webServer startWithOptions:@{@"BindToLocalhost": @YES} error:nil];
  3. Use WKWebView to call your local web server with: [wkView loadRequest:[NSURLRequest requestWithURL:webServer.serverURL]];

Then you will see your Articulate storyline working perfectly in your app inside a window, with iOS8.

Hope this can help someone.

Jorge Ramos
  • 891
  • 10
  • 21