User:Ciencia Al Poder-fduser/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 = '      '; 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){throw e;}; } } }

// Uncomment the following line to execute on a page load. // addOnloadHook(parseQTMovies);

// Autoload. replace with the avove line if used in a Common.js etc. parseQTMovies;

/* */