RadCaptcha audio on chrome

5 posts, 0 answers
  1. santosh
    santosh avatar
    2 posts
    Member since:
    Apr 2011

    Posted 24 Apr 2011 Link to this post

    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>
  2. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 25 Apr 2011 Link to this post

    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. santosh
    santosh avatar
    2 posts
    Member since:
    Apr 2011

    Posted 26 Apr 2011 Link to this post


    Great!!!!  it worked for me. 

    Thank You. I appreciate your help.

  5. Tigran
    Tigran avatar
    4 posts
    Member since:
    Jan 2011

    Posted 21 Jun 2011 Link to this post

    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
  6. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 22 Jun 2011 Link to this post

    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.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017