diff --git a/Plugins/mediaSupport.js b/Plugins/mediaSupport.js new file mode 100644 index 0000000..80aad8d --- /dev/null +++ b/Plugins/mediaSupport.js @@ -0,0 +1,61 @@ +//META{"name":"mediaSupport"}*// + +var mediaSupport = function () {}; + +mediaSupport.prototype.convert = function () { + $(".message a").each(function() { + var t = $(this); + var href = t.attr("href"); + if(href == undefined) return true; + href = href.replace("http:", "https:"); + if(!href.endsWith(".mp4") && !href.endsWith(".webm") && !href.endsWith(".ogg") && !href.endsWith(".mp3") && !href.endsWith(".wav")) return true; + var video = true; + var type = "webm"; + if(href.endsWith(".mp4")) type = "mp4"; + if(href.endsWith(".ogg")) type = "ogg"; + if(href.endsWith(".mp3")) { + type = "mpeg"; + video = false; + } + if(href.endsWith(".wav")) { + type = "wav"; + video = false; + } + + if(video) { + t.replaceWith(''); + } else { + t.replaceWith(''); + } + }); +}; + +mediaSupport.prototype.onMessage = function () { + setTimeout(this.convert(), 2000); +}; +mediaSupport.prototype.onSwitch = function () { + this.convert(); +}; +mediaSupport.prototype.start = function () { + this.convert(); +}; + +mediaSupport.prototype.load = function () {}; +mediaSupport.prototype.unload = function () {}; +mediaSupport.prototype.stop = function () {}; +mediaSupport.prototype.getSettingsPanel = function () { + return ""; +}; + +mediaSupport.prototype.getName = function () { + return "Video Support"; +}; +mediaSupport.prototype.getDescription = function () { + return "Add support for html5 video"; +}; +mediaSupport.prototype.getVersion = function () { + return "0.1.0"; +}; +mediaSupport.prototype.getAuthor = function () { + return "Jiiks"; +}; \ No newline at end of file