eneim / toro

Video list auto playback made simple, specially built for RecyclerView
Apache License 2.0
1.41k stars 253 forks source link

Stop Player after change tab - viewpager #462

Open lucazin opened 4 years ago

lucazin commented 4 years ago

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!

Diegofr104 commented 4 years ago

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.

lucazin commented 4 years ago

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

Em sáb., 2 de nov. de 2019 às 13:13, Diegofr104 notifications@github.com 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 .