2016-03-29 01:34:46 +02:00
|
|
|
//META{"name":"videoSupport"}*//
|
|
|
|
|
|
|
|
var videoSupport = function () {};
|
|
|
|
|
|
|
|
videoSupport.prototype.convert = function () {
|
2016-03-29 01:54:46 +02:00
|
|
|
$(".message a").each(function() {
|
2016-03-29 01:34:46 +02:00
|
|
|
var t = $(this);
|
|
|
|
var href = t.attr("href");
|
|
|
|
if(href == undefined) return true;
|
2016-03-29 01:40:51 +02:00
|
|
|
href = href.replace("http:", "https:");
|
2016-03-29 01:35:51 +02:00
|
|
|
if(!href.endsWith(".mp4") && !href.endsWith(".webm") && !href.endsWith(".ogg")) return true;
|
2016-03-29 01:34:46 +02:00
|
|
|
var type = "webm";
|
|
|
|
if(href.endsWith(".mp4")) type = "mp4";
|
|
|
|
if(href.endsWith(".ogg")) type = "ogg";
|
|
|
|
|
2016-03-29 01:42:35 +02:00
|
|
|
t.replaceWith( '<video width="480" height="320" src="'+href+'" type="video/'+type+'" controls></video>');
|
2016-03-29 01:34:46 +02:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
videoSupport.prototype.onMessage = function () {
|
2016-03-29 01:44:55 +02:00
|
|
|
setTimeout(this.convert(), 2000);
|
2016-03-29 01:34:46 +02:00
|
|
|
};
|
|
|
|
videoSupport.prototype.onSwitch = function () {
|
|
|
|
this.convert();
|
|
|
|
};
|
|
|
|
videoSupport.prototype.start = function () {
|
|
|
|
this.convert();
|
|
|
|
};
|
|
|
|
|
|
|
|
videoSupport.prototype.load = function () {};
|
|
|
|
videoSupport.prototype.unload = function () {};
|
|
|
|
videoSupport.prototype.stop = function () {};
|
|
|
|
videoSupport.prototype.getSettingsPanel = function () {
|
|
|
|
return "";
|
|
|
|
};
|
|
|
|
|
|
|
|
videoSupport.prototype.getName = function () {
|
|
|
|
return "Video Support";
|
|
|
|
};
|
|
|
|
videoSupport.prototype.getDescription = function () {
|
|
|
|
return "Add support for html5 video";
|
|
|
|
};
|
|
|
|
videoSupport.prototype.getVersion = function () {
|
|
|
|
return "0.1.0";
|
|
|
|
};
|
|
|
|
videoSupport.prototype.getAuthor = function () {
|
|
|
|
return "Jiiks";
|
|
|
|
};
|