break; case 'removeTempFiles': _deleteTempFiles($sId); break; case 'screenshot': $sPlayFile = $sFilesPath . $sId . (file_exists($sFilesPath . $sId . VC_M4V_EXTENSION) ? VC_M4V_EXTENSION : VC_FLV_EXTENSION); if (_grabImages($sPlayFile, $sFilesPath . $sId, $sTime, true)) { $sContents = parseXml($aXmlTemplates['result'], "", SUCCESS_VAL); } else { $sContents = parseXml($aXmlTemplates['result'], "msgErrorScreenshot", FAILED_VAL); } break; case 'screenshotRecorder': $sFile = $sFilesPath . $sId . VC_TEMP_FILE_NAME; $sPlayFile = $sFile . (file_exists($sFile . VC_M4V_EXTENSION) ? VC_M4V_EXTENSION : VC_FLV_EXTENSION); if (_grabImages($sPlayFile, $sFile, $sTime, true)) { $sContents = parseXml($aXmlTemplates['result'], "", SUCCESS_VAL); } else { $sContents = parseXml($aXmlTemplates['result'], "msgErrorScreenshot", FAILED_VAL); } break; case 'updateFile': $sCategoryUpdate = $sCategory == "0" ? "" : ", `Categories`='" . $sCategory . "'"; getResult("UPDATE `" . MODULE_DB_PREFIX . "Files` SET `Title`='" . $sTitle . "', `Tags`='" . $sTags . "', `Description`='" . $sDesc . "'" . $sCategoryUpdate . " WHERE `ID`='" . $sId . "' LIMIT 1"); break; /** * set user's uploaded file time */ /** * set user's uploaded file time */
function _convertMain($sId, $sTmpl = "") { global $sFilesPath; global $sModule; $sTempFile = $sFilesPath . $sId; $sResultFile = $sTempFile . (vcUsex264() ? VC_M4V_EXTENSION : VC_FLV_EXTENSION); $bResult = true; if (!file_exists($sResultFile) || filesize($sResultFile) == 0) { if (empty($sTmpl)) { $sTmpl = _getConverterTmpl($sTempFile, $sTempFile, true); } $sTmpl = vcPrepareCommand($sTmpl, array("output" => $sResultFile)); $bResult = convertFile($sResultFile, $sTmpl); if (!$bResult) { $sTmpl = _getConverterTmpl($sTempFile, $sTempFile, false); $sTmpl = vcPrepareCommand($sTmpl, array("output" => $sResultFile)); $bResult = convertFile($sResultFile, $sTmpl); } } if ($bResult && vcUsex264()) { $bResult = moveMp4Meta($sResultFile); } @chmod($sResultFile, 0666); return $bResult && _grabImages($sResultFile, $sTempFile); }