mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 08:18:00 +01:00
do not show an error at exoplayer setup fail, just try reinitializing later
This commit is contained in:
parent
274a50013e
commit
5b040a699b
2 changed files with 3 additions and 9 deletions
|
@ -230,6 +230,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshViewPager()
|
refreshViewPager()
|
||||||
|
view_pager.offscreenPageLimit = 2
|
||||||
|
|
||||||
if (config.blackBackground) {
|
if (config.blackBackground) {
|
||||||
view_pager.background = ColorDrawable(Color.BLACK)
|
view_pager.background = ColorDrawable(Color.BLACK)
|
||||||
|
@ -1104,10 +1105,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {}
|
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {}
|
||||||
|
|
||||||
override fun onPageSelected(position: Int) {
|
override fun onPageSelected(position: Int) {
|
||||||
if (view_pager.offscreenPageLimit == 1) {
|
|
||||||
view_pager.offscreenPageLimit = 2
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mPos != position) {
|
if (mPos != position) {
|
||||||
mPos = position
|
mPos = position
|
||||||
updateActionbarTitle()
|
updateActionbarTitle()
|
||||||
|
|
|
@ -122,7 +122,6 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
|
||||||
|
|
||||||
override fun onPlayerError(error: ExoPlaybackException?) {
|
override fun onPlayerError(error: ExoPlaybackException?) {
|
||||||
mIsExoPlayerInitialized = false
|
mIsExoPlayerInitialized = false
|
||||||
activity?.showErrorToast(error.toString())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onLoadingChanged(isLoading: Boolean) {}
|
override fun onLoadingChanged(isLoading: Boolean) {}
|
||||||
|
@ -472,11 +471,9 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
|
||||||
}.start()
|
}.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSurfaceTextureSizeChanged(surface: SurfaceTexture?, width: Int, height: Int) {
|
override fun onSurfaceTextureSizeChanged(surface: SurfaceTexture?, width: Int, height: Int) {}
|
||||||
}
|
|
||||||
|
|
||||||
override fun onSurfaceTextureUpdated(surface: SurfaceTexture?) {
|
override fun onSurfaceTextureUpdated(surface: SurfaceTexture?) {}
|
||||||
}
|
|
||||||
|
|
||||||
override fun onSurfaceTextureDestroyed(surface: SurfaceTexture?): Boolean {
|
override fun onSurfaceTextureDestroyed(surface: SurfaceTexture?): Boolean {
|
||||||
releaseExoPlayer()
|
releaseExoPlayer()
|
||||||
|
|
Loading…
Reference in a new issue