Support playback of shared plain http-video urls (#292)
Currently Kore does only support the playback of youtube and vimeo video urls when invoked via the "Play with Kodi" share menu. This commit adds support for plain video urls.
This commit is contained in:
parent
45cdacebca
commit
f0cd9a67f8
|
@ -386,17 +386,18 @@ public class RemoteActivity extends BaseActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
final String videoId = getVideoId(videoUri);
|
final String videoId = getVideoId(videoUri);
|
||||||
if (videoId == null) {
|
String videoUrl;
|
||||||
Toast.makeText(RemoteActivity.this,
|
if (videoId != null) {
|
||||||
R.string.error_share_video,
|
videoUrl = "plugin://plugin.video." +
|
||||||
Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final String kodiAddonUrl = "plugin://plugin.video." +
|
|
||||||
(videoUri.getHost().endsWith("vimeo.com") ? "vimeo" : "youtube") +
|
(videoUri.getHost().endsWith("vimeo.com") ? "vimeo" : "youtube") +
|
||||||
"/play/?video_id=" + videoId;
|
"/play/?video_id=" + videoId;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
videoUrl = videoUri.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
final String fvideoUrl = videoUrl;
|
||||||
|
|
||||||
// Check if any video player is active and clear the playlist before queuing if so
|
// Check if any video player is active and clear the playlist before queuing if so
|
||||||
final HostConnection connection = hostManager.getConnection();
|
final HostConnection connection = hostManager.getConnection();
|
||||||
final Handler callbackHandler = new Handler();
|
final Handler callbackHandler = new Handler();
|
||||||
|
@ -413,9 +414,9 @@ public class RemoteActivity extends BaseActivity
|
||||||
|
|
||||||
if (!videoIsPlaying) {
|
if (!videoIsPlaying) {
|
||||||
// Clear the playlist
|
// Clear the playlist
|
||||||
clearPlaylistAndQueueFile(kodiAddonUrl, connection, callbackHandler);
|
clearPlaylistAndQueueFile(fvideoUrl, connection, callbackHandler);
|
||||||
} else {
|
} else {
|
||||||
queueFile(kodiAddonUrl, false, connection, callbackHandler);
|
queueFile(fvideoUrl, false, connection, callbackHandler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue