MX.Youtube = MX.Object3D.extend({ init: function (ops) { this.type = "Youtube" var layer = this layer.media = ops.media layer.width = ops.media.width layer.height = ops.media.height layer.x = ops.x || 0 layer.y = ops.y || 0 layer.z = ops.z || 0 layer.rotationX = ops.rotationX || 0 layer.rotationY = ops.rotationY || 0 layer.rotationZ = ops.rotationZ || 0 layer.scale = ops.scale || 1 layer.backface = ops.backface || false if (layer.backface) { layer.el.classList.add("backface-visible") } if (ops.src) { this.loadEmbed(ops) } if (ops.className) { layer.el.classList.add(ops.className) } layer.el.style.backgroundRepeat = 'no-repeat' }, loadEmbed: function(ops){ var layer = this }, move: function(ops){ var layer = this layer.ops = defaults(ops, layer.ops) for (var i in ops) { layer[i] = ops[i] } layer.dirty = true layer.update() }, toString: function(){ var params = "id src width height depth x y z rotationX rotationY rotationZ scale".split(" ") return this.__toString(params) }, }) window.onYouTubePlayerAPIReady = function(){ console.log("youtube ready") }