本文整理匯總了PHP中ilObjMediaObject::removeAdditionalFile方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilObjMediaObject::removeAdditionalFile方法的具體用法?PHP ilObjMediaObject::removeAdditionalFile怎麽用?PHP ilObjMediaObject::removeAdditionalFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ilObjMediaObject
的用法示例。
在下文中一共展示了ilObjMediaObject::removeAdditionalFile方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: extractPreviewImageObject
/**
* Extract preview image
*
* @param
* @return
*/
function extractPreviewImageObject()
{
global $ilCtrl;
$this->checkPermission("write");
$this->mcst_item = new ilNewsItem($_GET["item_id"]);
include_once "./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php";
$mob = new ilObjMediaObject($this->mcst_item->getMobId());
try {
$sec = (int) $_POST["sec"];
if ($sec < 0) {
$sec = 0;
}
if ($mob->getVideoPreviewPic() != "") {
$mob->removeAdditionalFile($mob->getVideoPreviewPic(true));
}
include_once "./Services/MediaObjects/classes/class.ilFFmpeg.php";
$med = $mob->getMediaItem("Standard");
$mob_file = ilObjMediaObject::_getDirectory($mob->getId()) . "/" . $med->getLocation();
$new_file = ilFFmpeg::extractImage($mob_file, "mob_vpreview.png", ilObjMediaObject::_getDirectory($mob->getId()), $sec);
if ($new_file != "") {
ilUtil::sendInfo($this->lng->txt("mcst_image_extracted"), true);
} else {
ilUtil::sendFailure($this->lng->txt("mcst_no_extraction_possible"), true);
}
} catch (ilException $e) {
if (DEVMODE == 1) {
$ret = ilFFmpeg::getLastReturnValues();
$add = is_array($ret) && count($ret) > 0 ? "<br />" . implode($ret, "<br />") : "";
}
ilUtil::sendFailure($e->getMessage() . $add, true);
}
$ilCtrl->redirect($this, "editCastItem");
}