diff options
author | Valerio Virgillito | 2012-06-28 22:28:53 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-06-28 22:28:53 -0700 |
commit | 35af74aa558a642af8bcdbd8c18098b94771537d (patch) | |
tree | 985f68393d4910e6cff02123a37436c4e0bd332c /js/controllers | |
parent | 59eb1a72aa8871fb9e4cad1fcbcdf8b6bbc5d872 (diff) | |
parent | 4bfc0b9221734c75f305dbeefe8e49a9d73b766b (diff) | |
download | ninja-35af74aa558a642af8bcdbd8c18098b94771537d.tar.gz |
Merge branch 'refs/heads/Document' into video-fix
Diffstat (limited to 'js/controllers')
-rwxr-xr-x | js/controllers/elements/video-controller.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/controllers/elements/video-controller.js b/js/controllers/elements/video-controller.js index c36752f5..44ba5aa1 100755 --- a/js/controllers/elements/video-controller.js +++ b/js/controllers/elements/video-controller.js | |||
@@ -28,6 +28,19 @@ exports.VideoController = Montage.create(ElementController, { | |||
28 | value: function(el, p, value) { | 28 | value: function(el, p, value) { |
29 | switch(p) { | 29 | switch(p) { |
30 | case "src": | 30 | case "src": |
31 | |||
32 | //TODO: Move this to the location where the element is created | ||
33 | el.addEventListener('canplay', function(e) { | ||
34 | //TODO: Figure out why the video must be seeked to the end before pausing | ||
35 | var time = Math.ceil(this.duration); | ||
36 | //Trying to display the last frame (doing minus 2 seconds if long video) | ||
37 | if (time > 2) this.currentTime = time - 2; | ||
38 | else if (time > 1) this.currentTime = time - 1; | ||
39 | else this.currentTime = time || 0; | ||
40 | //Pauing video | ||
41 | this.pause(); | ||
42 | }, false); | ||
43 | |||
31 | el.setAttribute(p, value); | 44 | el.setAttribute(p, value); |
32 | break; | 45 | break; |
33 | case "poster": | 46 | case "poster": |