Skip to main content
Inspiring
January 24, 2013
Answered

Problem With Loading Files On Android

  • January 24, 2013
  • 1 reply
  • 406 views

Hi,

I am using the below code to load video which is packaged within my app. It works fine on IOS and the desktop, but not on Android. It appears that the nativePath property is null for some reason on Android. Does anyone know the reason for this?

thx

var videoFile:File;

var videoPath:String;

var description:String = contentXml.text;

var videoUrl:String = contentXml.media.source.(@type == "large_image");

var videoPathStr:String = "data/cmms/images/" + cmmsAssetId + ".mp4";

videoFile = File.applicationDirectory.resolvePath(videoPathStr);

videoPath = new File(new File(videoFile.url).nativePath).url;

This topic has been closed for replies.
Correct answer leejk

Looks like nativePath is always null on Android... didn't see mention of that in documentation. Anyway fixed it with new File(videoFile.url).url

1 reply

leejkAuthorCorrect answer
Inspiring
January 24, 2013

Looks like nativePath is always null on Android... didn't see mention of that in documentation. Anyway fixed it with new File(videoFile.url).url