diff --git a/lms/static/js/verify_student/views/webcam_photo_view.js b/lms/static/js/verify_student/views/webcam_photo_view.js index ee2245a216..20fc55468e 100644 --- a/lms/static/js/verify_student/views/webcam_photo_view.js +++ b/lms/static/js/verify_student/views/webcam_photo_view.js @@ -305,6 +305,11 @@ .toggleClass( 'is-disabled', !isEnabled ) .prop( 'disabled', !isEnabled ) .attr('aria-disabled', !isEnabled); + }, + + isMobileDevice: function() { + // Check whether user is using mobile device or not + return ( navigator.userAgent.match(/(Android|iPad|iPhone|iPod)/g) ? true : false ); } }); @@ -335,6 +340,16 @@ if ( view.isSupported() ) { return view; } + // If user is not using mobile device and Flash is not available + // then show user error message for Flash + if (!view.isMobileDevice() && !view.isSupported()) { + view.backend.trigger( + 'error', + gettext( "No Flash Detected" ), + gettext( "You don't seem to have Flash installed. Get Flash to continue your verification." ) + ); + return view; + } // Last resort is HTML file input with image capture. // This will work everywhere, and on iOS it will