This is a migrated thread and some comments may be shown as answers.

RadCaptcha audio on chrome

4 Answers 120 Views
Captcha
This is a migrated thread and some comments may be shown as answers.
santosh
Top achievements
Rank 1
santosh asked on 24 Apr 2011, 03:25 PM
Hello Everyone,

We are using radcaptcha for validating purpose. I have come across a weird problem with audio link button of captcha control. 

Audio link button working fine on IE and firefox, but we are not able to play the ImageText multiple time on chrome. It works for the first click, but if we click multiple times on audio link button, its not playing Image Text.

I  might need to enable some property for captcha control that i am not aware of.  

Does any one have any suggestions??


<telerik:RadCaptcha ID="radCaptcha" Runat="server" EnableRefreshImage="true" CaptchaImage-EnableCaptchaAudio="true" CaptchaImage-UseAudioFiles="true" ErrorMessage="You have entered an invalid code." ValidationGroup="Summary"  forecolor="#660000" Display="Dynamic" CaptchaLinkButtonText="Generate New Image<br/>" EnableEmbeddedScripts="True" EnableViewState="True" CaptchaImage-AudioFilesPath="~/App_Data/RadCaptcha" ImageStorageLocation="Cache" ViewStateMode="Enabled">
                    </telerik:RadCaptcha>

4 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 25 Apr 2011, 03:52 PM
Hi Santosh,

I am aware of this problem and it will be fixed in the next version.

The problem seems to be caused by the way the browser plays the audio file of the <audio/> tag. Once Chrome plays the audio track, the current time is not moved at the start of the audio file, but it stays at the end. That's why when we try to play the audio once more, it is not played.

After extensively testing and trying different things with the <audio/> DOM object in Chrome, I found a way of making the audio file play more than once. Here is the JS code. Place it below the ScriptManager of the page where the RadCapthca resides, and see if it will work:

<script type="text/javascript">
    Telerik.Web.UI.RadCaptcha.prototype.onAudioPlay = function(e)
    {
        if(this._objectElement)
        {
            this._objectElement.Play();
        }
        elseif(this._audioElement && this._audioElement.play)
        {
            if($telerik.isChrome)
            {
                this._audioElement.load();
            }
            this._audioElement.play();
        }
        return $telerik.cancelRawEvent(e);
    
</script>

Let me know if you still experience problems.



Kind regards,
Rumen
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
santosh
Top achievements
Rank 1
answered on 26 Apr 2011, 12:14 PM

Great!!!!  it worked for me. 

Thank You. I appreciate your help.

0
Tigran
Top achievements
Rank 1
answered on 21 Jun 2011, 08:22 PM
Any idea why captcha audio would not work in IE7?

It works fine in our other browsers but not in IE7. We even tried the Telerik demo site and still no joy.

Thanks
0
Pero
Telerik team
answered on 22 Jun 2011, 04:01 PM
Hi Tigran,

The RadCaptcha plays the audio code using the HTML5 <audio/> tag. If the browser does not support such tag, then it plays it using an <embed/> tag that requires QuickTime plugin required. IE7 does not support <audio/> tag so please make sure you have installed the QuickTime plugin.

Kind regards,
Pero
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Captcha
Asked by
santosh
Top achievements
Rank 1
Answers by
Rumen
Telerik team
santosh
Top achievements
Rank 1
Tigran
Top achievements
Rank 1
Pero
Telerik team
Share this question
or