Created
January 26, 2010 05:01
-
-
Save metaskills/286564 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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