diff --git a/new-player/src/main/java/net/newpipe/newplayer/NewPlayerView.kt b/new-player/src/main/java/net/newpipe/newplayer/NewPlayerView.kt index 1bf00380..f4085071 100644 --- a/new-player/src/main/java/net/newpipe/newplayer/NewPlayerView.kt +++ b/new-player/src/main/java/net/newpipe/newplayer/NewPlayerView.kt @@ -33,6 +33,10 @@ import net.newpipe.newplayer.ui.NewPlayerUI import net.newpipe.newplayer.ui.theme.VideoPlayerTheme import net.newpipe.newplayer.data.NewPlayerException + +/** + * A wrapper for [NewPlayerUI] to allow NewPlayer to be used in a [views](https://developer.android.com/develop/ui/views/layout/declaring-layout) environment. + */ @AndroidEntryPoint class NewPlayerView : FrameLayout { diff --git a/new-player/src/main/java/net/newpipe/newplayer/ui/NewPlayerUI.kt b/new-player/src/main/java/net/newpipe/newplayer/ui/NewPlayerUI.kt index 617d4114..e217bcca 100644 --- a/new-player/src/main/java/net/newpipe/newplayer/ui/NewPlayerUI.kt +++ b/new-player/src/main/java/net/newpipe/newplayer/ui/NewPlayerUI.kt @@ -54,6 +54,17 @@ import net.newpipe.newplayer.ui.common.setScreenBrightness private const val TAG = "VideoPlayerUI" + +/** + * The NewPlayerUI composable. Use this in your compose setup to display the NewPlayerUI. + * + * Keep in mind that NewPlayer will deeply integrate into your UI and your Activity. + * You must take care about complying to requests of NewPlayer like when NewPlayer wants to + * display the NewPlayerUI in fullscreen mode. It's your duty to ensure that all other composable + * or views are hidden and only NewPlayerUI is visible. You can read more about this in + * the [NewPlayerViewModel], since the [viewModel] is responsible to tell your UI how to behave + * in such cases. + */ @OptIn(UnstableApi::class) @Composable fun NewPlayerUI(