當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Video::add方法代碼示例

本文整理匯總了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;
 }
開發者ID:thejandroman,項目名稱:Lychee,代碼行數:15,代碼來源:Import.php

示例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']);
 }
開發者ID:thejandroman,項目名稱:Lychee,代碼行數:6,代碼來源:Admin.php

示例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);
開發者ID:Mojolagbe2014,項目名稱:mojoimipakiti,代碼行數:31,代碼來源:manage-videos.php


注:本文中的Video::add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。