diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-07-14 11:25:59 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-07-14 11:25:59 -0400 |
| commit | 3aac2d44b49d28c4a3e99d74d6d7769e985c2d02 (patch) | |
| tree | a5227bb32efd4e43920d15590a3669ff418e44ef /public/assets/javascripts/mx/primitives/mx.video.js | |
| parent | 1826bed806b079c6e44703a4e5f424b7aed7bd96 (diff) | |
play button
Diffstat (limited to 'public/assets/javascripts/mx/primitives/mx.video.js')
| -rw-r--r-- | public/assets/javascripts/mx/primitives/mx.video.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/public/assets/javascripts/mx/primitives/mx.video.js b/public/assets/javascripts/mx/primitives/mx.video.js index f750c28..b1b9f6b 100644 --- a/public/assets/javascripts/mx/primitives/mx.video.js +++ b/public/assets/javascripts/mx/primitives/mx.video.js @@ -19,11 +19,14 @@ MX.Video = MX.Object3D.extend({ ops.className && this.el.classList.add(ops.className) this.backface && this.el.classList.add("backface-visible") this.el.classList.add("video") + this.paused = true this.load() }, load: function(ops){ + this.paused = true + this.player = document.createElement('video') this.player.addEventListener("loadedmetadata", $.proxy(this.ready, this)) this.player.addEventListener("error", $.proxy(this.error, this)) @@ -37,7 +40,7 @@ MX.Video = MX.Object3D.extend({ ready: function(){ if (this.media.autoplay) { - this.player.play() + this.play() } else { this.player.currentTime = this.player.duration / 3 @@ -49,14 +52,16 @@ MX.Video = MX.Object3D.extend({ }, play: function(){ + this.paused = false this.player.play() }, pause: function(){ + this.paused = true this.player.pause() }, - seek: function(n){ + seek: function(n){ this.player.currentTime = n }, |
