Commit b6043e81 authored by Felix Paul Kühne's avatar Felix Paul Kühne

Movie View: add fill-to-screen as crop mode

parent faa0c470
......@@ -77,7 +77,7 @@
recognizer.delegate = self;
[self.view addGestureRecognizer:recognizer];
_aspectRatios = @[@"Default", @"4:3", @"16:9", @"16:10", @"2.21:1"];
_aspectRatios = @[@"DEFAULT", @"4:3", @"16:9", @"16:10", @"2.21:1", @"FILL_TO_SCREEN"];
}
- (void)viewWillAppear:(BOOL)animated
......@@ -101,7 +101,7 @@
if (self.mediaItem) {
self.title = [self.mediaItem title];
[_mediaPlayer setMedia:[VLCMedia mediaWithURL:[NSURL URLWithString:self.mediaItem.url]]];
self.mediaItem.unread = @0;
self.mediaItem.unread = @(NO);
} else {
[_mediaPlayer setMedia:[VLCMedia mediaWithURL:self.url]];
self.title = @"Network Stream";
......@@ -529,10 +529,37 @@
if (_currentAspectRatioMask + 1 > count - 1) {
_mediaPlayer.videoAspectRatio = NULL;
_mediaPlayer.videoCropGeometry = NULL;
_currentAspectRatioMask = 0;
[self.statusLabel showStatusMessage:[NSString stringWithFormat:NSLocalizedString(@"AR_CHANGED", @""), NSLocalizedString(@"DEFAULT", @"")]];
} else {
_currentAspectRatioMask++;
if ([_aspectRatios[_currentAspectRatioMask] isEqualToString:@"FILL_TO_SCREEN"]) {
UIScreen *screen;
if (![self hasExternalDisplay])
screen = [UIScreen mainScreen];
else
screen = [UIScreen screens][1];
float f_ar = screen.bounds.size.width / screen.bounds.size.height;
if (f_ar == (float)(640./1136.)) // iPhone 5 aka 16:9.01
_mediaPlayer.videoCropGeometry = "16:9";
else if (f_ar == (float)(2./3.)) // all other iPhones
_mediaPlayer.videoCropGeometry = "16:10"; // libvlc doesn't support 2:3 crop
else if (f_ar == .75) // all iPads
_mediaPlayer.videoCropGeometry = "4:3";
else if (f_ar == .5625) // AirPlay
_mediaPlayer.videoCropGeometry = "16:9";
else
APLog(@"unknown screen format %f, can't crop", f_ar);
[self.statusLabel showStatusMessage:NSLocalizedString(@"FILL_TO_SCREEN", @"")];
return;
}
_mediaPlayer.videoCropGeometry = NULL;
_mediaPlayer.videoAspectRatio = (char *)[_aspectRatios[_currentAspectRatioMask] UTF8String];
[self.statusLabel showStatusMessage:[NSString stringWithFormat:NSLocalizedString(@"AR_CHANGED", @""), _aspectRatios[_currentAspectRatioMask]]];
}
......
B"CHOOSE_AUDIO_TRACK"="Audiospur wählen";
......
B"CHOOSE_AUDIO_TRACK"="Choose Audio Track";
......
B"CHOOSE_AUDIO_TRACK"="Choisir Piste Audio";
......
B"CHOOSE_AUDIO_TRACK"="Выберите аудио поток";
......
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