Commit 292b3a49 authored by Felix Paul Kühne's avatar Felix Paul Kühne

create thumbnails at device specific sizes

this optimizes the memory usage on old iPhones and adds support for the Retina iPad
parent a9b9897d
......@@ -50,6 +50,24 @@
VLCMedia *media = [VLCMedia mediaWithURL:[NSURL URLWithString:self.file.url]];
VLCMediaThumbnailer *thumbnailer = [VLCMediaThumbnailer thumbnailerWithMedia:media andDelegate:self];
/* optimize thumbnails for the device */
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
if ([UIScreen mainScreen].scale==2.0) {
thumbnailer.thumbnailWidth = 540.;
thumbnailer.thumbnailHeight = 405.;
} else {
thumbnailer.thumbnailWidth = 272.;
thumbnailer.thumbnailHeight = 204.;
}
} else {
if ([UIScreen mainScreen].scale==2.0) {
thumbnailer.thumbnailWidth = 200.;
thumbnailer.thumbnailHeight = 150.;
} else {
thumbnailer.thumbnailWidth = 100.;
thumbnailer.thumbnailHeight = 75.;
}
}
[thumbnailer fetchThumbnail];
[[MLThumbnailerQueue sharedThumbnailerQueue].queue setSuspended:YES]; // Balanced in -mediaThumbnailer:didFinishThumbnail
[self retain]; // Balanced in -mediaThumbnailer:didFinishThumbnail:
......
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