VideoComponent always in foreground

Hi all,

I’ve been using a VideoComponent object on OS X with a lot of success so far. One problem I have come into is that I can’t seem to put anything over it - adding sibling components to parent after, setting toBack, toBehind or toFront/alwaysOnTop of siblings… nothing works. I have tried overriding the pimpl in juce_mac_Video.h to force the player to the back layer but still nothing.

Any ideas on how to go about solving this? Thanks in advance for the help!

1 Like

Well, yes, that’s expected - embedded OS views like the video player, openGL, web-browser etc, are heavyweight components. The normal lightweight juce components get drawn directly into the background of the parent window, so can’t be drawn over the top of them.

I see - that’s more or less what I expected. Any ideas for a workaround? I doubt wrapping it in a component would help. If there’s no way to progress I suppose using a different video player would be the solution.

1 Like

Well, you could embed another juce window as a child of the parent window, so that it overlays the video view. That’s possible, but starts to get a bit hairy.

Can’t really see what you mean there. It’s nothing to do with the video player, it’s the fundamental windowing architecture. Any embedded window will have this issue.

1 Like

Sorry, was falling asleep when I wrote that. I meant overriding the juce_mac_Video.h file with an NSView of my overlays with a subview. But the prior solution you provided sounds like a better bet for a first attempt. Thank you for the reply Jules.

You can also check out my ffmpeg player. That gives more low-level access like running the audio as PositionableAudioSource and displaying the video frames in software rendering in a normal juce component:

4 Likes

Very cool ffmpeg extension @daniel - thank you for sharing, I’ll let you know how it works out.

1 Like