I am trying to develop a module to use JWPlayer's URL Toekn Signing (docs can be found here http://developer.jwplayer.com/jw-platform/reference/v1/content_signing.html) but I'm having an issue with the output.
I am using the following fields in the module's XML:
<field name="key" type="text" label="API Key" default="key" description="API Key" />
<field name="secret" type="text" label="API Secret" default="secret" description="API Secret" />
<field name="expires" type="text" label="Expires" default="Expires" description="Expires" />
<field name="mediaid" type="text" label="Media ID" default="Media ID" description="Media ID" />
<field name="domain" type="text" label="DNS Masking" default="Domain" description="Domain" />
These variables output correctly via PHP. However, when I'm building the URL using Javascript, it's failing.
I have written the following for the modules default.php
$key = $params->get('key');
$secret = $params->get('secret');
$domain = $params->get('domain');
$mediaid = $params->get('mediaid');
$expires = $params->get('expires');
function get_signed_player($key,$mediaid,$domain,$secret,$expires) {
$path = "players/".$key."-".$mediaid.".js";
$signature = md5($path.':'.$expires.':'.$secret);
$url = 'http://'.$domain.'/'.$path.'?exp='.$expires.'&sig='.$signature;
return $url;
};
echo "<p>Watch this cool video:</p>"
echo "<script type='text/javascript' src='".get_signed_player($key,'ALJ3XQCI')."'></script>";
?>
Any ideas where I'm going wrong?
;
(semi-colon) after the firstecho
. Also, you don't need a;
after your function's closing bracket