I need to play one video in three different layers using the same AVPlayerLayer object. Is it possible to clone a AVPlayerLayer so that I can use cloned layers where I need?
Asked
Active
Viewed 202 times
0
-
Did you ever succeed at this? I'm finding myself in the same spot. – fbartho Aug 08 '14 at 08:27
1 Answers
1
I've tried with
NSMutableArray *videoLayersArray = [NSMutableArray alloc] init];
[videoLayersArray addObject:layer1];
[videoLayersArray addObject:layer2];
[videoLayersArray addObject:layer3];
// add these three layers on parentLayer
videoComposition.animationTool = [AVVideoCompositionCoreAnimationTool videoCompositionCoreAnimationToolWithPostProcessingAsVideoLayers:videoLayersArray inLayer:parentLayer];
This will render your video which in composition in layer1. layer2 and layer3. It worked for me.

satyanarayana
- 265
- 4
- 14