[Android] Streams: Open RTSP streams with video player

Geoffrey Métais git at videolan.org
Tue Dec 17 12:09:48 CET 2019


vlc-android | branch: 3.2.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Dec 17 10:23:06 2019 +0000| [3d82f5e8fc593bc60ac66e146628edc25384ec02] | committer: Nicolas Pomepuy

Streams: Open RTSP streams with video player

Avoid a race condition where media is closed because we get the video
track too soon


(cherry picked from commit 9f5498613292b3badf0e94500cd4165e9a28faa4)

> https://code.videolan.org/videolan/vlc-android/commit/3d82f5e8fc593bc60ac66e146628edc25384ec02
---

 vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.kt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.kt b/vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.kt
index 042690c47..53be677e6 100644
--- a/vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.kt
@@ -57,6 +57,7 @@ import org.videolan.vlc.gui.dialogs.SavePlaylistDialog
 import org.videolan.vlc.gui.dialogs.showContext
 import org.videolan.vlc.gui.helpers.UiTools
 import org.videolan.vlc.gui.tv.browser.interfaces.BrowserFragmentInterface
+import org.videolan.vlc.gui.video.VideoPlayerActivity
 import org.videolan.vlc.media.MediaUtils
 import org.videolan.vlc.util.*
 import org.videolan.vlc.viewmodels.StreamsModel
@@ -144,7 +145,8 @@ class MRLPanelFragment : Fragment(), View.OnKeyListener, TextView.OnEditorAction
 
     private fun playMedia(mw: AbstractMediaWrapper) {
         mw.type = AbstractMediaWrapper.TYPE_STREAM
-        MediaUtils.openMedia(activity, mw)
+        if (mw.uri.scheme?.startsWith("rtsp") == true) VideoPlayerActivity.start(requireContext(), mw.uri)
+        else MediaUtils.openMedia(activity, mw)
         viewModel.refresh()
         activity?.invalidateOptionsMenu()
         UiTools.setKeyboardVisibility(editText, false)



More information about the Android mailing list