mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-08-07 15:01:38 +08:00
改进上传转码流程
This commit is contained in:
parent
b5ceb155f3
commit
7f9314a111
@ -57,7 +57,7 @@ class VodEventTask extends Task
|
||||
$attrs = $chapter->attrs;
|
||||
|
||||
/**
|
||||
* 获取不到时长,尝试通过接口获得
|
||||
* 获取不到时长,尝试通过主动查询获取
|
||||
*/
|
||||
if ($duration == 0) {
|
||||
$duration = $this->getFileDuration($fileId);
|
||||
@ -68,6 +68,7 @@ class VodEventTask extends Task
|
||||
*/
|
||||
if ($duration == 0) {
|
||||
$attrs['file']['status'] = ChapterModel::FS_FAILED;
|
||||
$attrs['duration'] = 0;
|
||||
$chapter->update(['attrs' => $attrs]);
|
||||
return;
|
||||
}
|
||||
|
@ -133,14 +133,19 @@ class ChapterContent extends Service
|
||||
|
||||
$vod = $chapterRepo->findChapterVod($chapter->id);
|
||||
|
||||
$vod->file_id = $fileId;
|
||||
$vod->file_transcode = [];
|
||||
$vod->update();
|
||||
|
||||
$attrs = $chapter->attrs;
|
||||
$attrs['duration'] = 0;
|
||||
$attrs['file']['status'] = ChapterModel::FS_UPLOADED;
|
||||
|
||||
if ($fileId != $vod->file_id) {
|
||||
$vod->file_id = $fileId;
|
||||
$vod->file_transcode = [];
|
||||
$vod->update();
|
||||
|
||||
$attrs['file']['status'] = ChapterModel::FS_UPLOADED;
|
||||
$attrs['duration'] = 0;
|
||||
}
|
||||
|
||||
$chapter->attrs = $attrs;
|
||||
|
||||
$chapter->update();
|
||||
|
||||
$this->updateCourseVodAttrs($vod->course_id);
|
||||
|
@ -70,7 +70,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"></label>
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn" lay-submit="true" lay-filter="go">提交</button>
|
||||
<button id="vod-submit" class="layui-btn layui-btn-disabled" disabled="disabled" lay-submit="true" lay-filter="go">提交</button>
|
||||
<button type="button" class="kg-back layui-btn layui-btn-primary">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -46,6 +46,7 @@ layui.use(['jquery', 'element'], function () {
|
||||
|
||||
uploader.done().then(function (result) {
|
||||
$('input[name=file_id]').val(result.fileId);
|
||||
$('#vod-submit').removeAttr('disabled').removeClass('layui-btn-disabled');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: $('#vod-form').attr('action'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user