User:Grandiosarceus/Embed Quick Time Movies.js

/* Solution to Forum:QT streaming/embedding Author: Jesús Martínez Novo "Ciencia Al Poder" License: http://www.gnu.org/copyleft/gpl.html GNU General Public Licence 2.0 or later Use on a page: View the movie You can modify the width, height and href to fit the width, height and location of the movie. */ function parseQTMovies{ var divs = document.getElementById('bodyContent').getElementsByTagName('div'); var qtobjcode = ''; if (window.ActiveXObject){ // IE   qtobjcode += ''; }else{ qtobjcode += ''; } qtobjcode += '   Download the required QuickTime Plug-in to view the movie. '; for (var i = 0; i < divs.length; i++){ if ((' DisplayQTMovie ').indexOf(' '+divs[i].className+' ') != -1){ try{ var qtdiv = divs[i]; var width = qtdiv.style.width.replace('px',''); var height = qtdiv.style.width.replace('px',''); var src = qtdiv.getElementsByTagName('a')[0].href; var movie = qtobjcode.replace(/\{width\}/g,width).replace(/\{height\}/g,height).replace(/\{src\}/g,src); qtdiv.innerHTML = movie; }catch(e){}; } } } addOnloadHook(parseQTMovies); /* */