Hi,
I downloaded your excellent media player yesterday - it looks to be just what I'm looking for
However, I did have a problem with the XML playlist which was caching everytime. This was a particular problem as I was setting up the playlist at the same time as R'ing TFMso any changes I made weren't showing unless I cleared the browser cache.
After a little head scratching, I came up with a solution of sorts, which is to append a random string of characters to the playlist filename in the js as a query string, which seems to do the job.
Bizarrely, the first "random character string" javascript function I came across on google was also from this sitealthough I changed the end of it to return the value instead of writing it to document.
Code is as follows;
// I placed this below the main comment block at the top of the js file, before the variables are set
function randomString() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 8;
var randomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
}
return randomstring;
}
... then ...
playlist = "myplaylist.xml?foo="+randomString(); // Random query string to stop XML caching
... I would appreciate any thoughts on this as a suitable method, or there may well be simpler methods that I haven't considered...
Note to other users - I have only tested this on my setup, and it has not been peer-reviewed yet. Edit js files at your own risk!


so any changes I made weren't showing unless I cleared the browser cache.
Reply With Quote

Bookmarks