NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Video Embebido // @namespace VideoEmbebi.do // @include https://exo.do/threads/* // @include http://exo.do/threads/* // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js // @author gananciafc // @author xusoO // @author TheBronx // @version 1.0 // @license GPL version 2 or any later version; http://www.gnu.org/licenses/gpl-2.0.txt // @grant none // @run-at document-end // ==/UserScript== $(document).ready(function() { function parseWebm() { // Carga videos a partir de url's .webm $('a[href$=".webm"]').each(function() { var link = $(this).attr('href'); var video = document.createElement('video'); video.src = link; setVideoAttributes(video); $(this).after(video); $(this).remove(); }); } function parseGfycat() { // Carga videos de gfycat.com via api gfycat http://gfycat.com/api $('a[href*="gfycat.com"]').each(function() { var dataID = $(this).attr('href').replace(/.*?:\/\/([w]+)?\.?gfycat\.com\//g, ""); var $this = $(this); $.ajax({ type: "GET", url: "http://gfycat.com/cajax/get/"+dataID, async: true, dataType: "json", success: function(data){ var video = document.createElement('video'); video.src = data.gfyItem.mp4Url; video.src = data.gfyItem.webmUrl; setVideoAttributes(video); $this.append('<br>'); $this.after(video); } }); }); } function parseVocaroo() { $('a[href^="http://vocaroo.com/"]').each(function () { var href = this.href.substring(this.href.lastIndexOf('/') + 1); var html = '<object width="148" height="44">\ <param name="movie" value="http://vocaroo.com/player.swf?playMediaID=' + href + '&autoplay=0"></param>\ <param name="wmode" value="transparent"></param>\ <embed src="http://vocaroo.com/player.swf?playMediaID=' + href + '&autoplay=0" width="148" height="44" wmode="transparent" type="application/x-shockwave-flash"></embed>\ </object><br>' + this.outerHTML; this.outerHTML = html; }); } function setVideoAttributes(video) { video.autoplay = false; video.loop = false; video.muted = false; video.controls = true; video.style.maxWidth = "600px"; video.style.maxHeight = "600px"; } parseWebm(); parseGfycat(); parseVocaroo(); });