Skip to content

Instantly share code, notes, and snippets.

@metaskills
Created January 26, 2010 05:01
Show Gist options
  • Save metaskills/286564 to your computer and use it in GitHub Desktop.
Save metaskills/286564 to your computer and use it in GitHub Desktop.
var MyQuickie = {};
MyQuickie.defaultAttrs = {
controller: 'false',
autoplay: 'true',
loop: 'true',
enablejavascript: 'false'
};
MyQuickie.getContainerAttributes = function(container) {
var attributes = Object.clone(MyQuickie.defaultAttrs);
container.readAttribute('rel').split('|').each(function(keyvalue) {
pair = keyvalue.split('=');
attributes[pair[0]] = pair[1];
});
return attributes;
};
MyQuickie.getSome = function(container) {
var attributes = MyQuickie.getContainerAttributes(container);
var qt = new Quickie(attributes['src'], {
id: container.id.sub('container','movie'),
width: container.getWidth(),
height: container.getHeight(),
container: container,
attributes: attributes
});
container.update(qt);
};
document.observe('dom:loaded', function(){
$$('div.quicktime_video').each(function(container){
if (container.hasClassName('quickie')) {
MyQuickie.getSome(container); // Load up the QuickTime now.
} else { // Means we have a Lazie, essentially a poster image.
container.down('img').observe('click',MyQuickie.getSome.curry(container));
};
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment