How to make the video open in full screen? In webview, when you press a button in YouTube to full screen, the video does not open in full screen, pressing is ignored:
val initialUrl = currentUrl?.value
val lastUrl by rememberSaveable { mutableStateOf<String?>(null) }
val url = lastUrl ?: initialUrl
val state = url?.let { rememberWebViewState(url = it) }
if (state != null) {
val webViewState = rememberSaveableWebViewState()
val navigator = rememberWebViewNavigator()
LaunchedEffect(navigator) {
val bundle = webViewState.viewState
if (bundle == null) {
currentUrl?.value?.let { navigator.loadUrl(it) }
}
}
WebView(
state = webViewState,
navigator = navigator,
modifier = Modifier.fillMaxSize(),
onCreated = {
it.settings.javaScriptEnabled = true
it.settings.allowFileAccess = true
it.settings.allowContentAccess = true
it.webChromeClient = WebChromeClient()
it.settings.setSupportZoom(true)
it.settings.builtInZoomControls = true
it.settings.domStorageEnabled = true
it.settings.userAgentString = System.getProperty("http.agent")
}
)
}`
I tried to add different settings to the webview, but they do not work, I also added android:configChanges="orientation|screenSize" to the manifest