YouTube support. Closes #46

This commit is contained in:
Rafał Dzięgiel
2021-03-11 17:34:54 +01:00
parent 6dc37088cf
commit fceb8ff70a
6 changed files with 406 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
const { Gio, GstAudio, Gdk, Gtk } = imports.gi;
const { Gio, Gdk, Gtk } = imports.gi;
const Debug = imports.src.debug;
const { debug } = Debug;
@@ -95,3 +95,12 @@ function getFormattedTime(time, showHours)
const parsed = (hours) ? `${hours}:` : '';
return parsed + `${minutes}:${seconds}`;
}
function encodeHTML(text)
{
return text.replace(/&/g, '&')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&apos;');
}