当前位置: 首页 > 知识库问答 >
问题:

YouTubeAndroidPlayerAPI在Android中出现问题?

罗安和
2023-03-14

我遇到了这样的问题

w/YouTubeAndroidPlayerAPI:强制创建的覆盖:acqm@6b45523帮助器:lazy@8cb1a20视图:空状态:.......{...}

> W/YouTubeAndroidPlayerAPI: YouTube video playback stopped due to unauthorized overlay on top of player. The YouTubePlayerView is not contained inside its ancestor android.support.v7.widget.RecyclerView{d1a0545 VFED.V... .F...... 0,0-1080,1554 #7f0e007b app:id/details_recyclerview}. The distances between the ancestor's edges and that of the YouTubePlayerView is: left: 0, top: -48, right: 0, bottom: 1002 (these should all be positive).

在Recycleview中实现

 <?xml version="1.0" encoding="utf-8"?>
  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical">

<include layout="@layout/header_navigation" />

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/header"
    android:orientation="vertical">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/details_recyclerview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/white_color"
        android:scrollbars="vertical">

    </android.support.v7.widget.RecyclerView>

    </LinearLayout>
 </RelativeLayout>
      <?xml version="1.0" encoding="utf-8"?>
       <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
       android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical">

<com.google.android.youtube.player.YouTubePlayerView
    android:id="@+id/youtube_video_player"
    android:layout_width="match_parent"
    android:layout_height="200dp"
    android:background="@color/article_details_background"
    android:visibility="visible"></com.google.android.youtube.player.YouTubePlayerView>

<ScrollView
    android:id="@+id/scrollview_layout"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/youtube_video_player"
    android:visibility="gone">

    <RelativeLayout
        android:id="@+id/relativelayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <FrameLayout
            android:id="@+id/artical_image_layout"
            android:layout_width="match_parent"
            android:layout_height="200dp">


            <ImageView
                android:id="@+id/article_details_background_image"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/article_details_background"
                android:scaleType="fitCenter" />

            <include
                layout="@layout/article_view_details"
                android:visibility="gone" />

        </FrameLayout>             
    </RelativeLayout>
</ScrollView>
 </LinearLayout>

共有1个答案

长孙兴德
2023-03-14

当你在错误信息中看到你不允许覆盖任何视图到YouTubePlayer时,你试过暂停播放器吗?

如果你感兴趣,我已经建立了一个库,以避免这类问题,Android-YouTube-Player。这将给你更多的自由你可以做什么与球员。

 类似资料:
  • > //这是我的java代码,firebase部分仅在以下条件下工作正常(requestCode==102){br>//imageuri=data.getData(); imageuri;public static final int PICK\u IMAGE=1@重写受保护的void onCreate(Bundle savedInstanceState){super.onCreate(saved

  • 问题内容: SQL … 如您所见,它占用了文章的所有页面(每个页面均以长文本形式存储在单独的行中),并通过GROUP_CONCAT将它们分成单个长文本行。问题在于结果只有太多的字符,然后它被完全截断,丢失了大约90%的内容。CONCAT是否不能很好地处理长文本,还是我做错了其他事情? 问题答案: 根据MySQL手册,最大长度由系统变量定义,默认为1024。 可以使用以下命令来增加此值: 但是,应注

  • 正如标题所提到的,我在使用Google地图的toScreen位置()时遇到了问题。 我试图在谷歌地图上选取任意点,并将其广播到我的谷歌地图片段。在片段中,我想得到这个LatLng坐标对应的屏幕点。但是,大多数情况下,我会遇到如下错误: 与转换对应的代码是: 我已经验证了我正在获取浮点值,并且它们是我硬编码的。但大多数情况下,当它到达Point map=projection.toScreenloce

  • 失败:生成失败,出现异常。 生成在8s中失败cmd:命令失败,退出代码为%1错误输出:failure:生成失败,但出现异常。

  • ionic cordova build android命令有问题。当我尝试启动该命令时,出现以下错误>cordova build android Checking Java JDK and android SDK versions android_sdk_root=undefined(推荐设置)android_home=/usr/lib/android-sdk(DEPRECATED)JDK 8('

  • 问题内容: 我已经安装并设置了Eclipse和插件ADT,以便与Android SDK一起使用。到目前为止,一切都很好。但是,当我尝试为我选择的任何android平台(例如android 3.2)启动VM(虚拟机)时,我只是将皮肤与键盘控制台和电话按钮一起启动,它似乎可以启动并进入然后什么也没做,只在vm主屏幕上显示android徽标,这就是它的全部操作- 没有了,没有VM功能!,这是怎么回事?我