Commit 34b02260 authored by Pierre SAGASPE's avatar Pierre SAGASPE Committed by Felix Paul Kühne

oneDrive: display the media thumbnails if available

Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 35b193bb
......@@ -171,9 +171,13 @@
self.folderTitleLabel.hidden = YES;
if (self.oneDriveFile.isAudio)
self.thumbnailView.image = [UIImage imageNamed:@"audio"];
else if (self.oneDriveFile.isVideo)
else if (self.oneDriveFile.isVideo) {
self.thumbnailView.image = [UIImage imageNamed:@"movie"];
else
if (_oneDriveFile.thumbnailURL != nil) {
_iconURL = [NSURL URLWithString:_oneDriveFile.thumbnailURL];
[self performSelectorInBackground:@selector(_updateIconFromURL) withObject:@""];
}
} else
self.thumbnailView.image = [UIImage imageNamed:@"blank"];
}
}
......@@ -183,9 +187,10 @@
- (void)_updateIconFromURL
{
NSData* imageData = [[NSData alloc]initWithContentsOfURL:_iconURL];
UIImage* image = [[UIImage alloc] initWithData:imageData];
NSData *imageData = [[NSData alloc] initWithContentsOfURL:_iconURL];
UIImage *image = [[UIImage alloc] initWithData:imageData];
if (image != nil) {
self.thumbnailView.contentMode = UIViewContentModeScaleAspectFit;
self.thumbnailView.image = image;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment