How to add GIF animations or .gif files to CALayer while composing AVPlayerVideo using AVVideoCompositionCoreAnimationTool?

808 views Asked by At

I am able to set UIImage type as contents to CALayer reference by using

[overlayLayer setContents:(id)[posterImage CGImage]]

and then able to add some basic animation to the layer like rotation and opacity.

But my requirement is to add Gif Image View with animation to parentLayer CALayer?

I used https://github.com/Flipboard/FLAnimatedImage to play gif files.

But i am struck while setting this GiF image view as contents of CALayer.

I if try to add sublayer of this Gif Image View like

[parentLayer addSublayer:gifImageView.layer];

i am able to set layer but App crashes at [self.layer setNeedsDisplay]; of FLAnimated View class

The ideas which you share might help me. Thank You

0

There are 0 answers