mirror of
https://github.com/Rafostar/clapper.git
synced 2025-09-01 00:41:58 +02:00
Use custom getUriProtocol function
Gst.Uri.get_protocol function is very simple. It just splits string by ":" and return the first part. We can do the same in JS and by doing that we do not have to initialize GStreamer just to get this function.
This commit is contained in:
@@ -140,6 +140,13 @@ function getFileFromLocalUri(uri)
|
||||
return file;
|
||||
}
|
||||
|
||||
/* JS replacement of "Gst.Uri.get_protocol" */
|
||||
function getUriProtocol(uri)
|
||||
{
|
||||
const arr = uri.split(':');
|
||||
return (arr.length > 1) ? arr[0] : null;
|
||||
}
|
||||
|
||||
function encodeHTML(text)
|
||||
{
|
||||
return text.replace(/&/g, '&')
|
||||
|
Reference in New Issue
Block a user