0

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?

satyanarayana
  • 265
  • 4
  • 14

1 Answers1

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