我的android stuido项目中有一个youtube视频视图。当我打开视频屏幕时,videoview会自动更改全屏模式。我只想在触摸播放按钮时以全屏播放视频。
这是我的代码
public void setYoutube(final String youtube) {
final YouTubePlayerView yotubevideo = (YouTubePlayerView) mView.findViewById(R.id.youtuber);
onInitializedListener = new YouTubePlayer.OnInitializedListener() {
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean b) {
youTubePlayer.cueVideo(youtube);
youTubePlayer.setFullscreen(true);
}
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
}
};
yotubevideo.initialize(KEY,onInitializedListener);