When viewing the slideshow I noticed how fast the images load. So I assume they get preloaded. But how many? I want to limit the number of images preloaded to avoid unnecessary datatransfer/exceeding bandwith (how do you call that in english?). I have a few albums that contain almost 200 images, and if someone pauses at the first image I don't want the other 199 to be preloaded
.
Comments
http://www.malsup.com/jquery/cycle/
I might be possible to add a limit of preloading somehow, but I currently don't know how. I am far from being a jQuery/JS expert. If you have any idea that would be welcome.
I suggest you use the flash mode with that many images, because the flowplayer only preloads the next image.
I will sent the writer of this jQuery Cycle Plugin an email. Perhaps he can help. I don't want to change the slideshow just when it is working just the way I want it .
But perhaps you can point me to a gallery that has this flash mode working? I know this flowplayer exists, but have no idea how to make it work besides activating the plugin...
To the flash mode: You just need to activate the flowplayer plugin and choose "flash" in the slideshow options. That's all besides that you of course need flash installed..:-)
Also it seems that the flowplayer is available in a dark and light version, but how do I get the lightversion to work? In flowplayer.php I can only see the lightversion, but this is not what is showing up after switching from jquery to flash mode. Also no option inside the 'plugin options' page.
And last but not least, if you like soccer, have fun tomorrow with the match between your Germany and Spain! ...
Thanks, actually I am not a big soccer fan, but of course I will watch that match...:-)
If you succeed in limiting the preloads, this will be of less importance because then only about 2 to 8 number of images will be downloaded first.
Click slideshow to download about 200 images
But regarding the control images, I couldn't see that, they were immediatly there for me, at least with Safari.
I'm using Firefox myself (latest version of the 2.xxx branch for Ubuntu), but decided to test it in IE 6 after what you said about the control images in Safari, and in IE the images are immediately there... So it has something to do with Firefox then...
I hope/guess this will be solved automatically when the option to set maximum preloads is ready.
Update: Does not work, but I have to admit my js knowledge is a little limited.... Are you by chance a JS expert? Then you could take a look at the "Add slides..." examples here http://www.malsup.com/jquery/cycle/more.html. Maybe you have an idea how we could do that..
The only clumsy thing I can think of is when looking at the third example concerning 'Add slides'.
It says:
`for (var i = 3; i < 9; i++) { ... `
In my very limited way of thinking my mind came up with something like this:
`for (var i = ($currentimage-2); i < ($currentimage+2); i++) { ... `
I always wished my mind would have more feeling with code than it does, but it hasn't I'm afraid...
Any luck yet on that 'limiting preloaded images'?
Acrylian, could you post a quick reply here when this solution is in the nightly? Or what the changes are and perhaps which files need to be replaced?
The only thing that took me a little work (just a little ), is that at first I couldn't get the filename/title beneath the images instead of above.
At first I did it by moving
`echo "
".$image->getTitle()." (".$count."/".$numberofimages.")
";`to the end of the if/else statements (movie or mp3 or image) like I did in the 'old' slideshow.php file. This resulted in a correct presentation of that filename for two slides, but with the third slide this filename moved to a position above the image. This is because from then on this title/filename is created somewhat differently ('htmlblock +=' etc.), so I had to change it there to.
Thanks dpeterson and acrylian! This will limit the data transfer immensily for large albums .
We used setInterval to call a function iteratively every 1 second to check if all the images have loaded (note: startingSlide attribute is required to restart cycle after it has been stopped):
var vCycleImages = setInterval("setImgCycleStatus()", 1000);
$(function() {
$('#fadeCenter').cycle();
$('#fadeCenter').cycle('stop');
});
function setImgCycleStatus() {
if ($.preloadImages("pic1", "pic2", "pic3", "pic4")){
$('#fadeCenter').cycle({
speed: 500,
timeout: 8000,
delay: -5000,
startingSlide: 0
});
clearInterval(vCycleImages);
}
}
jQuery.preloadImages = function() {
var bImgLoaded = true;
for(var i = 0; i < arguments.length; i++){
if (document.getElementById(arguments[i]).complete == false) {
bImgLoaded = false;
}
}
return bImgLoaded;
}
Hope this helps.
Samir Pipalia
Pipalia Software House
http://www.pipalia.co.uk