ios tutorials: make tutorial 4/5 work correclty again

Inspiration from the following commits:
5188475abd
49c92a9752
30e730bccc
4a62c09504
This commit is contained in:
Matthew Waters 2019-03-21 02:08:41 +11:00
parent 266b227024
commit ef2fd1d49e
3 changed files with 16 additions and 6 deletions

View file

@ -69,6 +69,10 @@
uri = @"https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.ogv"; uri = @"https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.ogv";
gst_backend = [[GStreamerBackend alloc] init:self videoView:video_view]; gst_backend = [[GStreamerBackend alloc] init:self videoView:video_view];
time_slider.value = 0;
time_slider.minimumValue = 0;
time_slider.maximumValue = 0;
} }
- (void)viewDidDisappear:(BOOL)animated - (void)viewDidDisappear:(BOOL)animated
@ -143,8 +147,6 @@
video_width_constraint.constant = correct_width; video_width_constraint.constant = correct_width;
video_height_constraint.constant = view_height; video_height_constraint.constant = view_height;
} }
time_slider.frame = CGRectMake(time_slider.frame.origin.x, time_slider.frame.origin.y, toolbar.frame.size.width - time_slider.frame.origin.x - 8, time_slider.frame.size.height);
} }
/* /*

View file

@ -2,6 +2,8 @@
#import "VideoViewController.h" #import "VideoViewController.h"
#import <AssetsLibrary/AssetsLibrary.h> #import <AssetsLibrary/AssetsLibrary.h>
#define ENABLE_IOS_LIBRARY false
@interface LibraryViewController () @interface LibraryViewController ()
@end @end
@ -95,10 +97,14 @@ static NSString *CellIdentifier = @"CellIdentifier";
- (void)refreshMediaItems { - (void)refreshMediaItems {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSAllDomainsMask, YES); NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSAllDomainsMask, YES);
NSString *docsPath = [paths objectAtIndex:0]; NSString *docsPath = [paths objectAtIndex:0];
NSMutableArray *entries;
#if ENABLE_IOS_LIBRARY
/* Entries from the Photo Library */ /* Entries from the Photo Library */
NSMutableArray *entries = [[NSMutableArray alloc] init]; entries = [[NSMutableArray alloc] init];
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library enumerateGroupsWithTypes:ALAssetsGroupAll [library enumerateGroupsWithTypes:ALAssetsGroupAll
usingBlock:^(ALAssetsGroup *group, BOOL *stop) usingBlock:^(ALAssetsGroup *group, BOOL *stop)
@ -122,7 +128,7 @@ static NSString *CellIdentifier = @"CellIdentifier";
} }
]; ];
self->libraryEntries = entries; self->libraryEntries = entries;
#endif
/* Retrieve entries from iTunes file sharing */ /* Retrieve entries from iTunes file sharing */
entries = [[NSMutableArray alloc] init]; entries = [[NSMutableArray alloc] init];
for (NSString *e in [[NSFileManager defaultManager] contentsOfDirectoryAtPath:docsPath error:nil]) for (NSString *e in [[NSFileManager defaultManager] contentsOfDirectoryAtPath:docsPath error:nil])

View file

@ -67,6 +67,10 @@
media_height = 240; media_height = 240;
gst_backend = [[GStreamerBackend alloc] init:self videoView:video_view]; gst_backend = [[GStreamerBackend alloc] init:self videoView:video_view];
time_slider.value = 0;
time_slider.minimumValue = 0;
time_slider.maximumValue = 0;
} }
- (void)viewDidDisappear:(BOOL)animated - (void)viewDidDisappear:(BOOL)animated
@ -144,8 +148,6 @@
video_width_constraint.constant = correct_width; video_width_constraint.constant = correct_width;
video_height_constraint.constant = view_height; video_height_constraint.constant = view_height;
} }
time_slider.frame = CGRectMake(time_slider.frame.origin.x, time_slider.frame.origin.y, toolbar.frame.size.width - time_slider.frame.origin.x - 8, time_slider.frame.size.height);
} }
/* /*