summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-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)