本文整理匯總了PHP中KalturaLog::Info方法的典型用法代碼示例。如果您正苦於以下問題:PHP KalturaLog::Info方法的具體用法?PHP KalturaLog::Info怎麽用?PHP KalturaLog::Info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類KalturaLog
的用法示例。
在下文中一共展示了KalturaLog::Info方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: checkIsLive
public function checkIsLive($url)
{
KalturaLog::info('url to check:' . $url);
$parts = parse_url($url);
parse_str($parts['query'], $query);
$token = $query[$this->getParamName()];
$data = $this->urlExists($url, array($this->getHdsManifestContentType()));
if (!$data) {
KalturaLog::Info("URL [{$url}] returned no valid data. Exiting.");
return false;
}
KalturaLog::info('Velocix HDS manifest data:' . $data);
$dom = new KDOMDocument();
$dom->loadXML($data);
$element = $dom->getElementsByTagName('baseURL')->item(0);
if (!$element) {
KalturaLog::Info("No base url was given");
return false;
}
$baseUrl = $element->nodeValue;
foreach ($dom->getElementsByTagName('media') as $media) {
$href = $media->getAttribute('href');
$streamUrl = $baseUrl . $href;
$streamUrl .= $token ? '?' . $this->getParamName() . "={$token}" : '';
if ($this->urlExists($streamUrl, array(), '0-0') !== false) {
KalturaLog::info('is live:' . $streamUrl);
return true;
}
}
return false;
}
示例2: checkIsLive
public function checkIsLive($url)
{
$parts = parse_url($url);
parse_str($parts['query'], $query);
$token = $query[$this->getParamName()];
$data = $this->urlExists($url, kConf::get("hls_live_stream_content_type"));
if (!$data) {
KalturaLog::Info("URL [{$url}] returned no valid data. Exiting.");
return false;
}
KalturaLog::debug("url return data:[{$data}]");
$explodedLine = explode("\n", $data);
$flavorsChecked = 0;
if (strpos($data, '#EXT-X-STREAM-INF') !== false) {
//handle master manifest
foreach ($explodedLine as $streamUrl) {
$streamUrl = trim($streamUrl);
if (!$streamUrl || $streamUrl[0] == '#') {
continue;
}
if ($flavorsChecked == self::MAX_FLAVORS_TO_CHECK) {
break;
}
$manifestUrl = $this->checkIfValidUrl($streamUrl, $url);
$manifestUrl .= $token ? '?' . $this->getParamName() . "={$token}" : '';
$data = $this->urlExists($manifestUrl, kConf::get("hls_live_stream_content_type"));
if (!$data) {
continue;
}
//handle flavor manifest
if ($this->checkSegments($data, $token, $manifestUrl)) {
return true;
}
++$flavorsChecked;
}
} else {
if (strpos($data, '#EXTINF') !== false) {
//handle flavor manifest
return $this->checkSegments($data, $token, $url);
}
}
return false;
}