我为Android集成了youtube api。它运作良好,但是我的问题是如何删除/禁用出现在视频顶部的youtube共享图标。我很需要摆脱它的帮助。上传时,我使youtube视频不公开,并且发生了同样的事情。参见下面的图片
]
我的活动代码如下所示
val frag = supportFragmentManager.findFragmentById(R.id.youtubeplayerfragment) as YouTubePlayerSupportFragment?
frag!!.initialize(UrlHolder.YOUTUBE_DEVELOPER_KEY, this)
override fun onInitializationSuccess(provider: YouTubePlayer.Provider, youTubePlayer: YouTubePlayer, wasRestored: Boolean) {
youTubePlayer.fullscreenControlFlags = YouTubePlayer.FULLSCREEN_FLAG_CONTROL_ORIENTATION
if (!wasRestored) {
youTubePlayer.cueVideo(currentVideoURL)
}else {
youTubePlayer.loadVideo(currentVideoURL)
}
}
override fun onInitializationFailure(provider: YouTubePlayer.Provider, error: YouTubeInitializationResult) {
val REQUEST_CODE = 1
if (error.isUserRecoverableError) {
error.getErrorDialog(this, REQUEST_CODE).show()
} else {
val errorMessage = String.format("Unable to load video... (%1\$s)", error.toString())
Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show()
}
}
XML是一个片段