diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 4486b04..e3370f5 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -42,6 +42,7 @@
+
diff --git a/app/src/main/java/org/xbmc/kore/ui/RemoteActivity.java b/app/src/main/java/org/xbmc/kore/ui/RemoteActivity.java
index b613bf6..f6ca3cb 100644
--- a/app/src/main/java/org/xbmc/kore/ui/RemoteActivity.java
+++ b/app/src/main/java/org/xbmc/kore/ui/RemoteActivity.java
@@ -372,7 +372,12 @@ public class RemoteActivity extends BaseActivity
}
final String videoId = getVideoId(videoUri);
- if (videoId == null) return;
+ if (videoId == null) {
+ Toast.makeText(RemoteActivity.this,
+ R.string.error_share_video,
+ Toast.LENGTH_SHORT).show();
+ return;
+ }
final String kodiAddonUrl = "plugin://plugin.video." +
(videoUri.getHost().endsWith("vimeo.com") ? "vimeo" : "youtube") +
@@ -524,9 +529,15 @@ public class RemoteActivity extends BaseActivity
private String getVideoId(Uri playuri) {
if (playuri.getHost().endsWith("youtube.com") || playuri.getHost().endsWith("youtu.be") || playuri.getHost().endsWith("vimeo.com")) {
// We'll need to get the v= parameter from the URL
- final Pattern pattern =
- Pattern.compile("(?:https?:\\/\\/)?(?:www\\.|m\\.)?(?:youtu(?:\\.be\\/|be\\.com\\/watch\\?v=)|vimeo\\.com\\/)([\\w-]+)",
- Pattern.CASE_INSENSITIVE);
+ final Pattern pattern;
+ if (playuri.getHost().endsWith("vimeo.com")) {
+ pattern = Pattern.compile("^(?:https?:\\/\\/)?(?:www\\.|player\\.)?vimeo\\.com\\/(?:.*\\/)?(\\d+)(?:\\?.*)?$",
+ Pattern.CASE_INSENSITIVE);
+ }
+ else {
+ pattern = Pattern.compile("^(?:https?:\\/\\/)?(?:www\\.|m\\.)?youtu(?:\\.be\\/|be\\.com\\/watch\\?v=)([\\w-]+)(?:[\\?&].*)?$",
+ Pattern.CASE_INSENSITIVE);
+ }
final Matcher matcher = pattern.matcher(playuri.toString());
if (matcher.matches()) {
return matcher.group(1);
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index ea7c784..2cbf010 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -215,6 +215,7 @@
%1$s.
Couldn\'t get active player.\nError message:
%1$s.
+ Couldn\'t share video to Kodi/XBMC.
Directors:
Studio: