Skip to content Skip to sidebar Skip to footer

Android Youtube Api View Pager Issue

I am using a viewpager to load youtube videos which using FragmentPagerAdapter to feed Youtube fragment to the viewpager. The problem i am having is that the first youtube video lo

Solution 1:

//I think releasing the fragment in on Pause is the thing you are missing

@Override public void onPause() {

    super.onPause();
    if (youTubePlayerFragment != null) {
        getChildFragmentManager().beginTransaction()
                .remove(getChildFragmentManager().findFragmentById(R.id.yourcontainerid))
                .commit();

    }
    Player.release();
}

Post a Comment for "Android Youtube Api View Pager Issue"