From: Matthew Waters Date: Wed, 20 Mar 2019 15:08:41 +0000 (+1100) Subject: ios tutorials: make tutorial 4/5 work correclty again X-Git-Tag: 1.19.3~489^2~169 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef2fd1d49ed7bf296b1886bd389c6e3e94a2390c;p=platform%2Fupstream%2Fgstreamer.git ios tutorials: make tutorial 4/5 work correclty again Inspiration from the following commits: https://gitlab.freedesktop.org/gstreamer/gst-examples/commit/5188475abd0509c7646da2363702f46b414fd98b https://gitlab.freedesktop.org/gstreamer/gst-examples/commit/49c92a9752af56a955b449a600c31de051060ffe https://gitlab.freedesktop.org/gstreamer/gst-examples/commit/30e730bccc40635ab0b54d533a6e3b9af865d378 https://gitlab.freedesktop.org/gstreamer/gst-examples/commit/4a62c09504f2f61c5dfc732e76b85d68744a85eb --- diff --git a/examples/tutorials/xcode iOS/Tutorial 4/VideoViewController.m b/examples/tutorials/xcode iOS/Tutorial 4/VideoViewController.m index dba4311..3ed48b1 100644 --- a/examples/tutorials/xcode iOS/Tutorial 4/VideoViewController.m +++ b/examples/tutorials/xcode iOS/Tutorial 4/VideoViewController.m @@ -69,6 +69,10 @@ uri = @"https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.ogv"; 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 @@ -143,8 +147,6 @@ video_width_constraint.constant = correct_width; 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); } /* diff --git a/examples/tutorials/xcode iOS/Tutorial 5/LibraryViewController.m b/examples/tutorials/xcode iOS/Tutorial 5/LibraryViewController.m index 6605eda..7953c8d 100644 --- a/examples/tutorials/xcode iOS/Tutorial 5/LibraryViewController.m +++ b/examples/tutorials/xcode iOS/Tutorial 5/LibraryViewController.m @@ -2,6 +2,8 @@ #import "VideoViewController.h" #import +#define ENABLE_IOS_LIBRARY false + @interface LibraryViewController () @end @@ -95,10 +97,14 @@ static NSString *CellIdentifier = @"CellIdentifier"; - (void)refreshMediaItems { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSAllDomainsMask, YES); + NSString *docsPath = [paths objectAtIndex:0]; + NSMutableArray *entries; + +#if ENABLE_IOS_LIBRARY /* Entries from the Photo Library */ - NSMutableArray *entries = [[NSMutableArray alloc] init]; + entries = [[NSMutableArray alloc] init]; ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; [library enumerateGroupsWithTypes:ALAssetsGroupAll usingBlock:^(ALAssetsGroup *group, BOOL *stop) @@ -122,7 +128,7 @@ static NSString *CellIdentifier = @"CellIdentifier"; } ]; self->libraryEntries = entries; - +#endif /* Retrieve entries from iTunes file sharing */ entries = [[NSMutableArray alloc] init]; for (NSString *e in [[NSFileManager defaultManager] contentsOfDirectoryAtPath:docsPath error:nil]) diff --git a/examples/tutorials/xcode iOS/Tutorial 5/VideoViewController.m b/examples/tutorials/xcode iOS/Tutorial 5/VideoViewController.m index 90ac28f..f1f92ac 100644 --- a/examples/tutorials/xcode iOS/Tutorial 5/VideoViewController.m +++ b/examples/tutorials/xcode iOS/Tutorial 5/VideoViewController.m @@ -67,6 +67,10 @@ media_height = 240; 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 @@ -144,8 +148,6 @@ video_width_constraint.constant = correct_width; 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); } /*