-
Notifications
You must be signed in to change notification settings - Fork 60
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
Preload audio #2
Comments
Thanks @steinhot , yeah preloading the sounds is my next step, I'll try to update it this weekend and hopefully I'll get it right. |
I'm sorry but I don't get the image, are you saying that the load time is On Mon, Feb 1, 2016 at 4:36 PM, Oxicode [email protected] wrote:
|
206 means that you are just checking e-tags where the assets are already cached locally on your machine. Clear your cached assets and try again and the asset will not begin downloading until you do the hover. To provide the best user experience, the assets should begin downloading the moment the page is rendered so that by the time the user gets to click on the button or does the hover, all it has to do is start playing. Certainly if someone was using this library to “audition” a list of sounds you would only want to download them on demand, but for “accent” sounds, I would want them without lag. Best, Thom From: Mahdi Al-Farra I'm sorry but I don't get the image, are you saying that the load time is On Mon, Feb 1, 2016 at 4:36 PM, Oxicode <[email protected]mailto:[email protected]> wrote:
— |
Oh, thanks a lot for explaining this to me Thom. I'm sorry, I'm still learning all these things, I'm new to Javascript and to all these things including Git. I hope I get sometime this week to work on adding the option to preload sounds. Thanks again Thom & Christian for the feedback, I appreciate it. |
The first method off the top of my head to preload audio would be on initialization to create an element for each sound, set the sources, add the preload attribute, then link all the events for that source to that audio element. That way the browser has a chance to preload all the audio files before triggered. Some rough pseudo code: var elements = {}; for (i = 0; i < hoverLength; i++) { } |
Interesting and useful in the right situation, however, it would be good to preload the audio on page load rather than on trigger. Haven't tried it, but may be possible to load a new player for each instance of the audio on the page? Or Only do it if you have a preload="true" attribute on it?
Without preload, the hover and the click just lag too much to be useful.
Thanks for making this!
The text was updated successfully, but these errors were encountered: