• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 744
  • Last Modified:

Using the JWplayer - Load an xml file with a random cache number?

Hi Guys,
This is for people with experience using the JWplayer.

I am having trouble with the jwplayer saving the xml playlist into the cache, so in another flash project I am fixing this by loading the xml file like this in actionscript
xml.load("file_name.xml?nocache="random(9999));

How could I use similar coding in html for the jwplayer. So that it adds the nocache query.

I have heard that a no-cache header could be an option, Can you explain how to add that for me, I figure it is javascript but I am wrong quite a bit. haha.
I really appreciate the help.

Thanks,
Randy
0
CREATiVENESS
Asked:
CREATiVENESS
  • 2
1 Solution
 
dgofmanCommented:
You can build URL using JavaScript timestamp

Check my example bellow, "Arnoldi.mp4" file will NEVER cached

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Streaming Trial</title>
<script type="text/javascript" src="http://biostrial.s3.amazonaws.com/jwplayer/swfobject.js"></script>
</head>
<body>
<p>Arnoldi</p>

<div id='container'>The player will be placed here</div>

<script type="text/javascript">
var so = new SWFObject('http://biostrial.s3.amazonaws.com/jwplayer/player.swf','jwplayer','480','270','9.0.115');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('flashvars','file=Arnoldi.mp4?' + new Date().getTime() + '&streamer=rtmp://s2y98ylrybvg3y.cloudfront.net/cfx/st');
so.write('container');
</script>
</body>
</html>
0
 
CREATiVENESSAuthor Commented:
Perfect. Thanks DG.
0
 
CREATiVENESSAuthor Commented:
Perfect
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now