mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-31 00:11:59 +02:00
Decode custom video title from info
The values in JSON info are URI encoded with "+" signs, add custom decode function that decodes them.
This commit is contained in:
@@ -104,3 +104,8 @@ function encodeHTML(text)
|
|||||||
.replace(/"/g, '"')
|
.replace(/"/g, '"')
|
||||||
.replace(/'/g, ''');
|
.replace(/'/g, ''');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function decodeURIPlus(uri)
|
||||||
|
{
|
||||||
|
return decodeURI(uri.replace(/\+/g, ' '));
|
||||||
|
}
|
||||||
|
@@ -93,7 +93,7 @@ class ClapperPlayer extends PlayerBase
|
|||||||
throw new Error('no YouTube video URI');
|
throw new Error('no YouTube video URI');
|
||||||
|
|
||||||
this.customVideoTitle = (info.videoDetails && info.videoDetails.title)
|
this.customVideoTitle = (info.videoDetails && info.videoDetails.title)
|
||||||
? info.videoDetails.title
|
? Misc.decodeURIPlus(info.videoDetails.title)
|
||||||
: videoId;
|
: videoId;
|
||||||
|
|
||||||
return videoUri;
|
return videoUri;
|
||||||
|
Reference in New Issue
Block a user