
我通过YouTube播放器向linearLayout充气:
fragmentManager = getActivity().getSupportFragmentManager(); fragmentTransaction = fragmentManager.beginTransaction(); player = new YouTubePlayerSupportFragment(); fragmentTransaction.add(R.ID.youTubePlayerContainer,player); fragmentTransaction.commit();
…哪里youTubePlayerContainer是膨胀的linearLayout
玩家被正确检测,开始播放,并在第二站.
日志显示以下内容:
YouTube vIDeo playback stopped due to unauthorized overlay on top of player. The YouTubePlayerVIEw is obscured by androID.Widget.FrameLayout@4110d1f8. YouTubePlayerVIEw is completely covered,with the distance in px between each edge of the obscuring vIEw and the YouTubePlayerVIEw being: left: 484,top: 100,right: 100,bottom: 170..
这是我的XML:
(其中没有FrameLayout)
<linearLayout androID:ID="@+ID/curtain" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:orIEntation="vertical" > <linearLayout androID:ID="@+ID/withAPI" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:orIEntation="vertical" > <linearLayout androID:ID="@+ID/youTubePlayerContainer" androID:layout_wIDth="match_parent" androID:layout_height="0dp" androID:layout_gravity="center" androID:layout_margin="30dp" androID:layout_weight="1" androID:orIEntation="vertical" > </linearLayout> <linearLayout androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:layout_margin="3dp" androID:background="@color/trans_popUp" androID:padding="3dp" > <TextVIEw androID:ID="@+ID/textYouTubeVisor" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:text="Title..." androID:textcolor="@color/white" /> </linearLayout> </linearLayout>
我试着改变利润,没有成功.
我正在阅读官方文件,但没有成功
表示导致问题的FrameLayout是:androID.Widget.FrameLayout @ 4110d1f8
但是有了这样一个参考,并不能确定哪一个是指的
对他这样做的人呢?
我感谢任何帮助.
问候
解决方法 你能解决这个问题吗?我今天遇到同样的问题,对我而言,日志中的错误是:
W/YouTubeAndroidplayerAPI﹕ YouTube vIDeo playback stopped due to unauthorized overlay on top of player. The YouTubePlayerVIEw is not contained insIDe its ancestor com.Google.androID.youtube.player.YouTubePlayerVIEw{42686bc8 V.E..... ........ 0,0-1200,675 #7f0a00a0 app:ID/vIDeo_player}. The distances between the ancestor's edges and that of the YouTubePlayerVIEw is: left: -10,top: -10,right: -10,bottom: -10 (these should all be positive). 我通过删除布局中的YouTubePlayerVIEw中的填充来修复此问题.所以我的布局看起来像这样:
<com.Google.androID.youtube.player.YouTubePlayerVIEw androID:ID="@+ID/vIDeo_player" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:background="#000" />总结
以上是内存溢出为你收集整理的Android YouTubePlayer,未经授权的重叠式播放器全部内容,希望文章能够帮你解决Android YouTubePlayer,未经授权的重叠式播放器所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)