Per Jansson
02/09/2024, 7:00 AM400px x 300px) SurfaceView any idea why on Android API 27, but not on API 33, I need to add clip modifier to have surface stay inside the size and not fill the whole screen with black (possible a background color)?Per Jansson
02/09/2024, 7:03 AM400px x 300px) but the black part should not be there covering the other composables.Per Jansson
02/09/2024, 7:05 AMclip modifier, than the black part is not there and the rest of the app is showing nicely below.Per Jansson
02/09/2024, 7:07 AMAndroidEmbeddedExternalSurface could help address, to “sandwich” this video playing surface in between other composables?
I have not tried it yet, and was a bit concerned how it would perform to use that to play video since the docs mentions:
This means that graphics composition is handled like any other UI widget, using the GPU. This can lead to increased power and memory bandwidth usage compared to. It is therefore recommended to useAndroidExternalSurfaceoverAndroidExternalSurfacewhenever possible.AndroidEmbeddedExternalSurface
romainguy
02/09/2024, 7:10 AMromainguy
02/09/2024, 7:11 AMPer Jansson
02/09/2024, 7:14 AMSurfaceView with a cleaner API. 🙂
Now I also remember that I actually did test with a TextureView a week back, and it did not need the clip modifier, but I had to abort that track since TextureView does not support playing DRM protected media if I’m not mistaken. So in that case AndroidEmbeddedExternalSurface would not work either.romainguy
02/09/2024, 7:15 AMromainguy
02/09/2024, 7:16 AMPer Jansson
02/09/2024, 7:19 AMPer Jansson
02/09/2024, 7:19 AMclip modifier is needed for older Android APIs if using the SurfaceView? I think it’s an OK tradeoff to have it there since it does the job, but would be nice to know why it’s needed.romainguy
02/09/2024, 7:21 AMPer Jansson
02/09/2024, 7:33 AM