summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/mx/primitives/mx.video.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/javascripts/mx/primitives/mx.video.js')
-rw-r--r--public/assets/javascripts/mx/primitives/mx.video.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/public/assets/javascripts/mx/primitives/mx.video.js b/public/assets/javascripts/mx/primitives/mx.video.js
index b1b9f6b..f92fe9f 100644
--- a/public/assets/javascripts/mx/primitives/mx.video.js
+++ b/public/assets/javascripts/mx/primitives/mx.video.js
@@ -28,8 +28,8 @@ MX.Video = MX.Object3D.extend({
this.paused = true
this.player = document.createElement('video')
- this.player.addEventListener("loadedmetadata", $.proxy(this.ready, this))
- this.player.addEventListener("error", $.proxy(this.error, this))
+ this.player.addEventListener("loadedmetadata", this.ready.bind(this))
+ this.player.addEventListener("error", this.error.bind(this))
this.player.width = this.width
this.player.height = this.height
this.player.src = this.media.url
@@ -62,7 +62,10 @@ MX.Video = MX.Object3D.extend({
},
seek: function(n){
- this.player.currentTime = n
+ if (n < 1) {
+ n = n * this.duration()
+ }
+ this.player.currentTime = n
},
duration: function(){
@@ -71,6 +74,9 @@ MX.Video = MX.Object3D.extend({
finished: function(){
console.log("video finished")
+ if (this.media.bound) {
+ $(".playButton").removeClass('playing')
+ }
},