本文整理汇总了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");
}