Figured it out. Basically I followed this blog post and ended up with this code:
try{
//set the html-tag
var objID = "ctl00_MSO_ContentDiv"
//replace [youtube]url[/youtube] tags with corresponding HTML object
if (document.getElementById(objID).innerHTML.indexOf("[youtube]") > -1) {
//find all [youtube][/youtube] tags
var arr = document.getElementById(objID).innerHTML.split("[youtube]");
var tempSrc = document.getElementById(objID).innerHTML;
for (j = 0; j < arr.length; j++) {
//get the url between the [youtube][/youtube] tags
urltemp = arr[j].substring(0, arr[j].indexOf("[/youtube]"));
if (urltemp == "") continue;
//format the URL to the correct format to use with the object-element
url = urltemp.replace(/<.*?>/g, '').replace("/watch?v=", "/embed/");
//replace the [youtube][/youtube] tags with the corresponding object-element
tempSrc = tempSrc.replace("[youtube]" + urltemp + "[/youtube]", "<iframe width='480' height='390' src='"+ url +"' frameborder='0' allowfullscreen></iframe>");
}
document.getElementById(objID).innerHTML = tempSrc;
}
//replace [video]url[/video] tags with corresponding HTML object
if (document.getElementById(objID).innerHTML.indexOf("[video]") > -1) {
//find all [video][/video] tags
var arr = document.getElementById(objID).innerHTML.split("[video]");
var tempSrc = document.getElementById(objID).innerHTML;
for (j = 0; j < arr.length; j++) {
//get the url between the [video][/video] tags
url = arr[j].substring(0, arr[j].indexOf("[/video]"));
if (url == "") continue;
//replace the [video][/video] tags with the corresponding object-element
tempSrc = tempSrc.replace("[video]" + url + "[/video]", "<object type='application/x-silverlight-2' data='data:application/x-silverlight-2,' width='500' height='333'><param name='source' value='"+ ENTER YOUR SITE ROOT URL HERE +"_layouts/clientbin/mediaplayer.xap'/><param name='initParams' value='displayMode=Inline,mediaTitle= ,mediaSource="+ url +",previewImageSource="+ url.slice(0, -3) +"jpg,mediaFileExtensions=wmv;wma;avi;mpg;mp3;,silverlightMediaExtensions=wmv;wma;mp3;'/><param name='windowless' value='true'/><param name='enableHtmlAccess' value='true'/><param name='minRuntimeVersion' value='2.0.31005.0'/></object> ");
}
document.getElementById(objID).innerHTML = tempSrc;
}
}
catch(err){}
I created a .js file with this code and placed it inside a folder on my server (Style Library for me) and referenced it in the masterpage below the tag and above the tag. The on the blog post just use [youtube][/youtube] to embed a youtube link and [video][/video] to embed a video in Silverlight that is posted somewhere on SharePoint. I have only tried this with MP4 and it works fine, not sure about other file types.
Original source of the scripts: youtube and video