+ (instancetype)itemWithURL:(NSString *)URLString thumbnailURL:(NSString*)thumbnailURL; //Thumbs are automatically generated for Videos. But you can set Thumb Images for GalleryTypeImage.
+ (instancetype)itemWithURL:(NSString*)URLString galleryType:(MHGalleryType)galleryType;
+ (instancetype)itemWithYoutubeVideoID:(NSString*)ID;
+ (instancetype)itemWithVimeoVideoID:(NSString*)ID;
+ (instancetype)itemWithImage:(UIImage*)image;
MHGalleryController
+(instancetype)galleryWithPresentationStyle:(MHGalleryViewMode)presentationStyle;
@property (nonatomic,assign) id<MHGalleryDelegate> galleryDelegate;
@property (nonatomic,assign) id<MHGalleryDataSource> dataSource;
@property (nonatomic,assign) BOOL autoplayVideos; //Default NO
@property (nonatomic,assign) NSInteger presentationIndex; //From which index you want to present the Gallery.
@property (nonatomic,strong) UIImageView *presentingFromImageView;
@property (nonatomic,strong) MHGalleryImageViewerViewController *imageViewerViewController;
@property (nonatomic,strong) MHOverviewController *overViewViewController;
@property (nonatomic,strong) NSArray *galleryItems; //You can set an Array of GalleryItems or you can use the dataSource.
@property (nonatomic,strong) MHTransitionCustomization *transitionCustomization; //Use transitionCustomization to Customize the GalleryControllers transitions
@property (nonatomic,strong) MHUICustomization *UICustomization; //Use UICustomization to Customize the GalleryControllers UI
@property (nonatomic,strong) MHTransitionPresentMHGallery *interactivePresentationTransition;
@property (nonatomic,assign) MHGalleryViewMode presentationStyle;
@property (nonatomic,assign) UIStatusBarStyle preferredStatusBarStyleMH;
@property (nonatomic, copy) void (^finishedCallback)(NSUInteger currentIndex,UIImage *image,MHTransitionDismissMHGallery *interactiveTransition,MHGalleryViewMode viewMode);
I try to display an image with your gallery but i always have this error :
-[UIImageView setImageForMHGalleryItem:imageType:successBlock:]: unrecognized selector sent to instance
I'm encountering strange problem with some videos, from Youtube for now. First off the video thumbnail is not displayed, only grey background. After press video starts to load but it will not starts playing until play is pressed.
When the button Done is pressed, thats when the crash occurs with following:
*** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan nan]'
Hey,
thanks for sharing your work. I really like it.
The dataSource for a gallery always contains MHGalleryItems which rely on the url. My dataSource (NSMutableArray) is made up of several UIImages fetched by CoreData objects. Is it possible to extend "MHGalleryItem" to support direct use of UIImages? Or do I need to write them down to the filesystem in order to get the url?
How can I Disable collection gallery in this lib?
I mean this collection: I tap on photo and I am in photoView, I tap back and I am in collection gallery.
I want to go back to my VC then I tap this back. Is it possible?
I am using gallery MHGalleryDataSource methods to load images in gallery. When there are more than 200 images the overview controller is unable to load and crashes. For small number of images it works fine. Also I tried to resize image dynamically to 100x100 and it works fine. Only the original size images fails to load in overview controller.
I'm using AFNetworking and MHVideoPhotoGallery on my project, importing "UIImageView+AFNetworking.h" and "MHGallery.h" (UIImageView+WebCache.h) in the same file and both has the method:
this just fixes the warnings you get when you run the static analyzer in Xcode with cmd+shift+B. They are all false positives, your code was just fine before. Expressing it in a different way makes the static analyzer happy :).
I don't have the "why" of the crash (yet) but I can reproduce it.
The crash happens after trying to play this (240p only) video: https://www.youtube.com/watch?v=sn_GCGJCxo8
After waiting a few seconds the video doesn't seem to load even though the time bar appears. If you try to dismiss the video at this point the app crash at line 183 of MHTransitionDismissMHGallery.m with Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan nan]'
Line 183 of MHTransitionDismissMHGallery.m is the last line of the following portion of code
if (imageViewerCurrent.isPlayingVideo && imageViewerCurrent.moviePlayer) {
self.moviePlayer = imageViewerCurrent.moviePlayer;
[self.moviePlayer.view setFrame:AVMakeRectWithAspectRatioInsideRect(imageViewerCurrent.moviePlayer.naturalSize,fromViewController.view.bounds)];
imageViewerCurrent.moviePlayer.naturalSize has a value of {0,0} in this situation, causing the exception.
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SFAuthenticationViewController viewControllers]: unrecognized selector sent to instance...
Getting this error While try to login Via Facebook.
UINavigationController nav = (UINavigationController)presented;
It crashes at this line in "MHGalleryController" Is there any solution?
The animation on the MHShareViewController to resize photos in the share view is corrupted on iOS 11. the select boxes are out of the bounds. This can be seen in the provided examples. tap on an image then click on share button.
There is only one place where I can find 'UIScrollViewDelayedTouchesBeganGestureRecognizer' and 'UIScrollViewPanGestureRecognizer' is in MHGalleryImageViewerViewController. What can I do with it?
api.video is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.
A high-level video composition framework build on top of AVFoundation. It's simple to use and easy to extend. Use it and make life easier if you are implementing video composition feature.