algorithm - youtubeplayersupportfragment in android video play -


i have develop 1 android application.

i have play video using youtubeplayerfragment.

here video playing on fullscreen mode. same video playing on normal mode also.here facing 1 problem.

the problem is,

more number of video available in gallery view.

here if have click 1 video gallery view means video playing well.now have stop video , click next video means next video audio hearing .but last playing video(at stopping place) thumbnail image displaying.but working fullscreen mode correctly.

how can clear cache memory here ??? there specific algorithm this?please give me solution ???

i using following code :

    fragmentmanager fragmentmanager = getchildfragmentmanager();           fragmenttransaction fragmenttransaction = fragmentmanager                   .begintransaction();         youtubeplayersupportfragment fragment = new youtubeplayersupportfragment();         fragmenttransaction.add(r.id.youtube_fragment, fragment);          fragmenttransaction.commit();          fragment.initialize(developerkey.developer_key, new oninitializedlistener() {            @override           public void oninitializationsuccess(provider arg0,                    youtubeplayer arg1, boolean arg2) {                if (!arg2) {                    arg1.loadvideo(_video);                 }            }             @override             public void oninitializationfailure(provider provider,                     youtubeinitializationresult errorreason) {              toast.maketext(getactivity(), "please install youtube app on device ", toast.length_long).show();                }          }); 

i using following xml:

 <fragment   android:name="com.google.android.youtube.player.youtubeplayersupportfragment"   android:id="@+id/youtube_fragment"   android:layout_width="match_parent"   android:layout_below="@+id/title"   android:layout_height="wrap_content"/> 

please check question , give me suggestions ...


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -