How to remove bottom overlay ads from custom Youtube player Android

南楼画角 提交于 2019-12-11 07:09:33

问题


I am developing a video application on Android that plays videos from YouTube. For this purpose, I am using YouTube Android API. I have made my player to CHROMELESS as follows:

public void onInitializationSuccess(Provider provider, YouTubePlayer player,
            boolean wasRestored) {
         player.setPlayerStyle(PlayerStyle.CHROMELESS);
         player.loadVideo(VIDEO);
            }

Everything is working fine but while video playing bottom overlay ads are coming at the bottom. How can I hide or remove that bottom overlay ads? If it is not possible then how can I block touch event on that portion of ads only.

I don't want my users to leave my application.


回答1:


set Change

  player.setPlayerStyle(PlayerStyle.CHROMELESS);
         player.loadVideo(VIDEO);

To:---

 player.loadVideo(VIDEO);
player.setPlayerStyle(PlayerStyle.CHROMELESS);

NOTE:- Load the video first then set your player style may be helpful to you



来源:https://stackoverflow.com/questions/29059462/how-to-remove-bottom-overlay-ads-from-custom-youtube-player-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!