i'm working with exo player in android jetpack compose. i make an exo player with default controlls and in horizontal tab mode the default dialogs for playback speed and audio selection are open outside of the player if player is not taking full width of screen . whilile it should be lie inside of the player either player take full width of some defined width.
@composable
fun XpPlayer() {
val context = LocalContext.current
fun buildCustomDrmSessionManager(): DrmSessionManager {
val userAgent = "1"
val dataSourceFactory = DefaultHttpDataSource.Factory().setUserAgent(userAgent)
.setDefaultRequestProperties(mapOf("X-AxDRM-Message" to ""))
val drmCallback: MediaDrmCallback = HttpMediaDrmCallback("", dataSourceFactory)
val exoMediaDrmProvider: ExoMediaDrm.Provider = FrameworkMediaDrm.DEFAULT_PROVIDER
return DefaultDrmSessionManager.Builder()
.setUuidAndExoMediaDrmProvider(C.WIDEVINE_UUID, exoMediaDrmProvider).build(drmCallback)
}
fun buildDrmMediaItemWithDrmConfig(): MediaItem {
return MediaItem.fromUri("https://travelxp.s.llnwi.net/watch1/61025c11781ce3c543f5abcd/manifest_v4.mpd")
}
val customDrmSessionManager = buildCustomDrmSessionManager()
val mediaSourceFactory =
DefaultMediaSourceFactory(context).setDrmSessionManagerProvider { customDrmSessionManager }
val loadControl = DefaultLoadControl.Builder().setBufferDurationsMs(
10000, 20000, 2000, 10000
).build()
val exoPlayer = remember {
ExoPlayer.Builder(context, mediaSourceFactory).setLoadControl(loadControl).build().also {
it.playWhenReady = true
}.apply {
setMediaItem(buildDrmMediaItemWithDrmConfig())
prepare()
}
}
DisposableEffect(Unit) {
onDispose {
exoPlayer.release()
}
}
AndroidView(modifier = Modifier
.border(2.dp, Color.Red)
.width(800.dp).aspectRatio(16/9f),
factory = {
PlayerView(context).apply {
useController = true
resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FILL
player = exoPlayer
setShowBuffering(PlayerView.SHOW_BUFFERING_WHEN_PLAYING)
hideController()
layoutParams = FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT)
}
})
this is the code of my player . i'm using everything default. [enter image description here](https://i.stack.imgur.com/Gazmr.png)