blob: c9ec339ff059814cc10c62ef2e603f84426d2d91 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
MX.Video = MX.Object3D.extend({
init: function (ops) {
this.type = "Video"
var layer = this
layer.width = 0
layer.height = 0
layer.x = ops.x || 0
layer.y = ops.y || 0
layer.z = ops.z || 0
layer.scale = ops.scale || 1
layer.backface = ops.backface || false
layer.media = ops.media
layer.el.classList.add('video')
if (layer.backface) {
layer.el.classList.add("backface-visible")
}
if (ops.src) {
this.loadVideo(ops)
}
if (ops.className) {
layer.el.classList.add(ops.className)
}
layer.el.style.backgroundRepeat = 'no-repeat'
},
loadVideo: function(ops){
var layer = this
layer.ops = defaults(ops, layer.ops)
var video = document.createElement('video')
video.addEventListener("loadedmetadata", function(){
//
video.play()
})
video.src = ops.src
video.load()
},
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)
},
})
|