audiojs icon indicating copy to clipboard operation
audiojs copied to clipboard

Music loading takes too long in chrome

Open eantz opened this issue 11 years ago • 8 comments

Everything is just fine but the music load too long in chrome. It seems that the player doesn't want play the music while buffering..

I try in firefox and it play smoothly while buffering..

Thanks in advanced.

sorry for my bad english. I hope you understand.

eantz avatar Feb 09 '13 06:02 eantz

I have this problem too, can't figure it out, and I don't want to switch players. Chrome 24.0.1312.57 on OS X 10.8.2.

Any luck on this @eantz?

aguynamedben avatar Mar 14 '13 05:03 aguynamedben

I solved it with something like this :

var a = audiojs.createAll(); var audio = a[0]; first = $('div#music').attr('data-src'); audio.load(first);

I think this happen only in new update of Chrome. Because it used to be just fine before the update.

I hope this can help you.

eantz avatar Mar 14 '13 07:03 eantz

@eantz would it be possible for you to share where you inserted this in the code? Thanks!

heustis101 avatar Mar 20 '13 20:03 heustis101

Okay.. here is the code :

<div id="music" data-src="<?php echo base_url() . 'uploads/audios/' . $song->file; ?>">
    <audio autoplay></audio>
</div>

<script type="text/javascript" src="path/to/jquery.js"></script>
<script type="text/javascript" src="path/to/audio.js"></script>

<script type="text/javascript">
    $(function() {
        var a = audiojs.createAll();
        var audio = a[0];
        first = $('div#music').attr('data-src');
        audio.load(first);
    });
</script>

I insert this code within the body tag.

I hope it can help you

eantz avatar Mar 21 '13 08:03 eantz

This doesn't work for me.

joshkrz avatar Feb 13 '14 22:02 joshkrz

This doesn't work for me either.

What's interesting is that if you open Chrome Dev Tools then the audio file is loaded right away and you can play it. This is repeatable.

If you open the page without Chrome Dev Tools and then open the tools then again the file loads right away. If you then close Chrome Dev Tools and then reload, the audio file loads right away.

In any event, this still is not resolved.

joshuaiz avatar Sep 14 '14 17:09 joshuaiz

Hi guys,

FYI, the snippet that I posted for more than a year ago still working in one of my client's site. Actually I don't handle that site anymore, but as far as I know the site is still working without any complaint, at least until this time.

I have no clue if the snippet doesn't solve your problem, sorry.

But, since this script is not under active development, I suggest you to pick other library like mediaelement or jplayer if you just starting your project. You may get better response there when you face any problem like this.

eantz avatar Sep 15 '14 01:09 eantz

Thanks for the reply - while I use the mp3jPlayer WordPress plugin (based on jPlayer) for most of my site's audio players, I'm using audio.js for a single player on one page because it is really light and easier to style.

I can confirm that this issue does not exist in Chrome Canary and seems to be intermittent in Chrome (37.0.2062.120 Mac OSX). Hopefully it will be fixed in a later update of Chrome.

joshuaiz avatar Sep 15 '14 18:09 joshuaiz