mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-31 16:31:58 +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)
|
function checkYouTubeUri(uri)
|
||||||
{
|
{
|
||||||
const gstUri = Gst.Uri.from_string(uri);
|
const gstUri = Gst.Uri.from_string(uri);
|
||||||
|
const originalHost = gstUri.get_host();
|
||||||
gstUri.normalize();
|
gstUri.normalize();
|
||||||
|
|
||||||
const host = gstUri.get_host();
|
const host = gstUri.get_host();
|
||||||
@@ -415,6 +416,12 @@ function checkYouTubeUri(uri)
|
|||||||
videoId = gstUri.get_path_segments()[1];
|
videoId = gstUri.get_path_segments()[1];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
const scheme = gstUri.get_scheme();
|
||||||
|
if(scheme === 'yt' || scheme === 'youtube') {
|
||||||
|
/* ID is case sensitive */
|
||||||
|
videoId = originalHost;
|
||||||
|
break;
|
||||||
|
}
|
||||||
success = false;
|
success = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user