aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-06-28 18:17:22 -0700
committerJose Antonio Marquez2012-06-28 18:17:22 -0700
commita859432f0cc5746e2855c16565a75391ea657772 (patch)
treee99690d1babfb60d9e95eb296ea4f16a75437761
parentc37f2cb15b90d7315e9580fee1ae7f6e0694052c (diff)
downloadninja-a859432f0cc5746e2855c16565a75391ea657772.tar.gz
Fixing video autoplay bug in PI
Adding functionality to prevent autoplay on videos while in author-time. Fixes chrome preview issues.
-rwxr-xr-xjs/components/tools-properties/tag-properties.reel/tag-properties.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/js/components/tools-properties/tag-properties.reel/tag-properties.js b/js/components/tools-properties/tag-properties.reel/tag-properties.js
index ab745049..f14183e0 100755
--- a/js/components/tools-properties/tag-properties.reel/tag-properties.js
+++ b/js/components/tools-properties/tag-properties.reel/tag-properties.js
@@ -54,6 +54,7 @@ var TagProperties = exports.TagProperties = Montage.create(ToolProperties, {
54 this.divElement.addEventListener("click", this, false); 54 this.divElement.addEventListener("click", this, false);
55 this.imageElement.addEventListener("click", this, false); 55 this.imageElement.addEventListener("click", this, false);
56 this.videoElement.addEventListener("click", this, false); 56 this.videoElement.addEventListener("click", this, false);
57 this.videoElement.addEventListener("canplay", this, false);
57 this.canvasElement.addEventListener("click", this, false); 58 this.canvasElement.addEventListener("click", this, false);
58 this.customElement.addEventListener("click", this, false); 59 this.customElement.addEventListener("click", this, false);
59 } 60 }
@@ -99,6 +100,19 @@ var TagProperties = exports.TagProperties = Montage.create(ToolProperties, {
99 } 100 }
100 } 101 }
101 }, 102 },
103
104 handleCanplay: {
105 value: function (e) {
106 //TODO: Figure out why the video must be seeked to the end before pausing
107 var time = Math.ceil(this.duration);
108 //Trying to display the last frame (doing minus 2 seconds if long video)
109 if (time > 2) this.currentTime = time - 2;
110 else if (time > 1) this.currentTime = time - 1;
111 else this.currentTime = time || 0;
112 //Pauing video
113 this.pause();
114 }
115 },
102 116
103 _selectedElement: { 117 _selectedElement: {
104 value: "div", enumerable: false 118 value: "div", enumerable: false