Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

After clicking on download button audio file stop playing

I have a download button which is created with php custom simple script. After testing that code i noticed that when i click to download button audio file stopped playing. Here is the link where you can see that

Please help me to understand why.

Thanks in advance.

3 Community Answers


0 rated :

Are you running some Javascript that interacts with the player when downloading? Our basic download demo does not have that issue:


0 rated :

No javascript. It is simple PHP.I could even post the code.

$filename = $_GET['file'];
if (isset($filename))
// Prevents someone from trying to access something that is not in the same directory as this script
if(substr_count($filename,"/") > 0)
$len = filesize($filename);
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: public');
header('Content-Description: File Transfer');
header('Content-Type: application/force-download');
header('Content-Disposition: attachment; filename='.$filename);
header('Content-Transfer-Encoding: binary');
header('Content-Length: '.$len);
die('No file specified.');

In Jwplyer download example that you sent it did not download immediately it just goes to the link and from the user point user should made some other clicks for downloading the file. That is not userfrindly.

Something is wrong as when am clicking on download audio file stopped playing. You have the link so you can check please.

Please help me asap, it is very urgent!

Thanks in advance.


JW Player Support Agent  
0 rated :

Hi, Anahit.

When I click on the Download button below the player on your page, the playback does not stop for me. Are you still experiencing this issue?

Please let me know if you need any more help or have any other questions.

Thank you!

This question has received the maximum number of answers.