is there a recommended way to use `*AndroidExterna...
# compose
o
is there a recommended way to use
*AndroidExternalSurface*
for media playback? if so, how should it be set up? what should be the z order for it?
r
You don't need to change the Z order unless you have a good reason to do so
If you've used SurfaceView before, it's basically the same thing (it uses a SurfaceView underneath)
o
yep, • z-ordering: the default z-ordering is behind, so was wondering if that needs to be updated • isOpaque: do we need to tweak this value? or just let it be true?OnAttachStateChangeListener in this case?
• also we need access to
View.OnAttachStateChangeListener
from the SurfaceView, is this a similar api recommended to use for compose?
r
Keep z-ordering and isOpaque to their defaults unless you know you need them
Why do you need the attach state?
AndroidExternalSurface
will invoke various callbacks already to help you. And if you need more you can always use Compose’s
DisposableEffect
o
Attach tells the player the SurfaceView to render video into. Detach tells player to release the SurfaceView so that it won't be leaked
r
You can do this when you get the
onSurface
and
onSurfaceDestroyed
events in
AndroidExternalSurface
o
cool, thanks 🙂
111 Views