Hello everybody.
I know Wowza Streaming Engine supports token protection for each VOD application. Though I need to protect each groups of files (maybe in subfolders) of the same VOD application with its own different token. Is there a way to achieve this on Wowza, maybe with some existing module, or do I have to write my own module?
Hi,
If using Secure Token (v2) then the hash includes the stream name, e.g.the file sample.mp4 played back in the ‘vod’ application
[PHP]
$stream = “vod/definst/mp4:sample.mp4”;
$start = time();
$end = strtotime("+30 minutes");
$secret = “abcde”;
$tokenName = “wowzatoken”;
[/PHP]
Hash calculation made by playback client:
[PHP]
$hash = hash(‘sha384’, $stream."?".$secret."&{$tokenName}endtime=".$end."&{$tokenName}starttime=".$start, true);
[/PHP]
So the hash should be unique for each stream. You would just need to amend the $stream value for each stream you request. If your files are in sub-folders under the defined storage dir then that can be included in the $stream, e.g.
$stream = "vod/myfolder/mp4:sample.mp4";
We have a sample PHP script that can be used as a basis for calculating and optionally playing embedding a player for secure token streams. Feel free to request it if required.
Paul