You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pdd-order-api/app/libs/const/class.VideoConst.php

154 lines
4.5 KiB
PHP

<?php
class VideoConst {
const normal = 'normal';
const pause = 'pause';
const cancel = 'cancel';
const videoTime = 9;
/**转场特效**/
const effLeftTop = 'effLeftTo';
const effRightTop = 'effRightTop';
const effLeftBottom = 'effLeftBottom';
const effRightBottom = 'effRightBottom';
const effCenter = 'effCenter';
const effNone = 'none';
const effRand = 'rand';
const effFade = 'fade';
const effSlideright = 'slideright';
const effSlideleft = 'slideleft';
const effZoom = 'zoom';
const effDoubleslide = 'doubleslide';
const effSkew = 'skew';
const effRotate = 'rotate';
const effStretchup = 'stretchup';
/** 场景切换 **/
//淡入当初
const sceneFade = 'sceneFade';
//图片放大
const sceneZoom = 'sceneZoom';
//左右幻灯
const sceneSlide = 'sceneSlide';
//旋转飞入
const sceneRotate = 'sceneRotate';
//斜角切换
const sceneSkew = 'sceneSkew';
//随机旋转
const sceneRand = 'sceneRand';
//百叶窗
const sceneShutters = 'sceneShutters';
//视频未生成
const videoMakerWaiting = 'waiting';
//视频正在生成视频
const videoMakerProcessing = 'processiong';
//视频已生成
const videoMakerSuccess = 'success';
//视频生成失败
const videoMakerFail = 'fail';
const videoUploadHourMaxCnt = 6000;
const videoUploadVenderDayMaxCnt = 1000;
const videoUploadDayMaxCnt = 80000;
const statusTranscode = 'transcode';//转码中
const statusTranscodeI = 0;//转码中
const statusTranscodeFail = 'transcode_fail';//转码失败
const statusTranscodeFailI = -1;//转码失败
const statusWaitAudit = 'wait_audit';//待审核
const statusWaitAuditI = 1;//待审核
const statusAuditSuccess = 'audit_success';//审核通过
const statusAuditSuccessI = 2;//审核通过
const statusAuditFail = 'audit_fail';//审核驳回
const statusAuditFailI = 3;//审核驳回
const statusWait = 'wait';
const statusSuccess = 'success';
const statusFail = 'fail';
const statusUpdateFail = 'update_fail';
const statusCancel = 'cancel';
const statusNone = 'none';
const videoTaskTypeMove = 'move';
const videoTaskTypeMake = 'make';
const videoTaskTypeUpload = 'upload';
const videoMoveCheckStatusQueueMaxCnt = 2000;
const videoMoveQueueMaxCnt = 300;
const videoMakeQueueMaxCnt = 300;
const videoMoveVenderDayMaxCnt = 1500;
const videoTypeMainImage = 1;
const updateVideoStatusStatMinIntervalSecond = 300;
const defaultVideoMusicId = 1;
const defaultVideoEffectId = 1;
public static function getVideoTaskTypeName($taskType) {
$map = [
self::videoTaskTypeMove => '搬家采集',
self::videoTaskTypeMake => '手动制作',
self::videoTaskTypeUpload => '手动上传',
];
return $map[$taskType];
}
public static function getVideoStatusByStatusI($statusI) {
if (!is_numeric($statusI)) {
return self::statusFail;
}
$map = [
self::statusTranscodeI => self::statusTranscode,
self::statusTranscodeFailI => self::statusTranscodeFail,
self::statusWaitAuditI => self::statusWaitAudit,
self::statusAuditSuccessI => self::statusAuditSuccess,
self::statusAuditFailI => self::statusAuditFail,
];
if (isset($map[$statusI])) {
return $map[$statusI];
}
return self::statusFail;
}
public static function getVideoRunningStatusList() {
return [
self::statusWait,
self::statusTranscode,
self::statusWaitAudit,
];
}
public static function getVideoFinishStatusList() {
return [
self::statusSuccess,
self::statusAuditFail,
self::statusTranscodeFail,
self::statusFail,
];
}
public static function isRunningVideoTaskStatus($status) {
if (in_array($status, self::getVideoRunningStatusList())) {
return true;
}
return false;
}
public static function getStatusName($status) {
$statusAndStatusNameMap = array(
self::statusWait => '生成中',
self::statusTranscode => '视频转码中',
self::statusTranscodeFail => '转码失败',
self::statusWaitAudit => '等待审核',
self::statusAuditFail => '审核失败',
self::statusAuditSuccess => '审核成功',
);
return $statusAndStatusNameMap[$status];
}
}