android - YouTube Player View pausing video after each second -
i understand there other similar questions asked. either have no solutions or solutions provided not working.
the player works fine in fullscreen mode part of layout contents, keeps pausing , rebuffering.
here code:
public class playeractivity extends youtubebaseactivity implements mediaplayer.onpreparedlistener, youtubeplayer.oninitializedlistener { ... youtubeplayerview = (youtubeplayerview) findviewbyid(r.id.player_youtube); button yt_player_button = (button) findviewbyid(r.id.player_yt_play); yt_player_button.settext("click play youtube video"); yt_player_button.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { youtubeplayerview.initialize(getstring(r.string.youtube_api_key), playeractivity.this); } }); } ... @override public void oninitializationsuccess(youtubeplayer.provider provider, youtubeplayer youtubeplayer, boolean b) { if (youtubeplayer == null) return; if (!b) youtubeplayer.cuevideo("63kmmchbqla"); } @override public void oninitializationfailure(youtubeplayer.provider provider, youtubeinitializationresult youtubeinitializationresult) { }
youtubeplayerview cannot nested inside scrollview whatever reason.
it doesn't work. suggest create fragment pops during request youtube video or creating new intent youtubeplayerview (maybe fullscreen). couldn't find reason why case. (please add answer if know why) using exo-player alternative (if can dash url's in dynamic app. best of luck)
Comments
Post a Comment