本文整理匯總了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);