Hi! I’m seeing an issue with Compose Multiplatform...
# compose-ios
d
Hi! I’m seeing an issue with Compose Multiplatform on iOS where applying
Modifier.blur()
to a Compose container does not blur the video rendered by an embedded
AVPlayerViewController
. For example, I have:
Copy code
Column(
    modifier = Modifier
        .fillMaxSize()
        .blur(20.dp)
) {
    // Compose content
    UIKitViewController(
        factory = { AVPlayerViewController() }
    )
}
The Compose content is blurred correctly, but the
AVPlayer
video is not included in the blur; depending on the setup, the video can remain sharp or the blurred area can become black/white. Is this expected because `AVPlayerViewController`/`AVPlayerLayer` is rendered through a native/hardware-backed surface that Compose's blur can't capture? If so, is there a supported way for a Compose blur/effect to include the pixels rendered by
AVPlayerViewController
, or is the recommended approach to implement the blur natively on the UIKit side / capture the current video frame and blur that instead? I’m using
UIKitViewController
from Compose Multiplatform and
AVPlayerViewController
with
showsPlaybackControls = false
.
One possible workaround I’m considering is handling this at the native video-surface level rather than trying to blur the
UIKitViewController
itself. When blur is requested: 1. Capture the current frame from
AVPlayer
. 2. Temporarily cover/hide the
AVPlayerViewController
. 3. Render the captured frame as an image and apply the Compose blur to that image. 4. When blur is removed, remove the frame overlay and show the player again. This would keep the workaround inside
NativeVideoSurface
and avoid changing the shared player/UI layer. Does this sound like a reasonable approach, or is there a better way to make a Compose blur/effect include the native
AVPlayerViewController
content?
m
Same if using
UIKitView
with a wrapped
AVPlayerLayer
?
I haven't tried to blur a
UIKitViewController
, but I suppose you could test with some more basic content
I think you may be right about the player rendering through hardware-backed surface, so is outside of the Compose/Skia render pipeline