];
if ($this->front_module == 'eui') {
$this->displaySmarty('dspui/video/videoList.html');
} else {
$this->displaySmarty('dydqtshoppc/video/videoList.html');
}
}
/*
* 创建工程项目
*/
public function createProjectAction() {
$this->useLayout('dydqtshoppc-head.html');
$id = $this->request->getIntParam('id');
//获取视频信息
$video_model = new App_Model_Douyin_MysqlVideoStorage();
$video_info = $video_model->getRowByIdSid($id, $this->sid);
$use_platform = empty($video_info['dv_use_platform']) ? [] : json_decode($video_info['dv_use_platform'], 1);
if (!empty($video_info)) {
$video_cfg = empty($video_info['dv_platform']) ? null : json_decode($video_info['dv_platform'], 1);
}
//视频混剪模式
$video_mixed_mode = plum_parse_config('project_mixed_mode','dydqt/project');
$this->output['video_info'] = $video_info;
$this->output['use_platform'] = $use_platform;
$this->output['video_cfg'] = empty($video_cfg) ? null : $video_cfg;
$this->output['video_mixed_mode'] = $video_mixed_mode;
$this->output['font_map'] = (new App_Plugin_Ffmpeg_VideoPlugin())->getFontMap();
$color_list = plum_parse_config('color_list', 'config');
$this->output['color_list'] = $color_list;
//火山引擎、腾讯云配音
$huoshan_vcn = plum_parse_config('hsyq_vcn', 'system');
$tencent_vcn = plum_parse_config('txy_vcn', 'system');
$this->output['audio_vcn'] = empty($tencent_vcn) ? $huoshan_vcn : $tencent_vcn;
$this->output['platform_list'] = plum_parse_config('platform_list', 'dydqt/project');
$this->displaySmarty('dydqtshoppc/video/create-project.tpl');
}
/*
* 添加/编辑视频
*/
public function addVideoAction(){
$this->useLayout('dydqtshoppc-head.html');
$id = $this->request->getIntParam('id');
//获取视频信息
$Video_model = new App_Model_Douyin_MysqlVideoStorage();
$video_info = $Video_model->getRowByIdSid($id, $this->sid);
//视频混剪模式
$video_mixed_mode = plum_parse_config('project_mixed_mode','dydqt/project');
$this->output['video_info'] = $video_info;
$this->output['video_mixed_mode'] = $video_mixed_mode;
$this->displaySmarty('dydqtshoppc/video/addVideo.html');
}
/*
* 保存工程配置
*/
public function saveItemConfigAction() {
$dv_id = $this->request->getIntParam('dv_id');
unset($_REQUEST['q']);
unset($_REQUEST['dv_id']);
//获取视频信息
$video_model = new App_Model_Douyin_MysqlVideoStorage();
$video_info = $video_model->getRowByIdSid($dv_id, $this->sid);
if (empty($video_info)) {
$this->displayJsonError('参数错误');
}
$curr_platform = json_decode($video_info['dv_platform'], 1);
$curr_platform = is_null($curr_platform) ? [] : $curr_platform;
//发音人合集
if (isset($_REQUEST['a_vcn'])) {
$vcn = $this->request->getStrParam('a_vcn');
$vcn = explode(',', $vcn);
unset($_REQUEST['a_vcn']);
$curr_platform['vcn'] = array_combine($vcn, $vcn);
}
//随机色合集
if (isset($_REQUEST['color'])) {
$color_bg = $this->request->getArrParam('color');
$color_list = [];
foreach ($color_bg as $color => $val) {
array_push($color_list, $color);
}
unset($_REQUEST['color']);
$curr_platform['bgcolor'] = $color_list;
}
$updata['dv_platform'] = json_encode(array_merge($curr_platform, $_REQUEST));
$ret = $video_model->updateById($updata, $dv_id);
$this->showAjaxResult($ret, '保存配置');
}
/*
* 添加/编辑视频工程
*/
public function addVideoSubmitAction(){
$dv_id = $this->request->getIntParam('dv_id');
$video_name = $this->request->getStrParam('dv_title');
if (empty($video_name)) $this->displayJsonError('请输入项目名称');
$video_count = $this->request->getIntParam('dv_video_count', 1);
#$video_duration = $this->request->getIntParam('dv_video_duration', 30);
$video_transition = $this->request->getIntParam('dv_video_transition', 0);
$video_filter = $this->request->getIntParam('dv_video_filter', 0);
$video_effect = $this->request->getIntParam('dv_video_effect', 0);
$video_mixed = $this->request->getIntParam('dv_video_mode', 1); //混剪模式
$video_layout = $this->request->getIntParam('dv_video_layout', 1);//竖屏、横屏
$video_use = $this->request->getIntParam('dv_video_use', 5); //视频场景或组合数
$video_shot = $this->request->getIntParam('dv_video_shot', 5); //单镜头时长
$use_only = $this->request->getIntParam('dv_use_only', 0);
$use_platform = $this->request->getArrParam('use_platform');
//视频复用平台
$platform_list = [];
foreach ($use_platform as $key => $val) {
if ($val == 'on') {
array_push($platform_list, $key);
}
}
$video_duration = $video_use*$video_shot;
if ($video_duration < 10 || $video_duration > 120) {
$this->displayJsonError("最终成片时长建议介于10~120秒之间");
}
//获取视频信息
$video_model = new App_Model_Douyin_MysqlVideoStorage();
$name_exist = $video_model->findNameLikeBySid($video_name, $this->sid);
if ($name_exist && $name_exist['dv_id'] != $dv_id) {
$this->displayJsonError("创意工程『{$video_name}』已存在,请添加新工程。");
}
//标题、文案配置参数