toro icon indicating copy to clipboard operation
toro copied to clipboard

Stop Player after change tab - viewpager

Open lucazin opened this issue 5 years ago • 2 comments

Hello! Someone can help me?

How can i stop de video when a change my tab on viewpager?

i used this..but not work

@Override public void setUserVisibleHint(boolean isVisibleToUser) {

	ListaFeed_Estabelecimento.this.setUserVisibleHint(isVisibleToUser);
	super.setUserVisibleHint(isVisibleToUser);
}

i have fragment and load video list in recycleview.. how cani stop all when i change tab?

i use the last version of toro and my android is 9.0

thanks!

lucazin avatar Oct 30 '19 17:10 lucazin

you can use EventBus for that. First on the adapter item where you have toroplayer you need to write the metod to get messages event from eventbus and instantiate too, inside that method you need to call pause() and other logic that you need to work.

Diegofr104 avatar Nov 02 '19 16:11 Diegofr104

i override the toro container and use visibility method to hide recycleview

Em sáb., 2 de nov. de 2019 às 13:13, Diegofr104 [email protected] escreveu:

you can use EventBus https://github.com/greenrobot/EventBus for that. First on the adapter item where you have toroplayer you need to write the metod to get messages event from eventbus and instantiate too, inside that method you need to call pause() and other logic that you need to work.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/eneim/toro/issues/462?email_source=notifications&email_token=AGXVDFXYDCANWJ6WSNBBF3DQRWRLRA5CNFSM4JG5YEL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC47KHA#issuecomment-549057820, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGXVDFXDRS36FC5EQIWYFYLQRWRLRANCNFSM4JG5YELQ .

lucazin avatar Nov 02 '19 16:11 lucazin