[Android] Streams: Open RTSP streams with video player

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


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Dec 17 11:23:06 2019 +0100| [9f5498613292b3badf0e94500cd4165e9a28faa4] | committer: Geoffrey Métais

Streams: Open RTSP streams with video player

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

> https://code.videolan.org/videolan/vlc-android/commit/9f5498613292b3badf0e94500cd4165e9a28faa4
---

 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 55706cdce..38974c332 100644
--- a/vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.kt
@@ -60,6 +60,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
@@ -154,7 +155,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