Nested Fragment with VideoView streaming takes too long while stopping

这一生的挚爱 提交于 2019-12-08 04:39:11

问题


I have a tab UI, with a Fragment Tab host at bottom and fragments in a container fragment. Every time I change Tab I switch between fragments within the container fragment.

Now the issue is as below: I have a fragment with a video view streaming live video. while the video is buffering if I press back key the fragment takes too long to stop. I can see a big lag of 2-3 seconds from the time onStop() of this fragment till oCreateView() of other fragment. All my other methods like onDestroy, onDestroyVeiw() etc are empty.

I have come to a conclusion that it is because the video view is busy with initialization/buffering it take android time to stop all these activities synchronously in video view and then stops the fragment.

What I am looking for is to stop the video buffering Asynchronously.. so that my UI for next fragment is not shown with the lag.

regards,

ticks_sunny

来源:https://stackoverflow.com/questions/36340085/nested-fragment-with-videoview-streaming-takes-too-long-while-stopping

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!