Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
	Better YouTube Embeds on Tumblr by Matthew Buchanan
	http://matthewbuchanan.name/261951286
*/
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
	$("object").each(function() {
		if ($(this).find("param[value^='http://www.youtube.com']").length > 0) {
			var parent = $(this).parent();
			var youtubeCode = parent.html();
			var params = "";
			if (youtubeCode.toLowerCase().indexOf("<param") == -1) {
				$("param", this).each(function() {
					params += $(this).get(0).outerHTML;
				});
			}
			var oldOpts = /rel=0/g;
			var newOpts = "rel=0&amp;color1=0xFFFFFF&amp;color2=0xFFFFFF";
			youtubeCode = youtubeCode.replace(oldOpts, newOpts);
			if (params != "") {
				params = params.replace(oldOpts, newOpts);
				youtubeCode = youtubeCode.replace(/<embed/i, params + "<embed");
			}
			parent.html(youtubeCode);
		}
	});
});
</script>