This is worked for me
val iFrameHtmlData = """<iframe width="100%" height="100%" src="$iframeUrl" frameborder="0" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>""".trimIndent()
val baseUrl = "https://$packageName"
loadDataWithBaseURL(baseUrl, iFrameHtmlData, "text/html", "utf-8", null)
You may find the documentation:
https://developers.google.com/youtube/terms/required-minimum-functionality#embedded-player-api-client-identity