Skip to main content
Participant
July 27, 2016
Question

StageWebView on iOS crashes when loading local files

  • July 27, 2016
  • 2 replies
  • 735 views

Using SDK 21 onwards, ios app crashes when stageWebView attempts to load local files. This worked prior to SDK 21. I am working on Windows.

I've tried loading external files and webpages, and that works fine. When loading local images and videos, the app crashes instantly.

Has anyone come across a fix? And for a short term aid, does anyone have suggestions on another way to load local video files using native video player?

Example:

var webView = new StageWebView();

webView.stage = this.stage;

webView.viewPort = new Rectangle(0, (stage.stageHeight-videoHeight)/2, videoWidth, videoHeight);

var dir:File = File.applicationDirectory.resolvePath("videoAssets/"+model.videoToPlay);

webView.addEventListener(ErrorEvent.ERROR, traceError);

webView.loadURL(dir.nativePath); // Crashes here

This topic has been closed for replies.

2 replies

deesharm
Adobe Employee
Adobe Employee
August 16, 2016

Hi,

This is a known issue to us and below is the link to the bug logged for the same:

Bug#4180325 - StageWebView makes application crash. iOS Air21+

We are currently looking into it.

Thanks,

Adobe AIR Team

Participant
August 16, 2016

Would like to add that I'm running into the exact same problem. Worked fine with airsdk 20, but crashes on 21, 22 and 23beta.

lenniferAuthor
Participant
August 16, 2016

Actually I found a fix, that worked for me with air 21 (I haven't tested with later). Adding "file://" to fixed the crashing issue:

eg. webView.loadURL("file://" + dir.nativePath);