本文整理汇总了PHP中Video::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Video::add方法的具体用法?PHP Video::add怎么用?PHP Video::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Video
的用法示例。
在下文中一共展示了Video::add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: video
static function video($database, $plugins, $settings, $path, $albumID = 0, $description = '', $tags = '')
{
$size = filesize($path);
$video = new Video($database, $plugins, $settings, null);
$nameFile = array(array());
$nameFile[0]['name'] = $path;
$nameFile[0]['type'] = Video::getMimeType($path);
$nameFile[0]['tmp_name'] = $path;
$nameFile[0]['error'] = 0;
$nameFile[0]['size'] = $size;
if (!$video->add($nameFile, $albumID, $description, $tags)) {
return false;
}
return true;
}
示例2: uploadVideo
private function uploadVideo()
{
Module::dependencies(isset($_FILES, $_POST['albumID'], $_POST['tags']));
$video = new Video($this->database, $this->plugins, $this->settings, null);
echo $video->add($_FILES, $_POST['albumID'], '', $_POST['tags']);
}
示例3: array
if ($videoFileType != 'mp4') {
$msg .= " Video is not an MP4 file. Please upload .mp4 files only.";
$uploadOk = 0;
}
if ($uploadOk == 0) {
$msg = "Sorry, your video was not uploaded. ERROR: " . $msg;
$json = array("status" => 0, "msg" => $msg);
$dbObj->close();
//Close Database Connection
header('Content-type: application/json');
echo json_encode($json);
} else {
if (move_uploaded_file($_FILES["video"]["tmp_name"], $targetVideo)) {
$msg .= "The file " . basename($_FILES["video"]["name"]) . " has been uploaded.";
$status = 'ok';
echo $videoObj->add();
} else {
$msg = " Sorry, there was an error uploading your video. ERROR: " . $msg;
$json = array("status" => 0, "msg" => $msg);
$dbObj->close();
//Close Database Connection
header('Content-type: application/json');
echo json_encode($json);
}
}
} else {
$json = array("status" => 0, "msg" => $errorArr);
$dbObj->close();
//Close Database Connection
header('Content-type: application/json');
echo json_encode($json);