本文整理匯總了PHP中Playlist::playlistTimeToSeconds方法的典型用法代碼示例。如果您正苦於以下問題:PHP Playlist::playlistTimeToSeconds方法的具體用法?PHP Playlist::playlistTimeToSeconds怎麽用?PHP Playlist::playlistTimeToSeconds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Playlist
的用法示例。
在下文中一共展示了Playlist::playlistTimeToSeconds方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: findPlaylistsAction
public function findPlaylistsAction()
{
$post = $this->getRequest()->getPost();
$show = new ShowInstance($this->sched_sess->showInstanceId);
$playlists = $show->searchPlaylistsForShow($post);
foreach ($playlists['aaData'] as &$data) {
// calling two functions to format time to 1 decimal place
$sec = Playlist::playlistTimeToSeconds($data[4]);
$data[4] = Playlist::secondsToPlaylistTime($sec);
}
//for datatables
die(json_encode($playlists));
}
示例2: OutputToM3u
public static function OutputToM3u(&$pl, $ple, $ind = '')
{
$acOrPl = NULL;
foreach ($ple['children'] as $ac) {
switch ($ac['elementname']) {
case "audioClip":
$r = PlaylistAudioClipExport::OutputToM3u($pl, $ac);
if (PEAR::isError($r)) {
return $r;
}
if (!is_null($r)) {
$acOrPl = $r;
}
break;
case "playlist":
$gunid = $ac['attrs']['id'];
$pl2 = StoredFile::RecallByGunid($gunid);
if (is_null($pl2) || PEAR::isError($pl2)) {
return $pl2;
}
$r = $pl2->outputToM3u(FALSE);
if (PEAR::isError($r)) {
return $r;
}
if (!is_null($r)) {
$acOrPl = $r;
}
break;
}
}
if (is_null($acOrPl)) {
return '';
}
$playlength = ceil(Playlist::playlistTimeToSeconds($acOrPl['playlength']));
$title = $acOrPl['title'];
$uri = isset($acOrPl['uri']) ? $acOrPl['uri'] : '???';
$res = "#EXTINF: {$playlength}, {$title}\n";
$res .= "{$uri}\n";
return $res;
}
示例3: contentsAction
public function contentsAction()
{
$post = $this->getRequest()->getPost();
$datatables = StoredFile::searchFilesForPlaylistBuilder($post);
//format clip lengh to 1 decimal
foreach ($datatables["aaData"] as &$data) {
$sec = Playlist::playlistTimeToSeconds($data[5]);
$data[5] = Playlist::secondsToPlaylistTime($sec);
}
die(json_encode($datatables));
}