私は私のアプリでAndroidのためにYouTubeのAPIを使用していますし、私のような私の活動のダイナミックな新しいYouTubePlayerViewを作成:コードとして アンドロイドYouTubePlayerView不正オーバーレイと小さすぎるエラー
YouTubePlayerView youTubePlayerView = new YouTubePlayerView(PlayerActivity.this);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(640, 360);
layoutParams.setMargins(100, 200, 0, 0);
youTubePlayerView.setLayoutParams(layoutParams);
root.addView(youTubePlayerView);
、「根」 RelativeLayoutです。youTubePlayerViewのサイズと余白はyouTubePlayerViewごとに異なります。
このコードは時々動作しますが、時々ではない、それは下のエラーを返します:
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{37ab2582 V.E..... ......ID 0,0-0,0}. The distances between the ancestor's edges and that of the YouTubePlayerView is: left: 0, top: 0, right: 0, bottom: 0 (these should all be positive).
またはこの1
W/YouTubeAndroidPlayerAPI: YouTube video playback stopped due to the player's view being too small. The YouTubePlayerView is 0dp wide (minimum is 200dp) and 0dp high (minimum is 110dp).
起こる、またはそれが成功したビデオを再生してみましょう、それを避けるためにどのような方法があります。
私は何か助けていただきありがとうございます。
よろしくOfficial Google Documentationに基づいて
引き続き問題が発生していますか? –
解決策は見つかりましたか? –