Funny Solution to play YouTubePlayerView on Customized Fragment

Why we need

Conclusion and Utils Sample

Code Tracing

YouTubePlayerView(Context var1, AttributeSet var2, int var3, YouTubePlayerView.b var4) { 
super((Context)ab.a(var1, “context cannot be null”), var2, var3);
this.c = (YouTubePlayerView.b)ab.a(var4, “listener cannot be null”);
public class YouTubeBaseActivity extends Activity {                               
private YouTubeBaseActivity.a a;

protected void onStart() {
if (this.b != null) { this.b.a(); }
protected void onResume() {
if (this.b != null) { this.b.b(); }
YouTubePlayerFragment youTubePlayerFragment = getFragmentManager().findFragmentById(;youTubePlayerFragment.initialize(DeveloperKey.DEVELOPER_KEY, this);
if (this.c != null && this.e != null) {
this.c.a(this.getActivity(), this, this.d, this.e, this.b);
final void a(final Activity var1, Provider var2, String var3, OnInitializedListener var4, Bundle var5) { ... }
public void onSaveInstanceState(Bundle var1) {
Bundle var2 = this.c != null ? this.c.e() : this.b;
final Bundle e() {
return this.e == null ? this.i : this.e.h();



Lead Android & iOS Mobile Engineer at Yahoo (Verizon Media) Taiwan

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store