i use a mask
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: file];
AVURLAsset* url = [AVURLAsset URLAssetWithURL:fileURL options:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:AVURLAssetPreferPreciseDurationAndTimingKey]];
AVPlayerItem* pitem = [AVPlayerItem playerItemWithAsset:url1];
AVPlayer*player = [AVPlayer playerWithPlayerItem:pitem1];
pv = [[PlayerView alloc] initWithFrame:CGRectMake(0,0, 100, 100)];
[pv setPlayer:player];
UIImageView*iv = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mask"]];
pv.layer.mask = iv.layer;
mask is a PNG file with transparency.
source
share