Skip to content

Instantly share code, notes, and snippets.

Created May 15, 2011 20:03
Show Gist options
  • Save metaskills/973483 to your computer and use it in GitHub Desktop.
Save metaskills/973483 to your computer and use it in GitHub Desktop.
Ken Collins <>
id - (string: defaults to 'Quickie_' + unique id) The id of the Quickie object.
width - (number: defaults to 1) The width of the Quickie object.
height - (number: defaults to 1) The height of the Quickie object.
container - (element) The container into which the Quickie object will be injected.
attributes - (object) QuickTime attributes for the element. See for possible attributes.
- (element) A new HTML object Element with browser appropriate QuickTime embed code.
var myQuickie = new Quickie('', {
id: 'myQuicktimeMovie',
width: 640,
height: 480,
container: 'qtmovie',
attributes: {
controller: true,
autoplay: false
Mootools Implementaiton:
class Quickie
@instanceCount = 0
constructor: (src, passedOptions = {}) ->
defaultOptions =
id: null
height: 1
width: 1
container: null
attributes: {}
options = jQuery.extend defaultOptions, passedOptions
@id = or "Quickie_#{Quickie.instanceCount}"
@container = jQuery(options.container)
@attributes = options.attributes
@attributes.src = src
@height = if @attributes.controller is true then options.height + 16 else options.height
@width = options.width
toString: ->
_generateElement: ->
node = if jQuery.browser.webkit
else if jQuery.browser.msie
node.attr 'id', @id
node.attr 'width', @width
node.attr 'height', @height
@element = node.get(0)
_buildVideoTag: ->
videoTag = jQuery('<video>')
videoTag.attr 'src', @attributes.src
videoTag.prop 'autoplay', true if @attributes.autoplay is true
videoTag.prop 'loop', true if @attributes.loop is true
_buildObjectTag: ->
objectTag = jQuery("<object>")
objectTag.attr 'classid', 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'
objectTag.attr 'codebase', ''
for own name, value of @attributes
if value?
objectTag.append "<param name='#{name}' value='#{value}' />"
_buildEmbedTag: ->
embedTag = jQuery('<embed>')
embedTag.attr 'pluginspage', ''
for own name, value of @attributes
if value?
embedTag.attr name, value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment