I am trying to create a TikTok like app, for that I am using viewPager2, FragmentStateAdapter and ExoPlayer(2.16.1),
I am injecting new instance of exoPlayer in every new VideoFragment and initializing/prepare exoplayer in onViewCreated method and starts it on onResume and releasing it on onDestroy
The issue is in some devices app can not prepare more than 1 exoplayer instance otherwise it's throwing following error, I understand the issue and why its happening but,I need some solution achieve my requirement which preloading next video like TikTok
com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(2, null, null, video/avc, avc1.4D4832, 3988960, null, [1280, 2276, -1.0], [-1, -1]), format_supported=YES