Secure streaming combined with bandwidth detection
URL resolver plugins can be chained together. This demo shows how to use the secure streaming and the bandwidth detection plugins together.
HTML coding
<!-- player container without splash -->
<a
href="bbb-400.mp4"
style="display:block;width:425px;height:300px;"
id="lighty">
</a>
<!-- info box -->
<div class="info box" id="info">
Resolved URL shown here
</div>
Flowplayer configuration
The list of URL resolvers is specified in the clip is shown below:
flowplayer("lighty", "http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf", {
// enable secure streaming plugin
plugins: {
secure: {
// path to latest version
url: 'flowplayer.securestreaming-3.2.3.swf',
// URL used to fetch a timestamp from the server
timestamp: '4f36ea02',
// identical to lighttpd.conf / secdownload.secret
token: 'simplek'
},
bwcheck: {
url: 'flowplayer.bwcheck-3.2.5.swf',
// a reference file used to calculate the bandwidth
netConnectionUrl: '/img/plugins-hero.jpg',
bitrates: [ 40, 150, 400, 700, 1000 ]
}
},
clip: {
bitrates: [
{ url: "bbb-1600.mp4", width: 1080, height: 608, bitrate: 1600 },
{ url: "bbb-1200.mp4", width: 720, height: 406, bitrate: 1200 },
{ url: "bbb-800.mp4", width: 480, height: 270, bitrate: 800 },
{ url: "bbb-400.mp4", width: 320, height: 180, bitrate: 400 }
],
// use secure and bwcheck plugins to resolve the URLs
urlResolvers: [ 'bwcheck', 'secure' ],
// this is required for secure URL generation
baseUrl: 'http://flashy2.flowplayer.org:81/secvideo/',
onStart: function(clip) {
document.getElementById("info").innerHTML = "Resolved URL: " + clip.url;
}
}
});
The bwcheck plugin is executed first. It resolves the URL and appends the bitrate to the video filename coming up with, for example, skyandice-700.flv. Next, the secure streaming plugin is used and it adds the secure path information to the clip's URL. In the above example we used the Lighttpd server's secure streaming module.
Take a look at a standalone version of this demo. View its source code to get things going on your own page.