Patch for HD plugin for JW Player
If you are using JW Player and the HD plugin, you’ll notice the latest version of the plugin does bandwidth detection and automatically flips to the HD version of the file if the player has detected the user’s bandwidth can support it.
This is undesirable for a bunch of different reasons. Here’s a patch to solve the problem, while still keeping that functionality should you need it.
You can grab the patched version from my github repo:
git clone git://github.com/jawngee/JW-Player-HD-Plugin.git
Drop the hd.swf in with your player and you can load it like so:
<div id="video" class="player">
<p>Please <a href="http://get.adobe.com/flashplayer/" target="_blank">Upgrade your Flash Player</a> to view this content</p>
</div>
<script type="text/javascript">
var s1 = new SWFObject("/swf/jw/player.swf","ply","640","480","9","#000000");
s1.addParam("allowfullscreen","true");
s1.addParam("allowscriptaccess","always");
s1.addVariable("plugins","/swf/jw/hd.swf");
s1.addVariable("hd.state",false);
s1.addVariable("hd.autoswitch",false);
s1.addVariable("hd.bandwidth",3200);
s1.addVariable("hd.file","http://video.com/hd.flv");
s1.addVariable("file","http://video.com/flv.flv");
s1.write("video");
</script>
This patch adds two new config options:
hd.autoswitch – true/false, determines if the hd plugin should switch based on user’s bandwidth, default is true.
hd.bandwidth – The bandwidth threshold for performing the switch, default is 1500.
Enjoy.
