Well, I finally managed to get a NSView (or even a CALayer) to be displayed over the VLCVideoView after many many hours of tinkering.
The weird thing is that the layer initially appears behind the VLCVideoView, but when you make the window as small as possible and then bring it back to the size you want it to be, suddenly the layer appears on top of the VLCVideoView.
I have no idea why, but hey ho it works
Here's the awakeFromNib of the NSView that contains both the VLCVideoView and the overlay, maybe it's of use to someone else...
Code: Select all
- (void)awakeFromNib {
videoView = [[VLCVideoView alloc] initWithFrame:NSMakeRect(0,0,self.frame.size.width, self.frame.size.height)];
[self addSubview:videoView];
[videoView release];
player = [[VLCMediaPlayer alloc] initWithVideoView:videoView];
[player setMedia:[VLCMedia mediaWithURL:[NSURL URLWithString:@"udp://@224.99.1.1:1234"]]];
[player play];
NSView *extraView = [[NSView alloc] initWithFrame:NSMakeRect(100,200,self.frame.size.width/5, self.frame.size.height/5)];
[self addSubview:extraView];
[extraView setWantsLayer:YES];
[extraView.layer setBackgroundColor:CGColorCreateGenericRGB(1.0, 0.0, 0.0, 0.5)];
}