1

in android studio(kotlin), i want to have, two exoplayers in one activity.
and i know this depends on hardware's limitations.
(some devices can only display one video at each activity , in the moment)
but there is some way to handle this request.

for example, we have two exoplayer1 and exoplayer2.
we have both of them in our activity but at any moment, one of them can be active.

for achieve this, when exoplayer1 wants to work, the exoplayer2 must be destroy.And vice versa .

i destroy exoplayer1 an exoplayer2 by this code

exoplayer1.removeAllViews()
exoplayer2.removeAllViews() 

but, when i want to active again this exoplayers, i can't do it.

there is any way to re-active exoplayer after removeallViews?

1
  • ExoPlayer supports multiple instances, why do you need to destroy them, rather than just stopping the other one. That might even be automatic if you use mediasession. Dec 13, 2021 at 6:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.