Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sound option does not work in iOS devices #22

Open
nitrox007 opened this issue Sep 28, 2016 · 1 comment
Open

Sound option does not work in iOS devices #22

nitrox007 opened this issue Sep 28, 2016 · 1 comment

Comments

@nitrox007
Copy link

I have been working on replacing Google's reCaptcha with VisualCaptcha and during my testing, I noticed the sound option does not work in mobile safari in iOS. I did some googling and found some references about mobile safari needing a file extension in the tag being used in the accessibility section. I then tried streaming the sound data in a .php file in the tag and that didn't work either. I then tried to process an .mp3 file as php and stream the data from it, having where file.mp3 was a .php file streaming the actual .mp3 data, that works only if i hard-code the path of the actual .mp3 file in file.mp3. But when I concatenate the path to the .mp3 file from $_SESSION['visualcaptcha']['validAudioOption']['path'], it doesn't work. I have confirmed that the path is correct, and the file exists. I copied the resulting path from the session variable and hard-coded it to stream it, and it doesn't work.

Here's the code I've used for file.mp3:

`<?php
session_start();
error_reporting(E_ALL);
ini_set('display_errors', 1);

$audiofile = $_SESSION['path_to_file'];

$filepath1 = "path". $audiofile . ".mp3";

$filepath2 = 'path\filename.mp3';

$filename=$filepath;

if(file_exists($filename)) {
header('Content-Type: audio/mpeg');
header('Content-Disposition: inline; filename="'.$filepath.'"');
header('Content-length: '.filesize($filepath));
header('Cache-Control: no-cache');
header("Content-Transfer-Encoding: binary");

readfile($filepath);

} else {
header("HTTP/1.0 404 Not Found");
}
?>`

Here, $filepath1 fails, and $filepath2 works.

@BrunoBernardino
Copy link
Contributor

Hi @nitrox007 thank you so much for your report!

Is it possible to make a PR to https://github.com/emotionLoop/visualCaptcha-packagist to fix that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants