summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjules <jules@okfoc.us>2014-08-22 17:21:00 -0400
committerjules <jules@okfoc.us>2014-08-22 17:21:00 -0400
commitb4c2e36240ab3e2715d119a84c0c124ffabc3725 (patch)
tree19ee19ed9fe0d11b692bea94daf3724867c14b1c
parent2b2d6a5048dc75cd1d3f7ec6b8829862ea0129dd (diff)
parent73898a7939c810b4485d3226a5d1952827860668 (diff)
Merge branch 'master' of lmno:dither
-rw-r--r--js/camera.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/js/camera.js b/js/camera.js
index e03586a..ef4898a 100644
--- a/js/camera.js
+++ b/js/camera.js
@@ -24,6 +24,11 @@ var camera = (function(){
}
function ready(){
+ // defer here if necessary.. firefox fires "canplay" before videoWidth is available
+ if (! video.videoWidth) {
+ setTimeout(ready, 50)
+ return
+ }
cc.canvas.width = actual_w = w = min(video.videoWidth, 400)
cc.canvas.height = actual_h = h = video.videoHeight / (video.videoWidth/w)
video.setAttribute('width', video.videoWidth)