Permalink
Browse files

Adding in error handling if hardware accelerated 3D css not supported.

  • Loading branch information...
1 parent 012f381 commit 703429c883baae5cf916871dd8612635bcd430eb @iambrandonn committed Sep 25, 2012
Showing with 11 additions and 1 deletion.
  1. +11 −1 demo.js
View
12 demo.js
@@ -15,9 +15,19 @@ window.transformStyle = Modernizr.prefixed('transform').replace(/([A-Z])/g, func
var isMoving = false;
// Show fail message if browser doesn't support getUserMedia
+
if (navigator.getUserMedia === undefined) {
- $(".instructions").text("Your browser doesn't support getUserMedia(). Try using the latest version of Chrome.");
$(".instructions").css("color", "red");
+ if (!Modernizr.csstransforms3d) {
+ $(".instructions").text("Your browser/hardware doesn't support hardware accelerated 3D CSS. The page will probably not work well. Your browser also doesn't support getUserMedia(). Try using the latest version of Chrome.");
+ }
+ else {
+ $(".instructions").text("Your browser doesn't support getUserMedia(). Try using the latest version of Chrome.");
+ }
+}
+else if (!Modernizr.csstransforms3d) {
+ $(".instructions").css("color", "red");
+ $(".instructions").text("Your browser/hardware doesn't support hardware accelerated 3D CSS. The page will probably not work well.");
}
$(function() {

0 comments on commit 703429c

Please sign in to comment.