...

View Full Version : can this be done



riptide
05-07-2007, 08:00 PM
I want to do something like this

but I want to use avi or mpeg files and there not hosted on your computer.

something like filename/atsomething.com


if (!document.getElementById) return;
// Set up event handlers and embed the sounds
divs = document.getElementsByTagName("div");
for (i=0; i<divs.length; i++) {
// embed the appropriate sound using document.write
document.write('<embed id="' + 'note_' + divs[i].id + '"');
document.write(' src="' + divs[i].id + '.au" width="0" height="0"');
document.write(' autostart="false" enablejavascript="true">');
// set up the event handler
divs[i].onclick = PlaySound;
}
}
function PlaySound(e) {
if (!e) var e = window.event;
// which key was clicked?
thiskey = (e.target) ? e.target: e.srcElement;
var sound = document.getElementById("note_" + thiskey.id);
try {
// RealPlayer
sound.DoPlay();
} catch (e) {
try {
// Windows Media / Quicktime
sound.Play();
} catch (e) {
alert("No sound support.");
}
}
}
// Run the setup routine when this script executes
Setup();

antimatter15
05-07-2007, 08:23 PM
I think it should be possible, but you would need to embed a video.


function playMovie(filename){
document.write("<embed src=\""+filename+"\" width=\"200\" height=\"240\">")
}

riptide
05-08-2007, 03:47 PM
I think it should be possible, but you would need to embed a video.


function playMovie(filename){
document.write("<embed src=\""+filename+"\" width=\"200\" height=\"240\">")
}

that's wjat I want to do but why do you have all those \ in it?
they did another way. What does the function filename does use an array of file names or something if I have a list of movies to play?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum