autresphere / asmediafocusmanager Goto Github PK
View Code? Open in Web Editor NEWiOS library to animate your image and video thumbnails to fullscreen.
License: MIT License
iOS library to animate your image and video thumbnails to fullscreen.
License: MIT License
First of all thank you for this excellent code.
in my scenario i have the situation that the small images are loaded in the tableview.
when i click the small images everything works as it should :)
this code can be extended to asynchronously download an image while showing its lower res one and then replacing it when the download completes...
what do you say? is this something that can be achieved easily using your library?
thanks
I implement ASMediaFocusManager in my project but, I don't know how to customise the button, I need a delete and a flash button plus the done button.
is there a way to do this?
Hi,
I implement MediaFocus and Player and I get this error
`*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UICustomObject 0x1742043d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key currentTimeLabel.'``
hiding the navigation bar in the method does hide the nav bar but there is a jump in the resulting animation.
I am having a hard time getting ASMediaFocusManager to work with Cocoapods.
This is the error:
Unable to run command 'StripNIB ASMediaFocusController.nib' - this target might include its own product.
Specs:
Xcode 5.0.2 (5A3005)
OSX 10.9 (13A603)
CocoaPods 0.28.0
The install method is called installOnView, and it allows you install to a view that is not a UIImageView. This is misleading, since things don't actually work unless you install to a UIImageView. Perhaps the method should be called installOnImageView and should throw an error if the type is wrong? Or better yet, enable this to work with any UIView. Cool library, thank you.
I'm a newbie, looking to get the image focus but i want to implement it where the photo enlarge happens as user taps the photo and as the user removes the tap the enlarged view is dismissed. any suggestions?
Would like to customize the code to add a scrollview with multiple images when user taps on any image from a collectionview
Can anybody provide any inputs here..
Thanks in advance
Hello,
i'm new in iOS development, and i'd like to use this pod in one project, do you have any example or quick guide how to use it with swift??
Thanks.
I have a video with 360x480 and am playing it on an iPhone4S, but I can see a bit of the underlying imageview image (mainImageView from ASMediaFocusController). Through debug I removed the image and painted the imageview's background red so you can see better what is happening (notice the vertical red near the edges):
The PlayerView has the correct frame, but it's layer isn't filling it, we need to set videoGravity = AVLayerVideoGravityResizeAspectFill
for it to fill completely the PlayerView. Something like:
- (void)showPlayerWithURL:(NSURL *)url
{
self.playerView = [[PlayerView alloc] initWithFrame:self.mainImageView.bounds];
((AVPlayerLayer *)(self.playerView.layer)).videoGravity = AVLayerVideoGravityResizeAspectFill;
...
Doing that the video fills the entire PlayerView as expected.
This repo should be tagged as v0.1 or something similar, so that the podspec included here can be added to the cocoapods specs repository.
I am not sure (yet) how to approach this with ASMediaFocusManager (if i stumbled on it i'll post my code).
I show am imageView on screen (much like the example) and tapping that image works great. You can rotate and it rotates like it should - much like the example. However, I'd like to not touch that image. Instead rotate the device and have it go straight into (animated) the rotated view of ASMediaFocusManager (just like if you were to have touched the imageView originally). Any feedback on how to approach that? Is it possible to do with the current version?
Thanks !!
Currently implementation hides the done button as user zooms in the image. Is there any way to still show the button instead of hiding it?
There seems to be an issue where CocoaPods (or something else) isn't installing the needed XIB resource into the final binary. It doesn't crash the app, but nothing loads. The screen is only darkened, no images are displayed. This was from a fresh install from CocoaPods.
Hi,
In this usecase
User taps a photo -> MediaFocusManager focused -> Press Home Button -> Open app from background -> App Freezed
A freezing happens (ASTransparentView is on top of everything).
Is it an ASMediaFocusManager or a bad implementation?
Hi,
thanks for this awesome component. It makes a lot of stuff easier. But there is still some issues:
This is only happening when I have UIViewController inside NavigationController and the supportedInterfaceOrientations is set to UIInterfaceOrientationMaskPortrait
I am testing on iOS 8.3 right now
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
The parentViewController is set to self.navigationController
Now when I enlarge the image and change the orientation nothing happens. Although if I would set parentViewController = self it would work.
I dug into code and found out why it is not working:
in ASMediaFocusController in viewDidAppear
the controller subscribes to receive Orientation change notification. When is the parentViewController a navigationController it is simply not being called. I am not sure why it is when in the other case it works perfectly fine.
I'm probably doing something wrong, but I did almost exactly like the example code - but still the fullscreen doesn't hide the navigation bar on top and the UITabBar on bottom. Is it because the original view controller on the storyboard has "Under Top Bars" and "Under Bottom Bars"? If so, what can be done?
Thanks
(awesome project...)
in startfocusingview:
if(imageView.contentMode == UIViewContentModeScaleAspectFill)
{
CGSize size;
size = [self sizeThatFitsInSize:finalImageFrame.size initialSize:imageView.image.size];
finalImageFrame.size = size;
finalImageFrame.origin.x = (focusViewController.view.bounds.size.width - size.width)/2;
finalImageFrame.origin.y = (focusViewController.view.bounds.size.height - size.height)/2;
}
you also need to check if content mode is scale to fill. worked for me.
I installed ASMediaFocusManager using Cocoapods and whenever I try to open an image, the app crashes (throwing memory exception) at ASMediaFocusBasicToolbarController trying to access it's View.
When I tried dragging and dropping the files instead of Cocoapods, it worked just fine. So I assume there's a problem loading ASMediaFocusBasicToolbar.xib file using Cocoapods.
I followed your readme but I was unable to use your control since the
Anyway thanks for your work !
My app has a method that I need to open a image without user touch on image.
In my opinion it's a good feature to this libary.
Thanks
How to this correctly? I have app with scroll view (reusable views inside). Some of images should be zoomable, some not. How to delete zoom options from view?
I recently had this problem, on Xcode 7.1 and simulators 8.4 and 9.1.
The error disappear once I reset the content of the simulator, but came back after a few runs.
Any help is appreciated.
/Pods/ASMediaFocusManager/ASMediaFocusManager/ASMediaFocusController.xib: error: Internal error. Please file a bug at bugreport.apple.com and attach "/var/folders/36/ljppcdpd3xv3qm4kf37rwsqm0000gn/T/IB-agent-diagnostics_2015-11-05_12-20-49_259000 p.m.".
Recovery Suggestion: Please check Console.app for crash reports for "Interface Builder Cocoa Touch Tool" for further information.
Underlying Errors:
Description: Encountered an error communicating with Interface Builder Cocoa Touch Tool.
Failure Reason: Interface Builder Cocoa Touch Tool (15899) failed to launch
Recovery Suggestion: Please check Console.app for crash reports for "Interface Builder Cocoa Touch Tool" for further information.
Underlying Errors:
Description: Failed to launch Interface Builder Cocoa Touch Tool via CoreSimulator spawn
Underlying Errors:
Description: Failed to handshake with platform tool
Failure Reason: Failed to open connection over FIFOs with platform tool
Underlying Errors:
Description:
Recovery Suggestion: Try restarting your computer
Underlying Errors:
Description: Failed to open FIFOs for handshaking with platform tool
Failure Reason: Timed out waiting for FIFOs to open. Most likely Interface Builder Cocoa Touch Tool crashed before it could open the other end.
my thumbnail images are in cells how do i use with a table view?
Is it possible to load just a UIImage
object rather than having to reference an image from URL?
Hi Philippe,
This code is awesome. I love it!
It's by far the photo best photo player out there.
And it would be really cool to have a gallery with full screen swipe to really make it shine.
Any news when it's out ?
Many thanks
Alex
I want to close the view if X condition are True. Is there a way to close it from the outside?
Thanks
ps: I made a function for that. If there is one already that does it please let me know.
Hi
I found an issue.
startFocusingView calls focusViewControllerForView
in the above focusViewControllerForView, the large image is loaded asynchronously as follow:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [self loadImageFromURL:url onImageView:viewController.mainImageView]; viewController.mainImageView.hidden = NO; });
While the image is downloading, the animation starts, at the end of the animation, the following function is called:
[self.focusViewController focusDidEndWithZoomEnabled:self.zoomEnabled];
This function calls installZoomView which calls displayImage which calls configureForImageSize which calls setMaxMinZoomScalesForCurrentBounds
BUT
If the large image (async loading) is still not loaded from the server, zooming is not possible since setMaxMinZoomScalesForCurrentBounds results in maximumZoomScale = minimumZoomScale = 1.0 (calculation done on low resolution image, since the large image is still loading)
I'm ready for any suggestion on how to add tests to the project.
I am using a UICollectionView
to show some thumbnail image from an API endpoint. When tapping on one, I use ASMediaFocusManager
to show the full size image. However, it doesn't seem like there is very good remove image loading support, as it kind of loads, but it is blurry.
It seems like a much better solution would be to show a progress indicator on top of the tapped view. Then when the remove media is loaded, THEN show it in the focus manager.
As is mentioned in the main page:
"If you need to focus or defocus a view programmatically, you can call startFocusingView ()as long as the view is focusable) or endFocusing."
I cannot find the 'endFocusing' method or something similar to close the focusing image.
Do I miss something?
I'm going to cross this off of your to-do list today. I'll open up a pull request later today if I'm successful. Opening an issue to let you know. :)
Hello team,
First of all, thank you for incredible works. I'm trying to apply your lib to my project but I'm getting stuck and cannot make this work. I'm using Swift and Cocoapods.
Enclosed is the project. I would be very appriciate if you can help me take a look at my code and let me know what I was missing.
Thanks & Best Regards
Khanh pham
Test.zip
I'm not sure if there's currently a way to work around this but if you ever trigger a focus gesture on an image while the keyboard is up, the keyboard will remain active and will overlap the focusViewController.
A quick fix I did was simply to add the following:
- (void)handleFocusGesture:(UIGestureRecognizer *)gesture
{
// ...
[parentViewController.view endEditing:YES];
// ...
}
I'm not sure this is the best contribution to the lib though as this might lead to unexpected behaviour on the user's end. Perhaps a BOOL
property to hide the keyboard when focusing might better? Thoughts?
Hello,
I want to replace the JTSImageViewController (https://github.com/jaredsinclair/JTSImageViewController/) that I'm using now, with this library (because of some issues with the pinch gestures).
However I miss the nice background blur effect of that library. Would it be possible to add this as an option? That would be perfect!
Thanks!
First of all, thanks for an awesome project ๐! I did not find a mailing list or support forum so I'm opening an issue.
I'm using a ASMediaFocusManager
on an UIImageView, which has:
imageView.clipsToBounds = YES;
imageView.contentMode = UIViewContentModeScaleAspectFill;
This results in a jumpy animation when focusing in / out of the image. That is because the animation starts with a scaledToFit image. I could probably grab another starting point from the UIImageView
in mediaFocusManager:imageForView
but I can't change the focus out animation.
Is there something I can do to make the animation start / stop from the actual displayed image?
Thank you for your time.
@autresphere could you please release a new cocoa version. (0.5 is very outdated)
Thanks
I've noticed that there is a short delay between the doing a single tap gesture on the full screen to dismiss it, and the actual animation occuring. Is there any way that this animation delay can be removed or reduced?
Here is my ASMediaFocusManager
initialization code:
self.mediaFocusManager = [[ASMediaFocusManager alloc] init];
self.mediaFocusManager.delegate = self;
self.mediaFocusManager.isDefocusingWithTap = TRUE;
self.mediaFocusManager.animationDuration = 0.3;
self.mediaFocusManager.elasticAnimation = NO;
self.mediaFocusManager.backgroundColor = [UIColor blackColor];
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.