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