[Android] Support URL starting with "vlc://"
Alexandre Perraud
git at videolan.org
Thu Nov 14 16:52:40 CET 2013
vlc-ports/android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Thu Nov 14 16:38:03 2013 +0100| [0fd52828f98b56b1741ad633785ffe9ed4b34190] | committer: Jean-Baptiste Kempf
Support URL starting with "vlc://"
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=0fd52828f98b56b1741ad633785ffe9ed4b34190
---
vlc-android/AndroidManifest.xml | 1 +
.../org/videolan/vlc/gui/video/VideoPlayerActivity.java | 12 ++++++++++++
2 files changed, 13 insertions(+)
diff --git a/vlc-android/AndroidManifest.xml b/vlc-android/AndroidManifest.xml
index 6f201ac..fa5a3df 100644
--- a/vlc-android/AndroidManifest.xml
+++ b/vlc-android/AndroidManifest.xml
@@ -82,6 +82,7 @@
<data android:scheme="icyx" />
<data android:scheme="httplive" />
<data android:scheme="udp" />
+ <data android:scheme="vlc" />
</intent-filter>
<!-- This filter captures protocols with type info -->
<intent-filter>
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index eb97f1a..d605800 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1489,6 +1489,18 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
} else {
// Plain URI
mLocation = getIntent().getDataString();
+ // Remove VLC prefix if needed
+ if (mLocation.startsWith("vlc://")) {
+ mLocation = mLocation.substring(6);
+ }
+ // Decode URI
+ if (!mLocation.contains("/")){
+ try {
+ mLocation = URLDecoder.decode(mLocation,"UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ }
+ }
}
if(getIntent().getExtras() != null)
intentPosition = getIntent().getExtras().getLong("position", -1);
More information about the Android
mailing list