[Android] Playback: Format network uris only
Geoffrey Métais
git at videolan.org
Tue Feb 26 12:31:06 CET 2019
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Feb 26 12:24:08 2019 +0100| [46b13813d017da2ffa4cb23901c004fe2ba2bb7d] | committer: Geoffrey Métais
Playback: Format network uris only
> https://code.videolan.org/videolan/vlc-android/commit/46b13813d017da2ffa4cb23901c004fe2ba2bb7d
---
vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
index bc8a3cff6..1c3bbb8c6 100644
--- a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+++ b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
@@ -293,7 +293,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
return
}
val start = getStartTime(mw)
- val media = Media(VLCInstance.get(), Uri.parse(Uri.decode(uri.toString())))
+ val media = Media(VLCInstance.get(), formatUri(uri))
media.addOption(":start-time=$start")
VLCOptions.setMediaOptions(media, ctx, flags or mw.flags)
/* keeping only video during benchmark */
@@ -330,6 +330,12 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
}
}
+ private fun formatUri(uri: Uri) : Uri {
+ if (uri.scheme == "file" || uri.scheme == "fd") return uri
+ val mrl = Uri.decode(uri.toString())
+ return Uri.parse(mrl)
+ }
+
private fun skipMedia() {
if (currentIndex != nextIndex) next()
else stop(false)
More information about the Android
mailing list