mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
Treat "yt" and "youtube" URI schemes as YouTube videos
You can set URI to "yt://VIDEO_ID" for YouTube videos
This commit is contained in:
@@ -399,6 +399,7 @@ var YouTubeClient = GObject.registerClass({
|
||||
function checkYouTubeUri(uri)
|
||||
{
|
||||
const gstUri = Gst.Uri.from_string(uri);
|
||||
const originalHost = gstUri.get_host();
|
||||
gstUri.normalize();
|
||||
|
||||
const host = gstUri.get_host();
|
||||
@@ -415,6 +416,12 @@ function checkYouTubeUri(uri)
|
||||
videoId = gstUri.get_path_segments()[1];
|
||||
break;
|
||||
default:
|
||||
const scheme = gstUri.get_scheme();
|
||||
if(scheme === 'yt' || scheme === 'youtube') {
|
||||
/* ID is case sensitive */
|
||||
videoId = originalHost;
|
||||
break;
|
||||
}
|
||||
success = false;
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user