Android webview twitch не может работать в полноэкранном режиме - PullRequest
0 голосов
/ 31 марта 2020

Привет, я пытаюсь внедрить twtich видео на android, используя веб-просмотр, он работает, но я не могу в полноэкранном режиме, я пробую его на p c, он тоже работает, и на весь экран работает enter image description here

html файл

<script src= "https://player.twitch.tv/js/embed/v1.js"></script>
<div id="<player div ID>"></div>
<script type="text/javascript">
    var options = {
    width: '100%',
    height: '100%',
    video: "556749875",
    // only needed if your site is also embedded on embed.example.com and othersite.example.com
    parent: ["embed.example.com", "othersite.example.com"]
    };
    var player = new Twitch.Player("<player div ID>", options);
            player.setVolume(0.5);
 </script>

файл макета

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<WebView
    android:id="@+id/webview1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

код

val url = "file:///android_asset/htt.html"
    val mWebView: WebView = findViewById<View>(R.id.webview1) as WebView

    mWebView.settings.javaScriptEnabled=true
    mWebView.settings.useWideViewPort=true
    mWebView.settings.loadWithOverviewMode=true

    mWebView.webChromeClient=WebChromeClient()
    mWebView.loadUrl(url)

спасибо

...