微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

webview中youtubeplayer中的全屏缩放横向模式下的全屏问题

如何解决webview中youtubeplayer中的全屏缩放横向模式下的全屏问题

<!-- begin snippet: js hide: false console: true babel: false -->

 my content.xml
    ........................
    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout 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"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        tools:context=".MainActivity"
        tools:showIn="@layout/app_bar_main">

        <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
            android:id="@+id/swipe"
            android:layout_above="@id/adView"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <WebView
                android:id="@+id/myWebView"
                android:layout_width="match_parent"
                android:layout_alignParentTop="true"
                android:layout_height="fill_parent"/>
        </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>


        <RelativeLayout
            android:layout_width="match_parent"
            android:visibility="gone"
            android:layout_height="match_parent"
            android:background="#ffffff"
            android:gravity="center"
            android:id="@+id/relativeLayout">

            <ImageView
                android:layout_width="240dp"
                android:layout_height="240dp"
                android:src="@drawable/no_internet"
                android:layout_centerHorizontal="true"
                android:id="@+id/noConnectionlogo"
                android:contentDescription="@string/image_content" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="No Internet Connection"
                android:layout_below="@+id/noConnectionlogo"
                android:gravity="center"
                android:textAlignment="center"
                android:textSize="26sp"
                android:id="@+id/txtNoConnection"/>

            <Button
                android:id="@+id/btnNoConnection"
                android:layout_width="140dp"
                android:layout_height="55dp"
                android:layout_below="@id/txtNoConnection"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="60dp"
                android:background="@color/colorAccent"
                android:text="Retry"
                android:foreground="?android:attr/selectableItemBackground"
                android:clickable="true"
                android:longClickable="true"
                android:textColor="#ffffff"
                android:textSize="22sp"
                android:focusable="true" />

        </RelativeLayout>

        <com.google.android.gms.ads.AdView
            xmlns:ads="http://schemas.android.com/apk/res-auto"
            android:id="@+id/adView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_alignParentBottom="true"
            android:visibility="invisible"
            ads:adSize="BANNER"
            ads:adUnitId="@string/admob_banner_id">
        </com.google.android.gms.ads.AdView>

        <ProgressBar
            android:id="@+id/progressbar"
            android:theme="@style/ProgressBarStyle_webview"
            android:background="@drawable/round_bg"
            android:layout_centerInParent="true"
            android:padding="5dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="-7dp"
            android:indeterminate="true"
            android:visibility="gone"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />

    </RelativeLayout>


<!-- end snippet -->

`

</manifest>

需要解决这个问题。在横向模式下,完全无法全屏播放视频。某些部分留下了黑屏。 请给出这个问题的解决方案。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。