Overlay transparent canvas on top of movie player object

I’ve created a window to preview the setup of a watermark on top of a movie player (AVPlayerViewControlMBS). I do this by displaying the watermark in a canvas that is placed over the movie player object in the window. This has worked fine for myself but some clients are reporting that the watermark preview doesn’t show. Sending a test build to some clients with a checkbox to hide the movie player, these users report that the canvas can be seen once the movie player is hidden. I’m assuming then that the app for some users is not displaying the controls in the front/back order that they have been setup in the IDE.

Am I not supposed to place a canvas in front of other objects? If this is okay, any ideas on how I can get the app to make sure the canvas is always displayed in front? This window is only used on macOS 10.10+

Xojo 2019r1.1 + MBS 20.2

Thanks,

Mark

It would be helpful to know if there’s a pattern to which users are having trouble in terms of OS. Like before 10.13, or after 10.12.3, or only in 10.14.2 or something like that. It’s certainly possible that there’s a bug here, but if it works for some users and not others, I’d tend to think that it’s an OS or hardware issue.

For instance, it could be the type of video chipset in use. The power-efficient integrated graphics chipset may not have the ability to do this, whereas the more advanced Radeon chipset probably does.

[quote=492335:@Mark Franken]I’ve created a window to preview the setup of a watermark on top of a movie player (AVPlayerViewControlMBS). I do this by displaying the watermark in a canvas that is placed over the movie player object in the window. This has worked fine for myself but some clients are reporting that the watermark preview doesn’t show. Sending a test build to some clients with a checkbox to hide the movie player, these users report that the canvas can be seen once the movie player is hidden. I’m assuming then that the app for some users is not displaying the controls in the front/back order that they have been setup in the IDE.

Am I not supposed to place a canvas in front of other objects? If this is okay, any ideas on how I can get the app to make sure the canvas is always displayed in front? This window is only used on macOS 10.10+

Xojo 2019r1.1 + MBS 20.2

Thanks,

Mark[/quote]
Hi Mark.

Since you have the MBS plugins you might be able to replace your overlay Canvas with OverlayMBS.
NOTE. This would mean that you would have to keep the position & size of the OverlayMBS in sync with your window as they are completely detached.

@Greg O’Lone - thanks I only have two users with this issue but I’ll get their macOS version and hardware details

@Kevin Gale - Nice idea. I’ve used OverlayMBS for other apps. Should be a simple workaround. Thanks

@Greg O’Lone - This looks to be a macOS issue. The canvas overlays correctly on 10.14.6, 10.15.0 and 10.15.3 while the canvas is hidden on macOS 10.12.6, 10.13.3 and 10.13.6. Tested on various hardware. I’ll use OverlayMBS as a workaround. Thanks.

Generally, it’s not advisable to overlay views on top of hardware accelerated views, such as the OS provided movie player, OpenGL or Metal. These views can gain maximum performance by not being composited with other views or windows.

If you do want to overlay content on top of these views, it’s best to use Layer-Backed Views (the Xojo movie player does this). On older hardware it will struggle a little, but it helps with compositing multiple views/layers atop each other.

macOS 10.13 has a borked graphics stack, I have a handful of customers with 10.13 who have strange graphical glitches which I cannot reproduce locally :frowning: Most of the time these are solved by upgrading to Mojave, or in some cases I had a customer downgrade to El Cap. I’ll NEVER recommend a customer upgrade to Catalina.