Package 

Class ComposeVisibility


  • 
    public final class ComposeVisibility
    extends VideoSinkVisibility
                        

    A VideoSinkVisibility for compose views.

    To use, pass an onGloballyPositioned modifier your composable like so:

    modifier = Modifier.onGloballyPositioned { videoSinkVisibility.onGloballyPositioned(it) }

    onDispose must be called when the associated composable is no longer used (i.e. with a DisposableEffect).

    DisposableEffect(room) {
        onDispose {
            videoSinkVisibility.onDispose()
        }
    }
    • Method Summary

      Modifier and Type Method Description
      Boolean isVisible()
      Track.Dimensions size()
      final Unit onGloballyPositioned(LayoutCoordinates layoutCoordinates) To be called from a compose view, using Modifier.onGloballyPositioned.
      final Unit onDispose() Cleans up any resources held by this object.
      • Methods inherited from class io.livekit.android.room.track.video.VideoSinkVisibility

        addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
      • Methods inherited from class io.livekit.android.compose.ui.ComposeVisibility

        close, notifyChanged
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ComposeVisibility

        ComposeVisibility()
    • Method Detail

      • size

         Track.Dimensions size()
      • onGloballyPositioned

         final Unit onGloballyPositioned(LayoutCoordinates layoutCoordinates)

        To be called from a compose view, using Modifier.onGloballyPositioned.

        Example:

        modifier = Modifier.onGloballyPositioned { videoSinkVisibility.onGloballyPositioned(it) }
      • onDispose

         final Unit onDispose()

        Cleans up any resources held by this object.

        Must be called upon leaving the composition (i.e. with a DisposableEffect).