Follow-up to #3056: Audio Captcha is not rendered in IE8
authorstan <stan@735d13b6-9817-0410-8766-e36946ffe9aa>
Fri, 28 Aug 2009 15:32:30 +0000 (15:32 +0000)
committerstan <stan@735d13b6-9817-0410-8766-e36946ffe9aa>
Fri, 28 Aug 2009 15:32:30 +0000 (15:32 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/sr_freecap/trunk@23751 735d13b6-9817-0410-8766-e36946ffe9aa

ChangeLog
pi2/freeCap.js

index 767bfce..0df8360 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-08-29  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Follow-up to #3056: Audio Captcha is not rendered in IE8
+
 2009-06-03  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #3056: Audio Captcha is not rendered in IE8
index 7b51dfe..e92f728 100644 (file)
@@ -71,7 +71,7 @@ function playCaptcha(id, wavURL, noPlayMessage) {
                        theAudio.removeChild(theAudio.firstChild);
                }
                var objectElement = document.createElement("object");
-               objectElement.setAttribute("id", "audio/x-wav");
+               objectElement.setAttribute("id", "tx_srfreecap_pi2_captcha_playAudio_object"+id);
                objectElement.setAttribute("type", "audio/x-wav");
                objectElement.setAttribute("data", wavURLForOpera);
                objectElement.setAttribute("height", 0);
@@ -84,7 +84,7 @@ function playCaptcha(id, wavURL, noPlayMessage) {
                }
                theAudio.appendChild(objectElement);
                        // IE8 needs a delay before the param children are appended...
-               window.setTimeout("addAudioCaptchaParams(" + id + ");", 50);
+               window.setTimeout("addAudioCaptchaParams('" + id + "');", 50);
        } else {
                alert(noPlayMessage ? noPlayMessage : "Sorry, we cannot play the word of the image.");
        }
@@ -93,10 +93,11 @@ function playCaptcha(id, wavURL, noPlayMessage) {
 function addAudioCaptchaParams(id) {
        var theAudio = document.getElementById("tx_srfreecap_pi2_captcha_playAudio_"+id);
        var objectElement = theAudio.firstChild;
+       var url = objectElement.getAttribute("data");
        var parameters = {
                "type"          : "audio/x-wav",
-               "filename"      : wavURLForOpera,
-               "src"           : wavURLForOpera,
+               "filename"      : url,
+               "src"           : url,
                "autoplay"      : true,
                "autoStart"     : 1,
                "hidden"        : true,