本文整理汇总了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;
}