-
Notifications
You must be signed in to change notification settings - Fork 428
Closed
Description
There is a regression (or I just discovered that the previous fix was incomplete). I refer to this commit:
6cbc741
that solved this issue:
#2551
Currently, after reinstalling an app on iOS, the images are still shown correctly, but videos are not, because the home path is not seamlessly updated. Do you remember that after reinstalling an app on iOS its home path is changed every time?
In the while, I workarounded this issue with this temporary code, that will not more necessary after a proper fix in Codename One:
public static Container getMediaPlayer(String videoFile) throws IOException {
String videoFilePath;
String homePath = FileSystemStorage.getInstance().getAppHomePath();
if (DeviceUtilities.isiOSNative() && !videoFile.startsWith(homePath)) {
// Small workaround for the change of home path on iOS after upgrading the app
String myAppDir = "/Documents/app.myapp.client/";
String relativePath = videoFile.substring(videoFile.lastIndexOf(myAppDir) + myAppDir.length());
videoFilePath = homePath + relativePath;
} else {
videoFilePath = videoFile;
}
Log.p("Video file: " + videoFilePath + " lenght (bytes): " + FileSystemStorage.getInstance().getLength(videoFilePath), Log.DEBUG);
[....]
Media video = MediaManager.createMedia(videoFilePath, true, () -> {
[....]
Metadata
Metadata
Assignees
Labels
No labels