mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 04:57:59 +01:00
make sure the video fragment still exists when the video completes
This commit is contained in:
parent
883e3ad6c1
commit
75c9d28547
2 changed files with 6 additions and 1 deletions
|
@ -464,6 +464,10 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun videoCompleted() {
|
private fun videoCompleted() {
|
||||||
|
if (!isAdded) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (listener?.videoEnded() == false && context.config.loopVideos) {
|
if (listener?.videoEnded() == false && context.config.loopVideos) {
|
||||||
playVideo()
|
playVideo()
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -20,8 +20,9 @@ abstract class ViewPagerFragment : Fragment() {
|
||||||
|
|
||||||
fun getMediumExtendedDetails(medium: Medium): String {
|
fun getMediumExtendedDetails(medium: Medium): String {
|
||||||
val file = File(medium.path)
|
val file = File(medium.path)
|
||||||
if (!file.exists())
|
if (!file.exists()) {
|
||||||
return ""
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
val path = "${file.parent.trimEnd('/')}/"
|
val path = "${file.parent.trimEnd('/')}/"
|
||||||
val exif = android.media.ExifInterface(medium.path)
|
val exif = android.media.ExifInterface(medium.path)
|
||||||
|
|
Loading…
Reference in a new issue