本文整理汇总了PHP中Playlist::secondsToPlaylistTime方法的典型用法代码示例。如果您正苦于以下问题:PHP Playlist::secondsToPlaylistTime方法的具体用法?PHP Playlist::secondsToPlaylistTime怎么用?PHP Playlist::secondsToPlaylistTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Playlist
的用法示例。
在下文中一共展示了Playlist::secondsToPlaylistTime方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLength
public function getLength()
{
$res = CcPlaylistQuery::create()->findPK($this->id)->computeLength();
if (is_null($res)) {
return '00:00:00';
}
// calling two functions to format time to 1 decimal place
$sec = Playlist::playlistTimeToSeconds($res);
$res = Playlist::secondsToPlaylistTime($sec);
return $res;
}
示例2: convert2lspl
public static function convert2lspl(&$gb, &$tree, &$gunids, $parr, $ind = '')
{
extract($parr);
$uri = $tree->attrs['src']->val;
$gunid = isset($gunids[basename($uri)]) ? $gunids[basename($uri)] : NULL;
$ind2 = $ind . INDCH;
if ($tree->name != 'audio') {
return PEAR::raiseError("SmilPlaylist::parse: audio tag expected");
}
if (isset($tree->children[2])) {
return PEAR::raiseError(sprintf("SmilPlaylist::parse: unexpected tag %s in tag audio", $tree->children[2]->name));
}
$res = '';
$fadeIn = 0;
$fadeOut = 0;
foreach ($tree->children as $i => $ch) {
$ch =& $tree->children[$i];
$r = SmilPlaylistAnimateElement::convert2lspl($gb, $ch, &$gunids, $parr, $ind2);
if (PEAR::isError($r)) {
return $r;
}
switch ($r['type']) {
case "fadeIn":
$fadeIn = $r['val'];
break;
case "fadeOut":
$fadeOut = $r['val'];
break;
}
}
if ($fadeIn > 0 || $fadeOut > 0) {
$fiGunid = StoredFile::CreateGunid();
$fadeIn = Playlist::secondsToPlaylistTime($fadeIn);
$fadeOut = Playlist::secondsToPlaylistTime($fadeOut);
$fInfo = "{$ind2}<fadeInfo id=\"{$fiGunid}\" fadeIn=\"{$fadeIn}\" fadeOut=\"{$fadeOut}\"/>\n";
} else {
$fInfo = '';
}
$plElGunid = StoredFile::CreateGunid();
$acGunid = $gunid;
$type = 'audioClip';
if (preg_match("|\\.([a-zA-Z0-9]+)\$|", $uri, $va)) {
switch (strtolower($ext = $va[1])) {
case "lspl":
case "xml":
case "smil":
case "m3u":
$type = 'playlist';
$acId = $gb->bsImportPlaylistRaw($gunid, $aPath, $uri, $ext, $gunids, $subjid);
if (PEAR::isError($acId)) {
return $r;
}
//break;
//break;
default:
$ac = StoredFile::RecallByGunid($gunid);
if (is_null($ac) || PEAR::isError($ac)) {
return $ac;
}
$r = $ac->md->getMetadataElement('dcterms:extent');
if (PEAR::isError($r)) {
return $r;
}
$playlength = $r[0]['value'];
}
}
$title = basename($tree->attrs['src']->val);
$offset = Playlist::secondsToPlaylistTime($tree->attrs['begin']->val);
$clipStart = Playlist::secondsToPlaylistTime($tree->attrs['clipStart']->val);
$clipEnd = Playlist::secondsToPlaylistTime($tree->attrs['clipEnd']->val);
$clipLength = Playlist::secondsToPlaylistTime($tree->attrs['clipLength']->val);
$res = "{$ind}<playlistElement id=\"{$plElGunid}\" relativeOffset=\"{$offset}\" clipStart=\"{$clipStart}\" clipEnd=\"{$clipEnd}\" clipLength=\"{$clipLength}\">\n" . "{$ind2}<{$type} id=\"{$acGunid}\" playlength=\"{$playlength}\" title=\"{$title}\"/>\n" . $fInfo . "{$ind}</playlistElement>\n";
return $res;
}
示例3: 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));
}
示例4: 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));
}