mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 14:37:59 +01:00
properly handle content uris as Panorama Videos
This commit is contained in:
parent
83ab2ad56e
commit
70a0d0f7a9
1 changed files with 7 additions and 10 deletions
|
@ -13,7 +13,6 @@ import android.widget.SeekBar
|
||||||
import com.google.vr.sdk.widgets.video.VrVideoEventListener
|
import com.google.vr.sdk.widgets.video.VrVideoEventListener
|
||||||
import com.google.vr.sdk.widgets.video.VrVideoView
|
import com.google.vr.sdk.widgets.video.VrVideoView
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
|
|
||||||
import com.simplemobiletools.gallery.pro.R
|
import com.simplemobiletools.gallery.pro.R
|
||||||
import com.simplemobiletools.gallery.pro.extensions.*
|
import com.simplemobiletools.gallery.pro.extensions.*
|
||||||
import com.simplemobiletools.gallery.pro.helpers.MIN_SKIP_LENGTH
|
import com.simplemobiletools.gallery.pro.helpers.MIN_SKIP_LENGTH
|
||||||
|
@ -44,14 +43,7 @@ open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeList
|
||||||
supportActionBar?.hide()
|
supportActionBar?.hide()
|
||||||
|
|
||||||
checkNotchSupport()
|
checkNotchSupport()
|
||||||
handlePermission(PERMISSION_WRITE_STORAGE) {
|
|
||||||
if (it) {
|
|
||||||
checkIntent()
|
checkIntent()
|
||||||
} else {
|
|
||||||
toast(R.string.no_storage_permissions)
|
|
||||||
finish()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
|
@ -99,9 +91,14 @@ open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeList
|
||||||
try {
|
try {
|
||||||
val options = VrVideoView.Options()
|
val options = VrVideoView.Options()
|
||||||
options.inputType = VrVideoView.Options.TYPE_MONO
|
options.inputType = VrVideoView.Options.TYPE_MONO
|
||||||
|
val uri = if (path.startsWith("content://")) {
|
||||||
|
Uri.parse(path)
|
||||||
|
} else {
|
||||||
|
Uri.fromFile(File(path))
|
||||||
|
}
|
||||||
|
|
||||||
vr_video_view.apply {
|
vr_video_view.apply {
|
||||||
loadVideo(Uri.fromFile(File(path)), options)
|
loadVideo(uri, options)
|
||||||
pauseVideo()
|
pauseVideo()
|
||||||
|
|
||||||
setFlingingEnabled(true)
|
setFlingingEnabled(true)
|
||||||
|
|
Loading…
Reference in a new issue