Android : Error Initilazing the Youtube player -
i implementing youtube player in app using youtubeandroidplayerapi play videos add app. working fine till 2 days when error started show suddenly. have been trying solve this, have failed. please me out.
oncreate
@override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.youtube_lightbox); final relativelayout relativelayout = (relativelayout) findviewbyid(r.id.relativelayout_youtube_activity); relativelayout.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { onbackpressed(); } }); final youtubeplayerview playerview = (youtubeplayerview) findviewbyid(r.id.youtubeplayerview); if (savedinstancestate != null) { millis = savedinstancestate.getint(key_video_time); } final bundle extras = getintent().getextras(); if (extras != null && extras.containskey(key_video_id)) { mvideoid = extras.getstring(key_video_id); } else { finish(); } playerview.initialize(api_key, this); }
oninitializationsuccess
@override public void oninitializationsuccess(youtubeplayer.provider provider, youtubeplayer youtubeplayer, boolean b) { mplayer = youtubeplayer; youtubeplayer.setfullscreencontrolflags(youtubeplayer.fullscreen_flag_control_orientation); youtubeplayer.addfullscreencontrolflag(youtubeplayer.fullscreen_flag_control_system_ui); youtubeplayer.setonfullscreenlistener(new youtubeplayer.onfullscreenlistener() { @override public void onfullscreen(boolean b) { isfullscreen = b; } }); if (mvideoid != null && !b) { youtubeplayer.loadvideo(mvideoid); } if (b) { youtubeplayer.seektomillis(millis); } }
error
e/youtubeandroidplayerapi: error creating youtubeplayerview com.google.android.youtube.player.internal.w$a: exception thrown invoked constructor in com.google.android.youtube.api.jar.client.remoteembeddedplayer @ com.google.android.youtube.player.internal.w.a(unknown source) @ com.google.android.youtube.player.internal.w.a(unknown source) @ com.google.android.youtube.player.internal.w.a(unknown source) @ com.google.android.youtube.player.internal.ac.a(unknown source) @ com.google.android.youtube.player.youtubeplayerview.a(unknown source) @ com.google.android.youtube.player.youtubeplayerview$1.a(unknown source) @ com.google.android.youtube.player.internal.r.g(unknown source) @ com.google.android.youtube.player.internal.r$c.a(unknown source) @ com.google.android.youtube.player.internal.r$b.a(unknown source) @ com.google.android.youtube.player.internal.r$a.handlemessage(unknown source) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:145) @ android.app.activitythread.main(activitythread.java:5832) @ java.lang.reflect.method.invoke(native method) @ java.lang.reflect.method.invoke(method.java:372) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1399) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:1194) caused by: java.lang.reflect.invocationtargetexception @ java.lang.reflect.constructor.newinstance(native method) @ java.lang.reflect.constructor.newinstance(constructor.java:288) @ com.google.android.youtube.player.internal.w.a(unknown source) @ com.google.android.youtube.player.internal.w.a(unknown source) @ com.google.android.youtube.player.internal.w.a(unknown source) @ com.google.android.youtube.player.internal.ac.a(unknown source) @ com.google.android.youtube.player.youtubeplayerview.a(unknown source) @ com.google.android.youtube.player.youtubeplayerview$1.a(unknown source) @ com.google.android.youtube.player.internal.r.g(unknown source) @ com.google.android.youtube.player.internal.r$c.a(unknown source) @ com.google.android.youtube.player.internal.r$b.a(unknown source) @ com.google.android.youtube.player.internal.r$a.handlemessage(unknown source) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:145) @ android.app.activitythread.main(activitythread.java:5832) @ java.lang.reflect.method.invoke(native method) @ java.lang.reflect.method.invoke(method.java:372) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1399) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:1194) caused by: java.lang.illegalargumentexception: concrete class implementing iobjectwrapper must have *one* declared private field wrapped object. preferably, instance of objectwrapper<t> class. @ tff.a(sourcefile:76) @ com.google.android.youtube.api.jar.client.remoteembeddedplayer.<init>(sourcefile:147) @ java.lang.reflect.constructor.newinstance(native method) @ java.lang.reflect.constructor.newinstance(constructor.java:288) @ com.google.android.youtube.player.internal.w.a(unknown source) @ com.google.android.youtube.player.internal.w.a(unknown source) @ com.google.android.youtube.player.internal.w.a(unknown source) @ com.google.android.youtube.player.internal.ac.a(unknown source) @ com.google.android.youtube.player.youtubeplayerview.a(unknown source) @ com.google.android.youtube.player.youtubeplayerview$1.a(unknown source) @ com.google.android.youtube.player.internal.r.g(unknown source) @ com.google.android.youtube.player.internal.r$c.a(unknown source) @ com.google.android.youtube.player.internal.r$b.a(unknown source) @ com.google.android.youtube.player.internal.r$a.handlemessage(unknown source) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:145) @ android.app.activitythread.main(activitythread.java:5832) @ java.lang.reflect.method.invoke(native method) @ java.lang.reflect.method.invoke(method.java:372) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1399) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:1194)
can point out whats issue. in advance.
did have google youtube app on device?
update youtube app playstore latest, or can install if dont have. run youtube app,
last step, try run own app youtube player again. tell me if works.
Comments
Post a Comment