本文整理汇总了PHP中Playlist::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Playlist::add方法的具体用法?PHP Playlist::add怎么用?PHP Playlist::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Playlist
的用法示例。
在下文中一共展示了Playlist::add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse
public function parse($content)
{
$data = $this->content2Data($content);
$version = 3;
$mediaSequence = 0;
extract($data);
// to $version, $mediaSequence, $targetDuration
$playlist = new Playlist();
foreach ($data['playlist'] as $index => $row) {
$mediaSegment = new Segment($row['uri'], $row['duration'], $mediaSequence + $index, !empty($row['isDiscontinuity']));
$playlist->add($mediaSegment);
}
return new M3U8($playlist, $version, $targetDuration, null, $allowCache, $hasEndlist);
}
示例2: action_add_playlist
public function action_add_playlist()
{
$user = $this->is_logged();
if ($user === false) {
return Redirect::to_action('login');
} else {
$play = new Playlist();
if (isset($_POST['playlist']) and $_POST['playlist'] != "") {
$play->set_name_playlist($_POST['playlist']);
} else {
$this->_error_form = true;
$this->_error_msg .= "Il y a une erreur dans le nom";
}
if ($this->_error_form == false) {
$play->set_update(date('y-m-d'));
$this->_error_msg .= "Ajout réussi!";
$play->add();
return Redirect::to_action('playlist');
}
return Redirect::to_action('playlist@add');
}
}
示例3: trim
session_start();
ob_start();
include "./common.php";
$error = '';
$action_name = 'add';
$action_value = _('Add');
Admin::checkAuth();
Admin::checkAccess(AdminAccess::ACCESS_VIEW);
foreach (@$_POST as $key => $value) {
$_POST[$key] = trim($value);
}
$playlist = new Playlist();
if (@$_POST['add']) {
Admin::checkAccess(AdminAccess::ACCESS_CREATE);
$playlist->add($_POST['name'], $_POST['group_id']);
header("Location: playlists.php");
}
$id = @intval($_GET['id']);
if (!empty($id)) {
if (@$_POST['edit']) {
Admin::checkAccess(AdminAccess::ACCESS_EDIT);
$playlist->set(array('name' => $_POST['name'], 'group_id' => $_POST['group_id']), $_GET['id']);
header("Location: playlists.php");
} elseif (@$_GET['del']) {
Admin::checkAccess(AdminAccess::ACCESS_DELETE);
$playlist->del($id);
header("Location: playlists.php");
}
}
if (@$_GET['edit'] && !empty($id)) {