1.获取排序现场列表接口,默认现场类型为5,增加轮播作为条件查询。栏目id为-1表示查询开启了轮播大图的现场记录。
2.在显示m3u8 3.支持了m3u8和mp4格式回顾剪辑,fastClip方法中。若不是直播时移内容,则上传剪辑任务并将返回的newvedioID上传 4.创建流的时候增加了记者流判断,若为记者流则直接返回错误信息 5.增加了SceneSortEntityVo中的四个属性(轮播大图、观看人数、点赞显示和、vr) 6.修改TimeParseUtil解析url末尾的字段 7.produceMediaComplete中,若查询到了回顾记录,则将媒体id赋值给记录对应的属性
This commit is contained in:
parent
82277c9c04
commit
5b5b314166
@ -677,7 +677,7 @@ public class LiveSceneController extends AbstractController {
|
||||
|
||||
if (null == cid)
|
||||
return R.error("必填参数不能为空");
|
||||
|
||||
sceneType = 5;
|
||||
PageUtils page = liveSceneService.sortScenePage(cid, null == pageSize ? 10 : pageSize, null == pageNo ? 1 : pageNo, StringUtils.isBlank(title) ? null : title, sceneType, liveState, null, tenantId);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
|
||||
@ -11,6 +11,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.platform.modules.live.entity.LiveMultimediaEntity;
|
||||
import com.platform.plugs.live.handlers.IVideoClipsHandler;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -47,6 +49,8 @@ import com.platform.modules.plm.util.MaterialUtils;
|
||||
import com.platform.modules.video.service.RealPathResolver;
|
||||
import com.platform.plugs.live.LiveClient;
|
||||
|
||||
import static com.platform.modules.live.utils.TimeParseUtil.parseTimeFromUrl;
|
||||
|
||||
|
||||
@Service("liveSceneRecordService")
|
||||
@Transactional
|
||||
@ -66,6 +70,8 @@ public class LiveSceneRecordServiceImpl extends ServiceImpl<LiveSceneRecordDao,
|
||||
private ForeignProperties foreignProperties;
|
||||
@Autowired
|
||||
private LiveClient liveClient;
|
||||
@Autowired
|
||||
private LiveMultimediaServiceImpl liveMultimediaService;
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
@ -88,7 +94,7 @@ public class LiveSceneRecordServiceImpl extends ServiceImpl<LiveSceneRecordDao,
|
||||
wrapper.orderBy("priority", false);
|
||||
wrapper.orderBy("id", false);
|
||||
// 20200306_Mxy 不显示m3u8类型的回顾
|
||||
wrapper.ne("record_type", LiveConstants.RecordType.M3U8_RECORD);
|
||||
// wrapper.ne("record_type", LiveConstants.RecordType.M3U8_RECORD);
|
||||
Page<LiveSceneRecordEntity> page = this.selectPage(
|
||||
new Query<LiveSceneRecordEntity>(params).getPage(),
|
||||
wrapper
|
||||
@ -121,7 +127,7 @@ public class LiveSceneRecordServiceImpl extends ServiceImpl<LiveSceneRecordDao,
|
||||
|
||||
return new PageUtils(resultPage);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public LiveSceneRecordVo info(Integer id){
|
||||
@ -261,7 +267,7 @@ public class LiveSceneRecordServiceImpl extends ServiceImpl<LiveSceneRecordDao,
|
||||
}
|
||||
// END
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void priority(Integer[] ids,Integer[] prioritys){
|
||||
if(ids==null || ids.length==0 || prioritys==null || prioritys.length==0){
|
||||
@ -287,9 +293,20 @@ public class LiveSceneRecordServiceImpl extends ServiceImpl<LiveSceneRecordDao,
|
||||
|
||||
if (null == recordEntity)
|
||||
return R.error("获取回顾信息失败");
|
||||
|
||||
if (!LiveConstants.RecordType.FAST_RECORD.equals(recordEntity.getRecordType()))
|
||||
return R.error("只有快速回看视频可以进行快速剪辑");
|
||||
String newVideoId = null;
|
||||
if (!LiveConstants.RecordType.FAST_RECORD.equals(recordEntity.getRecordType())){
|
||||
LiveMultimediaEntity multimedia = liveMultimediaService.selectById(recordEntity.getMediaId());
|
||||
if(multimedia==null){
|
||||
return R.error("媒体不存在");
|
||||
}
|
||||
IVideoClipsHandler iVideoClipsHandler = liveClient.videoClips();
|
||||
try {
|
||||
newVideoId = iVideoClipsHandler.submitEditJob(multimedia.getMediaId(),clipStartTime, clipStopTime);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
// return R.error("只有快速回看视频可以进行快速剪辑");
|
||||
|
||||
if ((null != clipStartTime && clipStartTime > recordEntity.getStopTime())
|
||||
|| (null != clipStopTime && clipStopTime > recordEntity.getStopTime())
|
||||
@ -297,35 +314,37 @@ public class LiveSceneRecordServiceImpl extends ServiceImpl<LiveSceneRecordDao,
|
||||
return R.error("参数错误");
|
||||
|
||||
// 剪辑开始与结束时间
|
||||
Long start = (long)(null == clipStartTime ? 0 : clipStartTime + 1);
|
||||
Long stop = (long)(null == clipStopTime ? recordEntity.getStopTime() : clipStopTime);
|
||||
Long start = (long) (null == clipStartTime ? 0 : clipStartTime + 1);
|
||||
Long stop = (long) (null == clipStopTime ? recordEntity.getStopTime() : clipStopTime);
|
||||
DateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
Date startTime = new Date(start * 1000);
|
||||
Date stopTime = new Date(stop * 1000);
|
||||
|
||||
// 生成快速剪辑回顾
|
||||
LiveSceneRecordEntity clipRecordEntity = new LiveSceneRecordEntity();
|
||||
|
||||
clipRecordEntity.setRecordType(LiveConstants.RecordType.CLIP_RECORD);
|
||||
clipRecordEntity.setSceneId(recordEntity.getSceneId());
|
||||
clipRecordEntity.setDuration((double)(stop - start));
|
||||
clipRecordEntity.setStartTime(clipStartTime);
|
||||
clipRecordEntity.setStopTime(clipStopTime);
|
||||
clipRecordEntity.setCreateDate(new Date());
|
||||
clipRecordEntity.setRecordStatus(SceneConstants.RECORD_TO_SHOW);
|
||||
clipRecordEntity.setIsDelete(SceneConstants.NOT_DELETE);
|
||||
clipRecordEntity.setTenantId(recordEntity.getTenantId());
|
||||
clipRecordEntity.setRecordName(recordName);
|
||||
if (null != recordEntity.getCreatorId())
|
||||
clipRecordEntity.setCreatorId(recordEntity.getCreatorId());
|
||||
if (StringUtils.isNotBlank(recordEntity.getTitleImage()))
|
||||
clipRecordEntity.setTitleImage(recordEntity.getTitleImage());
|
||||
// 设置Uri
|
||||
String uri = recordEntity.getUri().substring(0, recordEntity.getUri().indexOf("&"));
|
||||
String clipUri = uri + String.format("&aliyunols=on&lhs_start_human_s_8=%s&lhs_end_human_s_8=%s", df.format(startTime), df.format(stopTime));
|
||||
clipRecordEntity.setUri(clipUri);
|
||||
|
||||
this.insert(clipRecordEntity);
|
||||
clipRecordEntity.setRecordType(LiveConstants.RecordType.CLIP_RECORD);
|
||||
clipRecordEntity.setSceneId(recordEntity.getSceneId());
|
||||
clipRecordEntity.setDuration((double) (stop - start));
|
||||
clipRecordEntity.setStartTime(clipStartTime);
|
||||
clipRecordEntity.setStopTime(clipStopTime);
|
||||
clipRecordEntity.setCreateDate(new Date());
|
||||
clipRecordEntity.setRecordStatus(SceneConstants.RECORD_TO_SHOW);
|
||||
clipRecordEntity.setIsDelete(SceneConstants.NOT_DELETE);
|
||||
clipRecordEntity.setTenantId(recordEntity.getTenantId());
|
||||
clipRecordEntity.setRecordName(recordName);
|
||||
if (null != recordEntity.getCreatorId())
|
||||
clipRecordEntity.setCreatorId(recordEntity.getCreatorId());
|
||||
if (StringUtils.isNotBlank(recordEntity.getTitleImage()))
|
||||
clipRecordEntity.setTitleImage(recordEntity.getTitleImage());
|
||||
// 设置Uri
|
||||
if(StringUtils.isNotBlank(newVideoId)){
|
||||
clipRecordEntity.setTxt(newVideoId);
|
||||
}else {
|
||||
String uri = recordEntity.getUri().substring(0, recordEntity.getUri().indexOf("&"));
|
||||
String clipUri = uri + String.format("&aliyunols=on&lhs_start_human_s_8=%s&lhs_end_human_s_8=%s", df.format(startTime), df.format(stopTime));
|
||||
clipRecordEntity.setUri(clipUri);
|
||||
}
|
||||
this.insert(clipRecordEntity);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
@ -370,9 +389,9 @@ public class LiveSceneRecordServiceImpl extends ServiceImpl<LiveSceneRecordDao,
|
||||
|| null == recordEntity.getStartTime() || null == recordEntity.getStopTime())
|
||||
return R.error("获取回顾信息错误");
|
||||
Integer[] times = null;
|
||||
|
||||
|
||||
String content = HttpClientHelper.sendGetAndGetFileContent(MaterialUtils.getMaterialUrl(recordEntity.getUri(), foreignProperties.getMediaurl()), false);
|
||||
|
||||
|
||||
if(StringUtils.isNotBlank(content)){
|
||||
String[] strs = content.replaceAll("(#EXT).*[\n]", "").split("\n");
|
||||
if(strs!=null && strs.length>0){
|
||||
@ -388,7 +407,7 @@ public class LiveSceneRecordServiceImpl extends ServiceImpl<LiveSceneRecordDao,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return R.ok().put("slicingTimes", times);
|
||||
}
|
||||
|
||||
|
||||
@ -1084,7 +1084,11 @@ public class LiveSceneServiceImpl extends ServiceImpl<LiveSceneDao, LiveSceneEnt
|
||||
|
||||
@Override
|
||||
public R createStream(LiveSceneLiveInfoEntity liveInfoEntity) {
|
||||
LiveSceneEntity scene = selectById(liveInfoEntity.getSceneId());
|
||||
if (SceneConstants.InfoTypeEnum.REPORTER.getType().equals(liveInfoEntity.getInfoType())) {
|
||||
return R.error("流类型错误,不存在记者流");
|
||||
}
|
||||
|
||||
LiveSceneEntity scene = selectById(liveInfoEntity.getSceneId());
|
||||
if (scene == null) {
|
||||
return R.error("现场不存在");
|
||||
}
|
||||
@ -2461,7 +2465,11 @@ public class LiveSceneServiceImpl extends ServiceImpl<LiveSceneDao, LiveSceneEnt
|
||||
Page<SceneSortEntityVo> page = new Page<>(pageNo, pageSize);
|
||||
|
||||
// 栏目id
|
||||
params.put("cid", cid);
|
||||
if(cid == -1)
|
||||
params.put("carouselImage",1);
|
||||
else {
|
||||
params.put("cid", cid);
|
||||
}
|
||||
// 标题
|
||||
if (StringUtils.isNotBlank(title)) {
|
||||
params.put("title", title);
|
||||
|
||||
@ -15,7 +15,7 @@ public class TimeParseUtil {
|
||||
try {
|
||||
// 提取时间参数
|
||||
String startTimeStr = extractParameter(url, "lhs_start_human_s_8");
|
||||
String endTimeStr = extractParameter(url, "lhs_vodend_human_s_8");
|
||||
String endTimeStr = extractParameter(url, "lhs_end_human_s_8");
|
||||
|
||||
if (startTimeStr == null || endTimeStr == null) {
|
||||
throw new IllegalArgumentException("URL中未找到有效的时间参数");
|
||||
|
||||
@ -193,4 +193,16 @@ public class SceneSortEntityVo {
|
||||
@ApiModelProperty(value = "拖动排序标识")
|
||||
private long dragSort;
|
||||
|
||||
/** 轮播大图 **/
|
||||
@ApiModelProperty(value = "轮播大图")
|
||||
private Boolean carouselImage; // 轮播大图
|
||||
/** 观看人数 **/
|
||||
@ApiModelProperty(value = "观看人数")
|
||||
private Boolean viewerCount; // 观看人数
|
||||
/** 点赞显示 **/
|
||||
@ApiModelProperty(value = "点赞显示")
|
||||
private Boolean likeDisplay; // 点赞显示
|
||||
/** VR直播 **/
|
||||
@ApiModelProperty(value = "VR直播")
|
||||
private Boolean vrLive; // VR直播
|
||||
}
|
||||
|
||||
@ -16,6 +16,8 @@ import com.platform.common.utils.Query;
|
||||
import com.platform.modules.live.constants.SceneConstants;
|
||||
import com.platform.modules.live.dao.LiveMultimediaDao;
|
||||
import com.platform.modules.live.entity.LiveMultimediaEntity;
|
||||
import com.platform.modules.live.entity.LiveSceneRecordEntity;
|
||||
import com.platform.modules.live.service.LiveSceneRecordService;
|
||||
import com.platform.modules.live.utils.ForeignProperties;
|
||||
import com.platform.modules.plm.util.FileCalculateUtils;
|
||||
import com.platform.modules.plm.util.FileSizeUnitEnum;
|
||||
@ -61,6 +63,8 @@ public class VideoServiceImpl extends ServiceImpl<EditProjectMaterialDao, EditPr
|
||||
private LiveMultimediaDao liveMultimediaDao;
|
||||
@Autowired
|
||||
private LiveClient liveClient;
|
||||
@Autowired
|
||||
private LiveSceneRecordService liveSceneRecordService;
|
||||
|
||||
@Override
|
||||
public void insertProject(EditProjectEntity evo) {
|
||||
@ -529,7 +533,7 @@ public class VideoServiceImpl extends ServiceImpl<EditProjectMaterialDao, EditPr
|
||||
entity.setMediaSnapshots(org.apache.commons.lang3.StringUtils.join(snapshots, ","));
|
||||
entity.setTags(video.getTags());
|
||||
entity.setCoverUrl(extractString(video.getCoverURL(), "/", 3));
|
||||
|
||||
|
||||
entity.setCateId((video.getCateId() != null ? video.getCateId() + "" : ""));
|
||||
entity.setMediaUrl(extractString(mezzanine.getFileURL(), "/", 3));
|
||||
entity.setMediaWidth(mezzanine.getWidth() == null ? 0 : mezzanine.getWidth().intValue());
|
||||
@ -565,6 +569,14 @@ public class VideoServiceImpl extends ServiceImpl<EditProjectMaterialDao, EditPr
|
||||
} else {
|
||||
liveMultimediaDao.insert(entity);
|
||||
}
|
||||
|
||||
LiveSceneRecordEntity sceneRecordEntity = liveSceneRecordService.selectOne(new EntityWrapper<LiveSceneRecordEntity>()
|
||||
.eq("txt", videoId)
|
||||
);
|
||||
if(sceneRecordEntity != null){
|
||||
sceneRecordEntity.setMediaId(entity.getId());
|
||||
liveSceneRecordService.updateById(sceneRecordEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
@ -115,6 +115,9 @@
|
||||
<if test="tenantId != null and tenantId != ''">
|
||||
and scene.tenant_id = #{tenantId}
|
||||
</if>
|
||||
<if test="carouselImage != null and carouselImage != ''">
|
||||
and scene.carousel_image = #{carouselImage}
|
||||
</if>
|
||||
order by sceneChannel.drag_sort desc, scene.is_top desc, scene.priority desc, scene.live_state asc, scene.live_start desc, scene.id desc
|
||||
</select>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user