Skip to content

Commit

Permalink
adding hds to valid protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
sebest committed Sep 12, 2012
1 parent 0d1aeaa commit e613975
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions CloudKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,21 @@ public function get_embed_url($args)
return CloudKey_Helpers::sign_url($url, $this->api_key, $seclevel, $asnum, $ip, $useragent, $countries, $referers, $expires);
}

public function get_swf_url($args)
{
$id = null;
$seclevel = CLOUDKEY_SECLEVEL_NONE;
$expires = null;
$asnum = null;
$ip = null;
$useragent = null;
$countries = null;
$referers = null;
extract($args);
$url = sprintf('%s/player/swf/%s/%s', $this->base_url, $this->user_id, $id);
return CloudKey_Helpers::sign_url($url, $this->api_key, $seclevel, $asnum, $ip, $useragent, $countries, $referers, $expires);
}

public function get_stream_url($args)
{
$id = null;
Expand All @@ -89,7 +104,7 @@ public function get_stream_url($args)
$filename = '';
$protocol = null;
extract($args);
if (!in_array($protocol, array(null, "hls", "rtmp", "hps", "http"))) {
if (!in_array($protocol, array(null, "hls", "rtmp", "hps", "http", "hds", "ss"))) {
throw new CloudKey_InvalidMethodException(sprintf('%s is not a valid streaming protocol', $protocol));
}
if ($extension == '')
Expand All @@ -103,7 +118,7 @@ public function get_stream_url($args)
}
if (strncmp('jpeg_thumbnail_', $asset_name, 15) == 0)
{
return sprintf('http://static.dmcloud.net/%s/%s/%s%s.%s', $this->user_id, $id, $asset_name, $version, $extension);
return sprintf('http://static.dmcloud.net/%s/%s/%s%s.%s', $this->user_id, $id, $asset_name, $version, $extension);
}
else
{
Expand Down

0 comments on commit e613975

Please sign in to comment.