Ok...
I'm using the setMovie function to embed a series of Quicktimes called when clicking on a thumbnail as in:
Code:
<a href="#" class="thumbnail" onClick="setMovie('Quicktimes/mov1.mov')"><img src="thumbs/mov1.gif" alt=""/></a>
<a href="#" class="thumbnail" onClick="setMovie('Quicktimes/mov2.mov')"><img src="thumbs/mov2.gif" alt=""/></a>
<a href="#" class="thumbnail" onClick="setMovie('Quicktimes/mov3.mov')"><img src="thumbs/mov3.gif" alt=""/></a>
The code I'm using to embed is:
Code:
<script>
function setMovie( url )
{
$('movieHost').innerHTML = '';
var elEmbed = document.createElement( 'embed' );
elEmbed.src = url;
elEmbed.setAttribute("width", "100%");
elEmbed.setAttribute("height","100%");
elEmbed.setAttribute("scale","aspect");
$('movieHost').appendChild( elEmbed );
}
new Ajax.Request( 'Quicktimes/movies.xml', {
method: 'get',
onSuccess: function( transport ) {
var movieTags = transport.responseXML.getElementsByTagName( 'movie' );
$('movieList').innerHTML = '';
var bFirst = true;
for( var b = 0; b < movieTags.length; b++ ) {
var url = movieTags[b].getAttribute('url');
var title = movieTags[b].getAttribute('title');
if ( bFirst )
{
setMovie( url );
bFirst = false;
}
var html = '<a href="javascript:void setMovie(\''+url+'\');">';
html += title+'</a><br/>';
$('movieList').innerHTML += html;
}
}
} );
</script>
(Part of the preceding code I intend to wrangle into showing a title of what's playing, I hope)
It's based on the Prototype framework and it embeds the quicktime movies into:
Code:
<!-- HTML for the Quicktime plugins -->
<div id="vContainer">
<div id="movieHost"></div>
</div>
But now what I'm looking to have is mov1.mov autoplay when the page loads the first time, but to clear if any of the thumbnails are clicked on.
I'm not sure where to put the autoplay parameter and then how to reference it - any help would be much appreciated 
|