Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Adding a parameter to QT embedded with js
Old 06-09-2009, 09:08 PM Adding a parameter to QT embedded with js
Novice Talker

Posts: 8
Trades: 0
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
piers2009 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Adding a parameter to QT embedded with js
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20302 seconds with 12 queries