Android YouTube视频播放在嵌套的viewpager中时引发未经授权的覆盖错误

Android YouTube视频播放在嵌套的viewpager中时引发未经授权的覆盖错误,android,android-layout,android-viewpager,youtube-api,android-youtube-api,Android,Android Layout,Android Viewpager,Youtube Api,Android Youtube Api,我正在尝试将youtube播放器添加为双视图寻呼机中的弹出窗口,但该播放器停止提供以下错误: YouTube video playback stopped due to unauthorized overlay on top of player. The YouTubePlayerView is not contained inside its ancestor android.support.v4.view.ViewPager{344132a VFED..... ........ 0,144-

我正在尝试将youtube播放器添加为双视图寻呼机中的弹出窗口,但该播放器停止提供以下错误:

YouTube video playback stopped due to unauthorized overlay on top of player. The YouTubePlayerView is not contained inside its ancestor android.support.v4.view.ViewPager{344132a VFED..... ........ 0,144-1080,1560 #7f0e00a1 app:id/pager_video}. The distances between the ancestor's edges and that of the YouTubePlayerView is: left: 1080, top: 809, right: -1080, bottom: 0 (these should all be positive).

我有三个xml文件:

<android.support.design.widget.CoordinatorLayout 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:id="@+id/main_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context="com.example.MainActivity">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.design.widget.TabLayout
        android:id="@+id/sliding_tabs"
        style="@style/customTabLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/colorPrimary"
        android:elevation="@dimen/tiny_dimen" />

</android.support.design.widget.AppBarLayout>

<android.support.v4.view.ViewPager
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior" />

B.xml


C.xml


当我把C放在A里面,它工作得很好,但当我把C放在B里面,B在A里面,它会给出错误

注意:youtube com.example.fragments.VideoFragment是YouTubePlayerSupportFragment

基于此,滚动YouTubePlayerView所在的页面时出错。当YouTubePlayerView不可见时,视频会因此错误而停止


除此之外,任何YouTube播放器(包括YouTube Android播放器)都不受支持。当检测到覆盖时,播放停止,日志中包含有助于调试问题的信息。

我在布局中找不到任何覆盖/填充/边距。
<android.support.design.widget.CoordinatorLayout 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:id="@+id/main_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context="com.example.MainActivity">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.design.widget.TabLayout
        android:id="@+id/sliding_tabs"
        style="@style/customTabLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/colorPrimary"
        android:elevation="@dimen/tiny_dimen" />

</android.support.design.widget.AppBarLayout>

<android.support.v4.view.ViewPager
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <android.support.design.widget.TabLayout
            android:id="@+id/sliding_tabs_video"
            style="@style/customTabLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/colorPrimary"
            android:elevation="@dimen/tiny_dimen" />
    </android.support.design.widget.AppBarLayout>

    <android.support.v4.view.ViewPager
        android:id="@+id/pager_video"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

</LinearLayout>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<android.support.v4.widget.SwipeRefreshLayout
    android:id="@+id/swipeToRefreshLayoutVideo"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <SearchView
            android:id="@+id/videoSearch"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="gone"/>

        <android.support.v7.widget.RecyclerView
            android:id="@+id/recycler_view_video_list"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:clipToPadding="false"
            android:scrollbars="vertical" />
    </LinearLayout>
</android.support.v4.widget.SwipeRefreshLayout>

<LinearLayout
    android:id="@+id/video_box"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom"
    android:orientation="vertical"
    android:visibility="visible">

    <ImageButton
        android:id="@+id/close_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:onClick="onClickClose"
        android:src="@android:drawable/btn_dialog" />

    <fragment
        android:id="@+id/video_fragment_container"
        android:name="com.example.fragments.VideoFragment"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
    </LinearLayout>
</FrameLayout>