Commit 6e8d63bc authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

Allow picking subtitles for media that are not local or network files

Fixes #1582
parent 810e96d5
Pipeline #48396 passed with stage
in 2 minutes and 25 seconds
......@@ -73,6 +73,8 @@ import org.videolan.vlc.gui.helpers.UiTools.showVideoTrack
import org.videolan.vlc.gui.view.PlayerProgress
import org.videolan.vlc.media.MediaUtils
import org.videolan.vlc.util.FileUtils
import org.videolan.vlc.util.isSchemeFile
import org.videolan.vlc.util.isSchemeNetwork
import org.videolan.vlc.viewmodels.PlaylistModel
@ExperimentalCoroutinesApi
......@@ -735,7 +737,7 @@ class VideoPlayerOverlayDelegate (private val player: VideoPlayerActivity) {
private fun pickSubtitles() {
val uri = player.videoUri ?: return
val media = MediaWrapperImpl(FileUtils.getParent(uri.toString())!!.toUri())
val media = if (uri.scheme.isSchemeFile() || uri.scheme.isSchemeNetwork()) MediaWrapperImpl(FileUtils.getParent(uri.toString())!!.toUri()) else null
player.isShowingDialog = true
val filePickerIntent = Intent(player, FilePickerActivity::class.java)
filePickerIntent.putExtra(KEY_MEDIA, media)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment