Secure Token Plugin with PHP

You might read our old article on how-to-prevent-downloading-and-leeching-media-files

You can review below code to secure your media files to be downloaded other then media players 😉

Creating a Secure Token SWF for JW Player

Secure Token have time limit after that token expire to get media files.

var timestamp = +new Date();

flowplayer("player", "", {
plugins: {
    secure: {
        url: 'player/flowplayer.securestreaming-3.2.3.swf',

        timestamp: timestamp,

        token: '69964920064c0a7626e6c97997070fcd'

clip: {
    autoPlay: false,
    autoBuffering: true,
    duration: 30,
    urlResolvers: 'secure',
    baseUrl: ''
// Get the file from the server
function get_file(){
header('Content-Description: File Transfer');
header('Content-type: video/mp4');
header("Content-length: ".filesize($streamname));
header("Expires: 0");
header("Content-Transfer-Encoding: binary");
// Return secret to flowplayer for use
function get_secret(){

Published by

Sandeep Verma

I’m an Entrepreneur. I’m proud to work as Blogger, LAMP Programmer, Linux Admin, Web Consultant, Cloud Manager, Apps Developer, Searcher. Concentrate > Observe > Imagine > Launch