I am unable to figure this out. I have scenario, I am getting the video data in background via viewModel, coroutine and result in LiveData. The call to viewModel happens in onViewCreated of fragment. And in onResume I initialise ExoPlayer.
Now if I get the livedata result before onResume has completed and call play() by passing the videoUrl it would fail as ExoPlayer is not initialised yet.
How do I sync up this ?