当前位置: 首页>>代码示例>>PHP>>正文


PHP Playlist::add方法代码示例

本文整理汇总了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);
 }
开发者ID:codeages,项目名称:m3u8-toolkit,代码行数:14,代码来源:Parser.php

示例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');
     }
 }
开发者ID:laiello,项目名称:atm-music,代码行数:22,代码来源:playlist.php

示例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)) {
开发者ID:Eugen1985,项目名称:stalker_portal,代码行数:30,代码来源:playlists.php


注:本文中的Playlist::add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。