Onboard icon indicating copy to clipboard operation
Onboard copied to clipboard

Can you load gif image in the contentViewController?

Open willthink opened this issue 10 years ago • 10 comments

I saw the second screenshot in the README has an animation, so just wonder how does it implement?

willthink avatar Aug 27 '15 19:08 willthink

Use a .mp4 instead, it's smaller and works way better (it will loop automatically)

On Thu, Aug 27, 2015 at 12:26 PM, Wei [email protected] wrote:

I saw the second screenshot in the README has an animation, so just wonder how does it implement?

— Reply to this email directly or view it on GitHub https://github.com/mamaral/Onboard/issues/78.

chrisballinger avatar Aug 27 '15 19:08 chrisballinger

+1 to what @chrisballinger said.

mamaral avatar Aug 27 '15 19:08 mamaral

So I need to load mp4 as background in the OnboardingViewController ? OnboardingContentViewController is not able to load mp4 yet?

willthink avatar Aug 27 '15 19:08 willthink

@willthink could you find any solution to this?

FabKremer avatar Sep 11 '15 14:09 FabKremer

@willthink I misread your initial question - if you want a gif/video that is currently not supported for the content pages, only the primary onboarding background.

@FabKremer The only solution I can think of currently is to customize the internals of OnboardingContentViewController to support it.

mamaral avatar Sep 11 '15 15:09 mamaral

Hi I saw this issue open and wanted to give a hand, I added video support to OnboardingContentViewController, just need to create the instance with a video url and it will be loaded in the background similar to OnboardingViewController. There is also an example and some test for this.

The only catch is that MPMoviePlayerController doesn't support multiple videos at the same time, so I added a thumbnail to show when the video is stopped but it also has to wait until the video is loaded to be visible

I have a fork with the changes (https://github.com/estebansotoara/Onboard/tree/ContentViewControllerVideoSupport), you can check it out and if you like it I can make a PR

estebansotoara avatar Nov 15 '15 06:11 estebansotoara

Thanks @estebansotoara!

mamaral avatar Nov 15 '15 22:11 mamaral

Another solution is to try using SDWebImage, AFAIK their UIImageView category supports GIFs?

mamaral avatar Nov 15 '15 22:11 mamaral

Yes, SDWebImage supports GIF, I actually had to remove it as a requirement for a project I'm working on, but I think we'll have to add SDWebImage as a dependency.

I just did the PR #95 and let me see what can I do for the actual GIF this week.

estebansotoara avatar Nov 15 '15 23:11 estebansotoara

Hello @mamaral I added GIF support using FLAnimatedImage as SDWebImage would be an unnecessary overkill, check it out https://github.com/estebansotoara/Onboard/tree/ContentViewControllerGifSupport

Also had to change back to [[NSNotificationCenter defaultCenter] removeObserver:] as the [[NSNotificationCenter defaultCenter] removeObserver: keyPath:] version is not very friendly with XCTestExpectation and as long it is on the dealloc it is not actually really harmful.

estebansotoara avatar Nov 25 '15 04:11 estebansotoara