Radcaptcha audio not working in Safari

13 posts, 0 answers
  1. Pradeep
    Pradeep avatar
    2 posts
    Member since:
    Nov 2011

    Posted 01 Nov 2011 Link to this post

    I am using .wav files to generate the audio. It works in all the popular browsers except Safari. I am using the latest version of safri and also have quicktime installed too but still it didn't work. Have anyone faced this issue earlier .  Can anyone help with this issue.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 02 Nov 2011 Link to this post

    Hello Pradeep,

    Take a look at the following forum thread.
    Captcha audio not working in MAC os.

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Pradeep
    Pradeep avatar
    2 posts
    Member since:
    Nov 2011

    Posted 07 Nov 2011 Link to this post

    Thanks for the reply Princy. But it not specific to MAC. even Windows version of Safari doesn't play the audio. I have to use the wav files to render the audio. According to the thread, since latest version of Safari supports html 5, it should be able to play those wav files but unfortunately I couldn't make it work.

    Should I have to do anything specific to Safari to make it work ?
  5. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 09 Nov 2011 Link to this post

    Hello Pradeep,

    Please ensure that you have properly installed the QuickTime plugin as it is required to play the .wav files of the RadCaptcha under the Safari browser.

    You can check if the problem is reproducible in the online demo Captcha Audio Code and if not, please send us a sample runnable page that isolates the problem so that we can inspect it locally and pinpoint the cause.

    Regards,
    Slav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  6. David
    David avatar
    2 posts
    Member since:
    Jun 2011

    Posted 23 Jan 2012 Link to this post

    test.
    sorry, it was a mistake.
  7. Paul D.
    Paul D. avatar
    7 posts
    Member since:
    Dec 2010

    Posted 26 Mar 2012 Link to this post

    I did enter a support ticket but...

    The Demo RadCaptcha page's audio won't play on an Iphone and apparently also an Ipad.
  8. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 27 Mar 2012 Link to this post

    Hi Paul,

    The iPhone and iPad use the same browser, mobile Safari. The RadCaptcha audio code cannot be played under mobile Safari, because the browser doesn't support <embed/> and the HTML5 <audio/> tags.
    You could force download of the audio file when the user clicks to play the audio, if the browser does not support these tags. This can be done with the following custom JavaScript code. Please paste it below your ScriptManager control on the page where the RadCaptcha resides:

    <script type="text/javascript">
        Telerik.Web.UI.RadCaptcha.prototype._createAudioElements = function ()
        {
            var audioUrl = this.get_audioUrl();
            var audioLink = this.get_audioLink();
      
            $addHandlers(audioLink, { "click": this.onAudioPlay }, this);
      
            var element = audioLink.parentNode;
            this._audioElement = this._createAudioElement(audioUrl);
            element.appendChild(this._audioElement);
      
            // Opera 10, Safari 4 and Firefox 3.5 support WAV, but Chrome 3 doesn't.
            // IE6,7 and 8 do not support <audio/>
            var doesNotSupportAudio = (!this._supportsAudio() || (this._audioElement && this._audioElement.canPlayType && !this._audioElement.canPlayType("audio/wav")));
            if (doesNotSupportAudio)
            {
                var _qtInstalled = IsQTInstalled();
                if (_qtInstalled)
                {
                    this._objectElement = this._createObjectElement(audioUrl);
                    element.appendChild(this._objectElement);
                }
                else
                {
                    this.downloadFile = true;
                }
            }
            else
            {
                audioLink.setAttribute('href', "#");
            }
        }
      
        Telerik.Web.UI.RadCaptcha.prototype.onAudioPlay = function (e)
        {
            if (this._objectElement)
            {
                this._objectElement.Play();
            }
            else if (this._audioElement && this._audioElement.play)
            {
                //Chrome supports <audio/>, but the audio is played only once. That's why we need
                //to load the audio file explicitly
                if ($telerik.isChrome)
                {
                    this._audioElement.load();
                }
                this._audioElement.play();
            }
      
            if (!this.downloadFile)
            {
                return $telerik.cancelRawEvent(e);
            }
        }
      
        function IsQTInstalled()
        {
            var isInstalled = false;
            var qtVersion = null;
            if (window.ActiveXObject)
            {
                var control = null;
                try
                {
                    control = new ActiveXObject('QuickTime.QuickTime');
                }
                catch (e)
                {
                    // Do nothing
                }
      
                if (control)
                {
                    // In case QuickTimeCheckObject.QuickTimeCheck does not exist
                    isInstalled = true;
                }
      
                try
                {
                    // This generates a user prompt in Internet Explorer 7
                    control = new ActiveXObject('QuickTimeCheckObject.QuickTimeCheck');
                }
                catch (e)
                {
                    return isInstalled;
                }
      
                if (control)
                {
                    // In case QuickTime.QuickTime does not exist
                    isInstalled = true;
      
                    // Get version
                    qtVersion = control.QuickTimeVersion.toString(16); // Convert to hex
                    qtVersion = qtVersion.substring(0, 1) + '.' + qtVersion.substring(1, 3);
                    qtVersion = parseFloat(qtVersion);
                }
            }
            else
            {
                // Check navigator.plugins for "QuickTime Plug-in"
                if (navigator.plugins)
                {
                    for (i = 0; i < navigator.plugins.length; i++)
                    {
                        if (navigator.plugins[i].name.indexOf("QuickTime") >= 0)
                        {
                            isInstalled = true;
                        }
                    }
                }
      
            }
            return isInstalled;
        }
    </script>


    All the best,
    Pero
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  9. John
    John avatar
    3 posts
    Member since:
    Jan 2015

    Posted 28 Jan 2015 in reply to Pero Link to this post

    Just checking to see if this is still the recommended solution for getting audio for the RadCaptcha control to work on mobile devices.

    Will this javascript solution be the best solution for all mobile platforms (eg. iPhone, Android, Windows, etc.)?

    Thanks in advance for your help.
  10. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 30 Jan 2015 Link to this post

    Hi John,

    We will add RadCaptcha audio iOS support with the upcoming release of UI for ASP.NET AJAX that is scheduled for the end of February, which should make it possible to use the audio functionality in the major mobile platforms.

    You can test the captcha audio earlier by downloading the Beta that will be released next week. If you still encounter difficulties, feel free to send a bug report that describes the issue and how it can be reproduced.

    Regards,
    Slav
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  11. John
    John avatar
    3 posts
    Member since:
    Jan 2015

    Posted 30 Jan 2015 in reply to Slav Link to this post

    Thanks Slav.  So, will the audio captcha functionality that is released in next week's beta release work on iOS, Android, and Windows phone platforms?

    Also, I'm wondering if you have any code examples of RadCaptcha working with kendo.  (i.e. using client-side code to do the server-side captcha verifcation using kendoUI).  Thanks in advance for your help!
  12. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 04 Feb 2015 Link to this post

    Hello John,

    Indeed, the audio functionality should be working in the Beta release as I mentioned in my previous post.

    As for the RadCaptcha validation, there is not an example with Kendo UI integration, nevertheless the captcha code cannot be validated on the client, which is what you are asking for if I understand you correctly.

    Regards,
    Slav
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  13. John
    John avatar
    3 posts
    Member since:
    Jan 2015

    Posted 05 Feb 2015 in reply to Slav Link to this post

    Thanks Slav - Let me ask the question this way:  Can you provide an example where the server-side captcha validation is done via an ajax call?  e.g. Is there a way CaptchaFile1.aspx can do an ajax call to CaptchaFile2.aspx which does the validation and sends back a Success or Fail result?
  14. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 10 Feb 2015 Link to this post

    Hi John,

    You could AJAX-enable the RadCaptcha control by placing it in an UpdatePanel. This way you can perform a validation of the captcha by triggering an asynchronous postback that updates only the part of the page that is wrapped in the UpdatePanel.

    I attached a sample page to demonstrate this so that you can check whether such an approach can be used in your project.

    Regards,
    Slav
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

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