News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

Main Menu
Support-Forum

downloadsite needs too long for loading [not jD]

Started by juribabarov, 06.03.2016 22:45:21

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

juribabarov

Hello,

i have multiple download categories and they all works fine.
However, one of them, with only 7 entries per page needs too long for loading. It's about mp3 audio files with the html5 audio player. In other categories it works how it should.

This category with 4 downloads needs ~0.45sec
http://efg-coesfeld.de/medien/downloads/category/3-vortrag

This category with 7 downloads per page needs ~30sec
http://efg-coesfeld.de/medien/downloads/category/2-predigt-gottesdienst

I already reduced the number of items. But always the last audio files won't load fast and i have to wait for some time. Downloading the files while the site is loading works well.

The audio files works also. Does the audio player make trouble or is it some adjustments in jdownloads configuration?

Thanks
  •  

ColinM

Hi
I tried both links and both take the same amount of time, certainly less than a second.  I cleared the browsers cache and repeated - still very fast.
So I do not think this is a jD problem.

I had used Firefox so I thought to try other browsers.  Microsoft Edge was fine, maybe a fraction slower.  Chrome also appeared to load at same speed but was then 'busy' for some time.  I could not change the page with Chrome as something was going on.  Repeated several times. Then I cleared Chromes cache and suddenly it was as fast as the others! Stange!!
But not jD.

Colin
Colin M
  •  

juribabarov

Thanks for the reply and testing.

Now I also tried Firefox and IE and it works fine with them. Only Chrome makes some trouble.
So it really has to do with something else.

Anyway thanks for checking.
  •  

ColinM

Hi
I have done a bit more research on the web.  A good reference seems to be
http://stackoverflow.com/questions/17004658/chrome-only-loading-6-html5-audio-tags
which matches your problem.

The problem seems to be the attempt by Chrome to simultaneously preload. The solution would perhaps be to use <audio controls preload="none">
Presently jD has <audio controls="">

This code is generated in jdownloadshelper.php around line 720 which currently reads:
$player = '<'.$playertype.' style="width: 100%;" '.'controls>';
If you change this to
$player = '<'.$playertype.' preload="none" style="width: 100%;" '.'controls>';
Then that should make Chrome better.  If you could try that, if possible, and let us know if it works!
Please note this area of code is actively being worked on for responsive behaviour.

Colin
Colin M
  •  

juribabarov

Hi Colin,

thanks for the tip.
I tried to change the setting in preload="none" and had to clear joomlas cache. It worked :)

Now nothing preloads and the time of the mp3 file isn't displayed. I changed the option to preload="metadata". Now chrome doesn't preload the files as the other browsers but shows the time of the mp3 file.

In the code:
if ($playertype == 'video'){
            $player = '<'.$playertype.' style="width: 100%;" '.'controls preload="metadata">';
        } else {
            $player = '<'.$playertype.' style="width:'.(int)$jlistConfig['html5player.audio.width'].'px; "'.' controls preload="metadata">';
        }

therefore my problem is solved.  Thanks for the support!

juri
  •  

ColinM

Hi
In the next release of jD (v42) the browser type in use is checked and if it is Chrome it will generate preload="metadata"
Colin
Colin M
  •  

juribabarov

Hello, me again :)

today I updated my site and noticed the same problem as last time.
In the file "jdownloadshelper.php" the code was changed only for the video-player.

if ($playertype == 'video'){
            $browser = self::getBrowser();
            if ($browser['name'] == 'Chrome'){ 
                // special handling for chrome browsers
                $player = '<'.$playertype.' preload="metadata" style="width: 100%;" '.'controls>';
            } else {    
                $player = '<'.$playertype.' style="width: 100%;" '.'controls>';
            }
        } else {
            $player = '<'.$playertype.' style="" '.'controls>';
        }


I added preload="metadata" also to the mp3-player:

if ($playertype == 'video'){
            $browser = self::getBrowser();
            if ($browser['name'] == 'Chrome'){ 
                // special handling for chrome browsers
                $player = '<'.$playertype.' preload="metadata" style="width: 100%;" '.'controls>';
            } else {    
                $player = '<'.$playertype.' style="width: 100%;" '.'controls>';
            }
        } else {
            $player = '<'.$playertype.' preload="metadata" style="" '.'controls>';
        }

Now all works again, also in chrome.
Maybe this could be added in a future patch.
  •  

Arno

Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •