make sure the video fragment still exists when the video completes

This commit is contained in:
tibbi 2017-10-28 19:05:51 +02:00
parent 883e3ad6c1
commit 75c9d28547
2 changed files with 6 additions and 1 deletions

View File

@ -464,6 +464,10 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
}
private fun videoCompleted() {
if (!isAdded) {
return
}
if (listener?.videoEnded() == false && context.config.loopVideos) {
playVideo()
} else {

View File

@ -20,8 +20,9 @@ abstract class ViewPagerFragment : Fragment() {
fun getMediumExtendedDetails(medium: Medium): String {
val file = File(medium.path)
if (!file.exists())
if (!file.exists()) {
return ""
}
val path = "${file.parent.trimEnd('/')}/"
val exif = android.media.ExifInterface(medium.path)